| 41 | } |
| 42 | |
| 43 | static bool |
| 44 | has_zero_bit (const lay::Bitmap *bitmap, unsigned int ixmin, unsigned int iymin, unsigned int ixmax, unsigned int iymax) |
| 45 | { |
| 46 | uint32_t imin = ixmin / 32; |
| 47 | uint32_t imax = ixmax / 32; |
| 48 | |
| 49 | if (imin == imax) { |
| 50 | |
| 51 | uint32_t m = ((unsigned int) 0xffffffff << (ixmin % 32)) & ((unsigned int) 0xffffffff >> (31 - (ixmax % 32))); |
| 52 | |
| 53 | for (unsigned int y = iymin; y <= iymax; ++y) { |
| 54 | |
| 55 | if (bitmap->is_scanline_empty (y)) { |
| 56 | return true; |
| 57 | } |
| 58 | |
| 59 | if ((bitmap->scanline (y) [imin] & m) != m) { |
| 60 | return true; |
| 61 | } |
| 62 | |
| 63 | } |
| 64 | |
| 65 | } else { |
| 66 | |
| 67 | uint32_t m1 = ((unsigned int) 0xffffffff << (ixmin % 32)); |
| 68 | uint32_t m2 = ((unsigned int) 0xffffffff >> (31 - (ixmax % 32))); |
| 69 | |
| 70 | for (unsigned int y = iymin; y <= iymax; ++y) { |
| 71 | |
| 72 | if (bitmap->is_scanline_empty (y)) { |
| 73 | return true; |
| 74 | } |
| 75 | |
| 76 | if ((bitmap->scanline (y) [imin] & m1) != m1) { |
| 77 | return true; |
| 78 | } |
| 79 | for (unsigned int i = imin + 1; i < imax; ++i) { |
| 80 | if (bitmap->scanline (y) [i] != 0xffffffff) { |
| 81 | return true; |
| 82 | } |
| 83 | } |
| 84 | if ((bitmap->scanline (y) [imax] & m2) != m2) { |
| 85 | return true; |
| 86 | } |
| 87 | |
| 88 | } |
| 89 | |
| 90 | } |
| 91 | |
| 92 | return false; |
| 93 | } |
| 94 | |
| 95 | static bool |
| 96 | skip_quad (const db::Box &qb, const lay::Bitmap *vertex_bitmap, const db::CplxTrans &trans) |
no test coverage detected