| 257 | } |
| 258 | |
| 259 | void Bitmap::CheckPixels(uint32_t flags) { |
| 260 | if (flags & Flag_System) { |
| 261 | DynamicFormat format(32,8,24,8,16,8,8,8,0,PF::Alpha); |
| 262 | uint32_t pixel; |
| 263 | Bitmap bmp(reinterpret_cast<void*>(&pixel), 1, 1, 4, format); |
| 264 | pixman_image_composite32(PIXMAN_OP_SRC, bitmap.get(), (pixman_image_t*) NULL, bmp.bitmap.get(), |
| 265 | 0, 32, 0, 0, 0, 0, 1, 1); |
| 266 | bg_color = Color((int)(pixel>>24)&0xFF, (int)(pixel>>16)&0xFF, (int)(pixel>>8)&0xFF, (int)pixel&0xFF); |
| 267 | pixman_image_composite32(PIXMAN_OP_SRC, bitmap.get(), (pixman_image_t*) NULL, bmp.bitmap.get(), |
| 268 | 16, 32, 0, 0, 0, 0, 1, 1); |
| 269 | sh_color = Color((int)(pixel>>24)&0xFF, (int)(pixel>>16)&0xFF, (int)(pixel>>8)&0xFF, (int)pixel&0xFF); |
| 270 | } |
| 271 | |
| 272 | if (flags & Flag_Chipset) { |
| 273 | const int h = height() / TILE_SIZE; |
| 274 | const int w = width() / TILE_SIZE; |
| 275 | tile_opacity = TileOpacity(w, h); |
| 276 | |
| 277 | for (int ty = 0; ty < h; ++ty) { |
| 278 | for (int tx = 0; tx < w; ++tx) { |
| 279 | Rect rect(tx * TILE_SIZE, ty * TILE_SIZE, TILE_SIZE, TILE_SIZE); |
| 280 | auto op = ComputeImageOpacity(rect); |
| 281 | tile_opacity.Set(tx, ty, op); |
| 282 | } |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | if (flags & Flag_ReadOnly) { |
| 287 | read_only = true; |
| 288 | |
| 289 | image_opacity = ComputeImageOpacity(); |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | Color Bitmap::GetColorAt(int x, int y) const { |
| 294 | if (x < 0 || x >= width() || y < 0 || y >= height()) { |
no test coverage detected