Changeset 7e38970d in mainline for uspace/lib/memgfx/src/memgc.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/lib/memgfx/src/memgc.c

    r7a873f0 r7e38970d  
    225225
    226226        /* Check that we support all requested flags */
    227         if ((params->flags & ~(bmpf_color_key | bmpf_direct_output)) != 0)
     227        if ((params->flags & ~(bmpf_color_key | bmpf_colorize |
     228            bmpf_direct_output)) != 0)
    228229                return ENOTSUP;
    229230
     
    367368                /* Nothing to do */
    368369        } else if ((mbm->flags & bmpf_color_key) == 0) {
     370                /* Simple copy */
    369371                for (y = drect.p0.y; y < drect.p1.y; y++) {
    370372                        for (x = drect.p0.x; x < drect.p1.x; x++) {
     
    375377                        }
    376378                }
    377         } else {
     379        } else if ((mbm->flags & bmpf_colorize) == 0) {
     380                /* Color key */
    378381                for (y = drect.p0.y; y < drect.p1.y; y++) {
    379382                        for (x = drect.p0.x; x < drect.p1.x; x++) {
     
    385388                        }
    386389                }
     390        } else {
     391                /* Color key & colorization */
     392                for (y = drect.p0.y; y < drect.p1.y; y++) {
     393                        for (x = drect.p0.x; x < drect.p1.x; x++) {
     394                                pixel = pixelmap_get_pixel(&smap,
     395                                    x - mbm->rect.p0.x - offs.x,
     396                                    y - mbm->rect.p0.y - offs.y);
     397                                if (pixel != mbm->key_color)
     398                                        pixelmap_put_pixel(&dmap, x, y,
     399                                            mbm->mgc->color);
     400                        }
     401                }
    387402        }
    388403
Note: See TracChangeset for help on using the changeset viewer.