Ignore:
File:
1 edited

Legend:

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

    r8630748 r6d527cff  
    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.