| 81 | |
| 82 | |
| 83 | int cmpBuf(int x, int y, int width, int pitch, int height, PF *pf, |
| 84 | unsigned char *buf, int offset, bool flip = false) |
| 85 | { |
| 86 | int i, j; |
| 87 | |
| 88 | for(j = 0; j < height; j++) |
| 89 | { |
| 90 | int line = flip ? height - 1 - j : j; |
| 91 | for(i = 0; i < width; i++) |
| 92 | { |
| 93 | bool ignore = false; |
| 94 | #ifdef __APPLE__ |
| 95 | // In XQuartz, X[Shm]GetImage() picks up the little window resize |
| 96 | // gadget at the bottom right, so we have to ignore those pixels. |
| 97 | if(line >= height - 16 && i >= width - 16) ignore = true; |
| 98 | #endif |
| 99 | int r, g, b; |
| 100 | pf->getRGB(&buf[line * pitch + i * pf->size], &r, &g, &b); |
| 101 | if(r != (i + x + offset) % MAXRGB && !ignore) |
| 102 | return 0; |
| 103 | if(g != (j + y + offset) % MAXRGB && !ignore) |
| 104 | return 0; |
| 105 | if(b != (j + y + i + x + offset) % MAXRGB && !ignore) |
| 106 | return 0; |
| 107 | } |
| 108 | } |
| 109 | return 1; |
| 110 | } |
| 111 | |
| 112 | |
| 113 | // Makes sure the frame buffer has been cleared prior to a write |
no outgoing calls
no test coverage detected