Add explicit clip to SkSpecialSurface's SkCanvas
authorrobertphillips <robertphillips@google.com>
Tue, 19 Apr 2016 21:23:42 +0000 (14:23 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 19 Apr 2016 21:23:42 +0000 (14:23 -0700)
It seems safer (and is probably more performant) to enforce this internal to SkSpecialSurface.

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1903553002

Review URL: https://codereview.chromium.org/1903553002

src/core/SkSpecialSurface.cpp

index 83a0ee7..eecdaec 100644 (file)
@@ -77,6 +77,7 @@ public:
         fBitmap.setPixelRef(pr);
 
         fCanvas.reset(new SkCanvas(fBitmap, this->props()));
+        fCanvas->clipRect(SkRect::Make(subset));
     }
 
     ~SkSpecialSurface_Raster() override { }
@@ -134,6 +135,7 @@ public:
         }
 
         fCanvas.reset(new SkCanvas(device));
+        fCanvas->clipRect(SkRect::Make(subset));
     }
 
     ~SkSpecialSurface_Gpu() override { }