Add missing virtual functions for SkRectClipCheckBlitter
authorYuqian Li <liyuqian@google.com>
Mon, 21 Nov 2016 14:44:59 +0000 (09:44 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Mon, 21 Nov 2016 15:18:37 +0000 (15:18 +0000)
This CL is related to the issue that we tried to fix in
https://skia-review.googlesource.com/c/5078/

Specifically, SkARGB32_Blitter overrides blitAntiH2 and blitAntiV2 and
they're different from blitAntiRuns. Therefore, if
SkRectClipCheckBlitter does not override those two functions, we're
going to get different results in debug and release build.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5082

Change-Id: I7f9565d494f0a6c45ab5a06fbedb73ef233b9a1f
Reviewed-on: https://skia-review.googlesource.com/5082
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>

src/core/SkBlitter.cpp
src/core/SkBlitter.h
src/core/SkScanPriv.h
src/core/SkScan_Path.cpp

index af3cc04932d9a1b42c94e995860376178f6b6b64..731d0d3cb715b4aa5d702e14a5947b37b28f183b 100644 (file)
@@ -1070,4 +1070,14 @@ const SkPixmap* SkRectClipCheckBlitter::justAnOpaqueColor(uint32_t* value) {
     return fBlitter->justAnOpaqueColor(value);
 }
 
+void SkRectClipCheckBlitter::blitAntiH2(int x, int y, U8CPU a0, U8CPU a1) {
+    SkASSERT(fClipRect.contains(SkIRect::MakeXYWH(x, y, 2, 1)));
+    fBlitter->blitAntiH2(x, y, a0, a1);
+}
+
+void SkRectClipCheckBlitter::blitAntiV2(int x, int y, U8CPU a0, U8CPU a1) {
+    SkASSERT(fClipRect.contains(SkIRect::MakeXYWH(x, y, 1, 2)));
+    fBlitter->blitAntiV2(x, y, a0, a1);
+}
+
 #endif
index c9fed1ce221169ab28229254e4c7b56f96af2b61..f03a3082431ae5ca06b19427bbdd1a2ee8bedcf6 100644 (file)
@@ -258,6 +258,8 @@ public:
                               SkAlpha leftAlpha, SkAlpha rightAlpha) override;
     void blitMask(const SkMask&, const SkIRect& clip) override;
     const SkPixmap* justAnOpaqueColor(uint32_t* value) override;
+    void blitAntiH2(int x, int y, U8CPU a0, U8CPU a1) override;
+    void blitAntiV2(int x, int y, U8CPU a0, U8CPU a1) override;
 
     int requestRowsPreserved() const override {
         return fBlitter->requestRowsPreserved();
index af0a4cbd3fdb2c9c21591061e20130f6a1ce41dd..4c237e004b759d5fee54f23b14f01252aac2a803 100644 (file)
@@ -24,7 +24,7 @@ private:
     SkRectClipBlitter   fRectBlitter;
     SkRgnClipBlitter    fRgnBlitter;
 #ifdef SK_DEBUG
-    // SkRectClipCheckBlitter fRectClipCheckBlitter;
+    SkRectClipCheckBlitter fRectClipCheckBlitter;
 #endif
     SkBlitter*          fBlitter;
     const SkIRect*      fClipRect;
index bf8f32080dbafb21338636abaf174973bd35e0a7..ec0fe06b66f7a3d4e584485a3e93cee0e5a18391 100644 (file)
@@ -559,8 +559,8 @@ SkScanClipper::SkScanClipper(SkBlitter* blitter, const SkRegion* clip,
         if (clip->isRect()) {
             if (fClipRect->contains(ir)) {
 #ifdef SK_DEBUG
-                // fRectClipCheckBlitter.init(blitter, *fClipRect);
-                // blitter = &fRectClipCheckBlitter;
+                fRectClipCheckBlitter.init(blitter, *fClipRect);
+                blitter = &fRectClipCheckBlitter;
 #endif
                 fClipRect = nullptr;
             } else {
@@ -570,8 +570,8 @@ SkScanClipper::SkScanClipper(SkBlitter* blitter, const SkRegion* clip,
                     blitter = &fRectBlitter;
                 } else {
 #ifdef SK_DEBUG
-                    // fRectClipCheckBlitter.init(blitter, *fClipRect);
-                    // blitter = &fRectClipCheckBlitter;
+                    fRectClipCheckBlitter.init(blitter, *fClipRect);
+                    blitter = &fRectClipCheckBlitter;
 #endif
                 }
             }