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

Side by Side Diff: gm/circularclips.cpp

Issue 777643003: use ClipOp instead of SkRegion for clipping (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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 | « gm/bigblurs.cpp ('k') | gm/clip_strokerect.cpp » ('j') | 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 2013 Google Inc. 2 * Copyright 2013 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 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkPath.h" 10 #include "SkPath.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 for (size_t i = 0; i < 4; i++) { 54 for (size_t i = 0; i < 4; i++) {
55 fCircle1.toggleInverseFillType(); 55 fCircle1.toggleInverseFillType();
56 if (i % 2 == 0) { 56 if (i % 2 == 0) {
57 fCircle2.toggleInverseFillType(); 57 fCircle2.toggleInverseFillType();
58 } 58 }
59 59
60 canvas->save(); 60 canvas->save();
61 for (size_t op = 0; op < SK_ARRAY_COUNT(ops); op++) { 61 for (size_t op = 0; op < SK_ARRAY_COUNT(ops); op++) {
62 canvas->save(); 62 canvas->save();
63 63
64 canvas->clipPath(fCircle1, SkRegion::kReplace_Op); 64 canvas->legacyClipPath(fCircle1, SkRegion::kReplace_Op);
65 canvas->clipPath(fCircle2, ops[op]); 65 canvas->legacyClipPath(fCircle2, ops[op]);
66 66
67 canvas->drawRect(rect, fillPaint); 67 canvas->drawRect(rect, fillPaint);
68 68
69 canvas->restore(); 69 canvas->restore();
70 canvas->translate(0, 2 * fY); 70 canvas->translate(0, 2 * fY);
71 } 71 }
72 canvas->restore(); 72 canvas->restore();
73 canvas->translate(fX1 + fX2, 0); 73 canvas->translate(fX1 + fX2, 0);
74 } 74 }
75 } 75 }
76 76
77 private: 77 private:
78 typedef skiagm::GM INHERITED; 78 typedef skiagm::GM INHERITED;
79 }; 79 };
80 80
81 ////////////////////////////////////////////////////////////////////////////// 81 //////////////////////////////////////////////////////////////////////////////
82 82
83 DEF_GM( return new CircularClipsGM; ) 83 DEF_GM( return new CircularClipsGM; )
OLDNEW
« no previous file with comments | « gm/bigblurs.cpp ('k') | gm/clip_strokerect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698