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

Side by Side Diff: samplecode/SampleComplexClip.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 | « samplecode/SampleClip.cpp ('k') | samplecode/SampleFatBits.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 "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkPath.h" 10 #include "SkPath.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 if (!(idx % 3)) { 100 if (!(idx % 3)) {
101 canvas->restore(); 101 canvas->restore();
102 canvas->translate(0, SkIntToScalar(250)); 102 canvas->translate(0, SkIntToScalar(250));
103 canvas->save(); 103 canvas->save();
104 } 104 }
105 canvas->save(); 105 canvas->save();
106 // set clip 106 // set clip
107 clipA.setFillType(invA ? SkPath::kInverseEvenOdd_FillType : 107 clipA.setFillType(invA ? SkPath::kInverseEvenOdd_FillType :
108 SkPath::kEvenOdd_FillType); 108 SkPath::kEvenOdd_FillType);
109 canvas->clipPath(clipA); 109 canvas->clipPath(clipA);
110 canvas->clipPath(clipB, gOps[op].fOp); 110 canvas->legacyClipPath(clipB, gOps[op].fOp);
111 111
112 // draw path clipped 112 // draw path clipped
113 canvas->drawPath(path, pathPaint); 113 canvas->drawPath(path, pathPaint);
114 canvas->restore(); 114 canvas->restore();
115 115
116 // draw path in hairline 116 // draw path in hairline
117 paint.setColor(pathColor); 117 paint.setColor(pathColor);
118 canvas->drawPath(path, paint); 118 canvas->drawPath(path, paint);
119 119
120 // draw clips in hair line 120 // draw clips in hair line
(...skipping 23 matching lines...) Expand all
144 } 144 }
145 145
146 private: 146 private:
147 typedef SampleView INHERITED; 147 typedef SampleView INHERITED;
148 }; 148 };
149 149
150 ////////////////////////////////////////////////////////////////////////////// 150 //////////////////////////////////////////////////////////////////////////////
151 151
152 static SkView* MyFactory() { return new ComplexClipView; } 152 static SkView* MyFactory() { return new ComplexClipView; }
153 static SkViewRegister reg(MyFactory); 153 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleClip.cpp ('k') | samplecode/SampleFatBits.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698