OLD | NEW |
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 Loading... |
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 Loading... |
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); |
OLD | NEW |