Changeset 7e38970d in mainline for uspace/drv/fb/kfb/port.c


Ignore:
Timestamp:
2020-12-07T00:08:37Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
25f26600
Parents:
7a873f0 (diff), 8596474 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'jxsvoboda-gfx' into master

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/fb/kfb/port.c

    r7a873f0 r7e38970d  
    5050#include <gfx/color.h>
    5151#include <gfx/coord.h>
    52 #include <io/mode.h>
    5352#include <io/pixelmap.h>
    5453#include <ipcgfx/server.h>
     
    200199
    201200        /* Check that we support all required flags */
    202         if ((params->flags & ~bmpf_color_key) != 0)
     201        if ((params->flags & ~(bmpf_color_key | bmpf_colorize)) != 0)
    203202                return ENOTSUP;
    204203
     
    307306
    308307        if ((kfbbm->flags & bmpf_color_key) != 0) {
     308                /* Simple copy */
    309309                for (pos.y = crect.p0.y; pos.y < crect.p1.y; pos.y++) {
    310310                        for (pos.x = crect.p0.x; pos.x < crect.p1.x; pos.x++) {
     
    319319                        }
    320320                }
     321        } else if ((kfbbm->flags & bmpf_colorize) != 0) {
     322                /* Color key */
     323                for (pos.y = crect.p0.y; pos.y < crect.p1.y; pos.y++) {
     324                        for (pos.x = crect.p0.x; pos.x < crect.p1.x; pos.x++) {
     325                                gfx_coord2_subtract(&pos, &kfbbm->rect.p0, &sp);
     326                                gfx_coord2_add(&pos, &offs, &dp);
     327
     328                                color = pixelmap_get_pixel(&pbm, sp.x, sp.y);
     329                                kfb->pixel2visual(kfb->addr +
     330                                    FB_POS(kfb, dp.x, dp.y), color);
     331                        }
     332                }
    321333        } else {
     334                /* Color key & colorize */
    322335                for (pos.y = crect.p0.y; pos.y < crect.p1.y; pos.y++) {
    323336                        for (pos.x = crect.p0.x; pos.x < crect.p1.x; pos.x++) {
Note: See TracChangeset for help on using the changeset viewer.