-void BitmapOutputDev::checkNewText(int x1, int y1, int x2, int y2)
+int checkAlphaSanity(SplashBitmap*boolbtm, SplashBitmap*alphabtm)
+{
+ assert(boolbtm->getWidth() == alphabtm->getWidth());
+ assert(boolbtm->getHeight() == alphabtm->getHeight());
+ if(boolbtm->getMode()==splashModeMono1) {
+ return 1;
+ }
+
+ int width = boolbtm->getWidth();
+ int height = boolbtm->getHeight();
+
+ int bad=0;
+ int x,y;
+ for(y=0;y<height;y++) {
+ for(x=0;x<width;x++) {
+ int a1 = alphabtm->getAlpha(x,y);
+ int a2 = boolbtm->getAlpha(x,y);
+ if(a1!=a2) {
+ bad++;
+ }
+ }
+ }
+ double badness = bad/(double)(width*height);
+ if(badness>0.2) {
+ msg("<error> Bitmaps don't correspond: %d out of %d pixels wrong (%.2f%%)", bad, width*height,
+ badness*100.0);
+ return 0;
+ }
+ msg("<notice> %f", badness);
+ return 1;
+}
+
+GBool BitmapOutputDev::checkNewText(int x1, int y1, int x2, int y2)