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 "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 Loading... |
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 Loading... |
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 } |
OLD | NEW |