Changeset bea947f in mainline for uspace/lib/guigfx/src/canvas.c
- Timestamp:
- 2020-05-24T17:59:02Z (4 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b3b00b6
- Parents:
- ef20a91
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/guigfx/src/canvas.c
ref20a91 rbea947f 197 197 gfx_coord2_subtract(¶ms->rect.p1, ¶ms->rect.p0, &dim); 198 198 cbm->rect = params->rect; 199 cbm->flags = params->flags; 200 cbm->key_color = params->key_color; 199 201 200 202 if (alloc == NULL) { … … 259 261 gfx_coord2_t offs; 260 262 gfx_coord2_t dim; 263 gfx_coord_t x, y; 264 pixel_t pixel; 261 265 262 266 if (srect0 != NULL) … … 288 292 PIXELMAP_EXTEND_TRANSPARENT_BLACK); 289 293 290 drawctx_t drawctx; 291 drawctx_init(&drawctx, cbm->cgc->surface); 292 293 drawctx_set_source(&drawctx, &source); 294 drawctx_transfer(&drawctx, drect.p0.x, drect.p0.y, dim.x, dim.y); 294 if ((cbm->flags & bmpf_color_key) == 0) { 295 drawctx_t drawctx; 296 drawctx_init(&drawctx, cbm->cgc->surface); 297 298 drawctx_set_source(&drawctx, &source); 299 drawctx_transfer(&drawctx, drect.p0.x, drect.p0.y, dim.x, dim.y); 300 } else { 301 for (y = drect.p0.y; y < drect.p1.y; y++) { 302 for (x = drect.p0.x; x < drect.p1.x; x++) { 303 pixel = source_determine_pixel(&source, x, y); 304 if (pixel != cbm->key_color) { 305 surface_put_pixel(cbm->cgc->surface, 306 x, y, pixel); 307 } 308 } 309 } 310 } 295 311 296 312 update_canvas(cbm->cgc->canvas, cbm->cgc->surface);
Note:
See TracChangeset
for help on using the changeset viewer.