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

Side by Side Diff: gm/complexclip2.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/complexclip.cpp ('k') | gm/convexpolyclip.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 2011 Google Inc. 2 * Copyright 2011 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 8
9 #include "gm.h" 9 #include "gm.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 break; 163 break;
164 case kPath_Clip: 164 case kPath_Clip:
165 canvas->drawPath(fPaths[k], rectPaint); 165 canvas->drawPath(fPaths[k], rectPaint);
166 break; 166 break;
167 } 167 }
168 } 168 }
169 169
170 for (int k = 0; k < 5; ++k) { 170 for (int k = 0; k < 5; ++k) {
171 switch (fClip) { 171 switch (fClip) {
172 case kRect_Clip: 172 case kRect_Clip:
173 canvas->clipRect(fRects[k], 173 canvas->legacyClipRect(fRects[k], fOps[j*kRows+i][k] , fAntiAlias);
174 fOps[j*kRows+i][k],
175 fAntiAlias);
176 break; 174 break;
177 case kRRect_Clip: 175 case kRRect_Clip:
178 canvas->clipRRect(fRRects[k], 176 canvas->legacyClipRRect(fRRects[k], fOps[j*kRows+i][ k], fAntiAlias);
179 fOps[j*kRows+i][k],
180 fAntiAlias);
181 break; 177 break;
182 case kPath_Clip: 178 case kPath_Clip:
183 canvas->clipPath(fPaths[k], 179 canvas->legacyClipPath(fPaths[k], fOps[j*kRows+i][k] , fAntiAlias);
184 fOps[j*kRows+i][k],
185 fAntiAlias);
186 break; 180 break;
187 } 181 }
188 } 182 }
189 canvas->drawRect(SkRect::MakeWH(fWidth, fHeight), fillPaint); 183 canvas->drawRect(SkRect::MakeWH(fWidth, fHeight), fillPaint);
190 canvas->restore(); 184 canvas->restore();
191 } 185 }
192 } 186 }
193 } 187 }
194 private: 188 private:
195 Clip fClip; 189 Clip fClip;
(...skipping 17 matching lines...) Expand all
213 DEF_GM( return new ComplexClip2GM(ComplexClip2GM::kRect_Clip, false); ) 207 DEF_GM( return new ComplexClip2GM(ComplexClip2GM::kRect_Clip, false); )
214 DEF_GM( return new ComplexClip2GM(ComplexClip2GM::kRRect_Clip, false); ) 208 DEF_GM( return new ComplexClip2GM(ComplexClip2GM::kRRect_Clip, false); )
215 DEF_GM( return new ComplexClip2GM(ComplexClip2GM::kPath_Clip, false); ) 209 DEF_GM( return new ComplexClip2GM(ComplexClip2GM::kPath_Clip, false); )
216 210
217 // aa 211 // aa
218 DEF_GM( return new ComplexClip2GM(ComplexClip2GM::kRect_Clip, true); ) 212 DEF_GM( return new ComplexClip2GM(ComplexClip2GM::kRect_Clip, true); )
219 DEF_GM( return new ComplexClip2GM(ComplexClip2GM::kRRect_Clip, true); ) 213 DEF_GM( return new ComplexClip2GM(ComplexClip2GM::kRRect_Clip, true); )
220 DEF_GM( return new ComplexClip2GM(ComplexClip2GM::kPath_Clip, true); ) 214 DEF_GM( return new ComplexClip2GM(ComplexClip2GM::kPath_Clip, true); )
221 215
222 } 216 }
OLDNEW
« no previous file with comments | « gm/complexclip.cpp ('k') | gm/convexpolyclip.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698