Changeset 25eec4e in mainline for uspace/lib/draw/surface.c
- Timestamp:
- 2013-04-19T18:38:18Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6d717a4
- Parents:
- a1e2df13 (diff), 289cb7dd (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/draw/surface.c
ra1e2df13 r25eec4e 143 143 } 144 144 145 void surface_add_damaged_region(surface_t *surface, surface_coord_t x, surface_coord_t y, 146 surface_coord_t width, surface_coord_t height) 147 { 148 surface->dirty_x_lo = surface->dirty_x_lo > x ? x : surface->dirty_x_lo; 149 surface->dirty_y_lo = surface->dirty_y_lo > y ? y : surface->dirty_y_lo; 150 151 surface_coord_t x_hi = x + width - 1; 152 surface_coord_t y_hi = y + height - 1; 153 154 surface->dirty_x_hi = surface->dirty_x_hi < x_hi ? x_hi : surface->dirty_x_hi; 155 surface->dirty_y_hi = surface->dirty_y_hi < y_hi ? y_hi : surface->dirty_y_hi; 156 } 157 145 158 void surface_reset_damaged_region(surface_t *surface) 146 159 { … … 158 171 surface->dirty_y_hi = surface->dirty_y_hi < y ? y : surface->dirty_y_hi; 159 172 160 if (x < surface->pixmap.width && y < surface->pixmap.height) { 161 pixelmap_put_pixel(&surface->pixmap, x, y, pixel); 162 } 173 pixelmap_put_pixel(&surface->pixmap, x, y, pixel); 163 174 } 164 175 165 176 pixel_t surface_get_pixel(surface_t *surface, surface_coord_t x, surface_coord_t y) 166 177 { 167 if (x < surface->pixmap.width && y < surface->pixmap.height) { 168 return pixelmap_get_pixel(&surface->pixmap, x, y); 169 } else { 170 return 0; 171 } 178 return pixelmap_get_pixel(&surface->pixmap, x, y); 172 179 } 173 180
Note:
See TracChangeset
for help on using the changeset viewer.