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

Side by Side Diff: gm/complexclip.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/clip_strokerect.cpp ('k') | gm/complexclip2.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "gm.h" 8 #include "gm.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 //#include "SkParsePath.h" 10 //#include "SkParsePath.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 this->drawHairlines(canvas, path, clipA, clipB); 124 this->drawHairlines(canvas, path, clipA, clipB);
125 125
126 bool doInvA = SkToBool(invBits & 1); 126 bool doInvA = SkToBool(invBits & 1);
127 bool doInvB = SkToBool(invBits & 2); 127 bool doInvB = SkToBool(invBits & 2);
128 canvas->save(); 128 canvas->save();
129 // set clip 129 // set clip
130 clipA.setFillType(doInvA ? SkPath::kInverseEvenOdd_FillType : 130 clipA.setFillType(doInvA ? SkPath::kInverseEvenOdd_FillType :
131 SkPath::kEvenOdd_FillType); 131 SkPath::kEvenOdd_FillType);
132 clipB.setFillType(doInvB ? SkPath::kInverseEvenOdd_FillType : 132 clipB.setFillType(doInvB ? SkPath::kInverseEvenOdd_FillType :
133 SkPath::kEvenOdd_FillType); 133 SkPath::kEvenOdd_FillType);
134 canvas->clipPath(clipA, SkRegion::kIntersect_Op, fDoAAClip); 134 canvas->clipPath(clipA, kIntersect_SkClipOp, fDoAAClip);
135 canvas->clipPath(clipB, gOps[op].fOp, fDoAAClip); 135 canvas->legacyClipPath(clipB, gOps[op].fOp, fDoAAClip);
136 136
137 // draw path clipped 137 // draw path clipped
138 canvas->drawPath(path, pathPaint); 138 canvas->drawPath(path, pathPaint);
139 canvas->restore(); 139 canvas->restore();
140 140
141 141
142 SkScalar txtX = SkIntToScalar(45); 142 SkScalar txtX = SkIntToScalar(45);
143 paint.setColor(gClipAColor); 143 paint.setColor(gClipAColor);
144 const char* aTxt = doInvA ? "InvA " : "A "; 144 const char* aTxt = doInvA ? "InvA " : "A ";
145 canvas->drawText(aTxt, strlen(aTxt), txtX, SkIntToScalar(220), p aint); 145 canvas->drawText(aTxt, strlen(aTxt), txtX, SkIntToScalar(220), p aint);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 // aliased and anti-aliased w/ a layer 193 // aliased and anti-aliased w/ a layer
194 static GM* gFact2(void*) { return new ComplexClipGM(false, true); } 194 static GM* gFact2(void*) { return new ComplexClipGM(false, true); }
195 static GM* gFact3(void*) { return new ComplexClipGM(true, true); } 195 static GM* gFact3(void*) { return new ComplexClipGM(true, true); }
196 196
197 static GMRegistry gReg0(gFact0); 197 static GMRegistry gReg0(gFact0);
198 static GMRegistry gReg1(gFact1); 198 static GMRegistry gReg1(gFact1);
199 static GMRegistry gReg2(gFact2); 199 static GMRegistry gReg2(gFact2);
200 static GMRegistry gReg3(gFact3); 200 static GMRegistry gReg3(gFact3);
201 201
202 } 202 }
OLDNEW
« no previous file with comments | « gm/clip_strokerect.cpp ('k') | gm/complexclip2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698