From: robertphillips Date: Fri, 3 Oct 2014 14:29:20 +0000 (-0700) Subject: Reduce overdraw in MultiPictureDraw Sierpinski GM X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~5606 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7f1ed835e90027f63fbb25d19fb71d128b13834d;p=platform%2Fupstream%2FlibSkiaSharp.git 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 --- diff --git a/gm/multipicturedraw.cpp b/gm/multipicturedraw.cpp index 9a3f1a8..afa83e5 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);