Changes in uspace/lib/draw/source.c [b3222a3:f698054] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/draw/source.c
rb3222a3 rf698054 45 45 source->color = PIXEL(0, 0, 0, 0); 46 46 source->texture = NULL; 47 source->texture_ extend = PIXELMAP_EXTEND_TRANSPARENT_BLACK;47 source->texture_tile = false; 48 48 49 49 source->alpha = PIXEL(255, 0, 0, 0); 50 50 source->mask = NULL; 51 source->mask_ extend = PIXELMAP_EXTEND_TRANSPARENT_BLACK;51 source->mask_tile = false; 52 52 } 53 53 … … 73 73 } 74 74 75 void source_set_texture(source_t *source, surface_t *texture, 76 pixelmap_extend_t extend) 75 void source_set_texture(source_t *source, surface_t *texture, bool tile) 77 76 { 78 77 source->texture = texture; 79 source->texture_ extend = extend;78 source->texture_tile = tile; 80 79 } 81 80 … … 85 84 } 86 85 87 void source_set_mask(source_t *source, surface_t *mask, 88 pixelmap_extend_t extend) 86 void source_set_mask(source_t *source, surface_t *mask, bool tile) 89 87 { 90 88 source->mask = mask; 91 source->mask_ extend = extend;89 source->mask_tile = tile; 92 90 } 93 91 94 92 bool source_is_fast(source_t *source) 95 93 { 96 return ((source->mask == NULL) && 97 (source->alpha == (pixel_t) PIXEL(255, 0, 0, 0)) && 98 (source->texture != NULL) && 99 (transform_is_fast(&source->transform))); 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); 100 99 } 101 100 … … 104 103 assert(source_is_fast(source)); 105 104 106 long _x = (long) (x + source->transform.m atrix[0][2]);107 long _y = (long) (y + source->transform.m atrix[1][2]);105 long _x = (long) (x + source->transform.m[0][2]); 106 long _y = (long) (y + source->transform.m[1][2]); 108 107 109 108 return pixelmap_pixel_at( … … 121 120 mask_pix = source->filter( 122 121 surface_pixmap_access(source->mask), 123 x, y, source->mask_ extend);122 x, y, source->mask_tile); 124 123 } else { 125 124 mask_pix = source->alpha; … … 134 133 texture_pix = source->filter( 135 134 surface_pixmap_access(source->texture), 136 x, y, source->texture_ extend);135 x, y, source->texture_tile); 137 136 } else { 138 137 texture_pix = source->color;
Note:
See TracChangeset
for help on using the changeset viewer.