aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/multipicturedraw.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2014-10-03 07:29:20 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-03 07:29:20 -0700
commit7f1ed835e90027f63fbb25d19fb71d128b13834d (patch)
treefd52bbea96e3d41695ab4de6c7524cc895a9861d /gm/multipicturedraw.cpp
parent4611e7f479b1176a31af0bdc2a12528df5f75167 (diff)
Reduce overdraw in MultiPictureDraw Sierpinski GM
As written, all the layers in the MPD Sierpinski GM are full screen. This CL bounds each layer to reduce overdraw. This CL will cause differences in: multipicturedraw_sierpinski_simple multipicturedraw_sierpinski_tiled but they are/will be suppressed in: (Don't turn on dither for saveLayers which have no paint - https://codereview.chromium.org/619363002/) Review URL: https://codereview.chromium.org/582633003
Diffstat (limited to 'gm/multipicturedraw.cpp')
-rw-r--r--gm/multipicturedraw.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/gm/multipicturedraw.cpp b/gm/multipicturedraw.cpp
index 9a3f1a8df5..afa83e5176 100644
--- a/gm/multipicturedraw.cpp
+++ b/gm/multipicturedraw.cpp
@@ -155,6 +155,9 @@ static const SkPicture* make_tri_picture() {
SkCanvas* canvas = recorder.beginRecording(SkIntToScalar(kPicWidth),
SkIntToScalar(kPicHeight));
+ SkRect r = tri.getBounds();
+ r.outset(2.0f, 2.0f); // outset for stroke
+ canvas->clipRect(r);
// The saveLayer/restore block is to exercise layer hoisting
canvas->saveLayer(NULL, NULL);
canvas->drawPath(tri, fill);