Changeset 7dba813 in mainline for uspace/lib/draw/source.c
- Timestamp:
- 2012-11-22T09:03:39Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ba733e83
- Parents:
- 8e6ec6e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/draw/source.c
r8e6ec6e r7dba813 90 90 } 91 91 92 bool source_is_fast(source_t *source) 93 { 94 return (source->mask == NULL) 95 && (source->alpha == (pixel_t) PIXEL(255, 0, 0, 0)) 96 && (source->texture != NULL) 97 && (source->texture_tile == false) 98 && transform_is_fast(&source->transform); 99 } 100 101 pixel_t *source_direct_access(source_t *source, double x, double y) 102 { 103 assert(source_is_fast(source)); 104 105 long _x = (long) (x + source->transform.m[0][2]); 106 long _y = (long) (y + source->transform.m[1][2]); 107 108 pixelmap_t *pixmap = surface_pixmap_access(source->texture); 109 if (_x < 0 || _x >= (long) pixmap->width || _y < 0 || _y >= (long) pixmap->height) { 110 return NULL; 111 } 112 113 return pixelmap_pixel_at(pixmap, (sysarg_t) _x, (sysarg_t) _y); 114 } 115 92 116 pixel_t source_determine_pixel(source_t *source, double x, double y) 93 117 {
Note:
See TracChangeset
for help on using the changeset viewer.