Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(512)

Side by Side Diff: gm/multipicturedraw.cpp

Issue 582633003: Reduce overdraw in MultiPictureDraw Sierpinski GM (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update patch for GM changes (i.e., translate) Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "gm.h" 8 #include "gm.h"
9 9
10 #include "SkColorFilter.h" 10 #include "SkColorFilter.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 fill.setColor(SK_ColorLTGRAY);; 148 fill.setColor(SK_ColorLTGRAY);;
149 149
150 SkPaint stroke; 150 SkPaint stroke;
151 stroke.setStyle(SkPaint::kStroke_Style); 151 stroke.setStyle(SkPaint::kStroke_Style);
152 stroke.setStrokeWidth(3); 152 stroke.setStrokeWidth(3);
153 153
154 SkPictureRecorder recorder; 154 SkPictureRecorder recorder;
155 155
156 SkCanvas* canvas = recorder.beginRecording(SkIntToScalar(kPicWidth), 156 SkCanvas* canvas = recorder.beginRecording(SkIntToScalar(kPicWidth),
157 SkIntToScalar(kPicHeight)); 157 SkIntToScalar(kPicHeight));
158 SkRect r = tri.getBounds();
159 r.outset(2.0f, 2.0f); // outset for stroke
160 canvas->clipRect(r);
158 // The saveLayer/restore block is to exercise layer hoisting 161 // The saveLayer/restore block is to exercise layer hoisting
159 canvas->saveLayer(NULL, NULL); 162 canvas->saveLayer(NULL, NULL);
160 canvas->drawPath(tri, fill); 163 canvas->drawPath(tri, fill);
161 canvas->drawPath(tri, stroke); 164 canvas->drawPath(tri, stroke);
162 canvas->restore(); 165 canvas->restore();
163 166
164 return recorder.endRecording(); 167 return recorder.endRecording();
165 } 168 }
166 169
167 static const SkPicture* make_sub_picture(const SkPicture* tri) { 170 static const SkPicture* make_sub_picture(const SkPicture* tri) {
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 MultiPictureDraw::kTiled_Layout) );) 542 MultiPictureDraw::kTiled_Layout) );)
540 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kPathClipMulti _Content, 543 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kPathClipMulti _Content,
541 MultiPictureDraw::kTiled_Layout) );) 544 MultiPictureDraw::kTiled_Layout) );)
542 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kInvPathClipMu lti_Content, 545 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kInvPathClipMu lti_Content,
543 MultiPictureDraw::kTiled_Layout) );) 546 MultiPictureDraw::kTiled_Layout) );)
544 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kSierpinski_Co ntent, 547 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kSierpinski_Co ntent,
545 MultiPictureDraw::kTiled_Layout) );) 548 MultiPictureDraw::kTiled_Layout) );)
546 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kBigLayer_Cont ent, 549 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kBigLayer_Cont ent,
547 MultiPictureDraw::kTiled_Layout) );) 550 MultiPictureDraw::kTiled_Layout) );)
548 } 551 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698