| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 #include "gm.h" | 7 #include "gm.h" |
| 8 #include "SkCanvas.h" | 8 #include "SkCanvas.h" |
| 9 #include "SkPath.h" | 9 #include "SkPath.h" |
| 10 | 10 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 bool doAAA = SkToBool(aaBits & 1); | 77 bool doAAA = SkToBool(aaBits & 1); |
| 78 bool doAAB = SkToBool(aaBits & 2); | 78 bool doAAB = SkToBool(aaBits & 2); |
| 79 bool doInvA = SkToBool(invA); | 79 bool doInvA = SkToBool(invA); |
| 80 bool doInvB = SkToBool(invB); | 80 bool doInvB = SkToBool(invB); |
| 81 canvas->save(); | 81 canvas->save(); |
| 82 // set clip | 82 // set clip |
| 83 firstClip->setFillType(doInvA ? SkPath::kInverseEvenOdd_
FillType : | 83 firstClip->setFillType(doInvA ? SkPath::kInverseEvenOdd_
FillType : |
| 84 SkPath::kEvenOdd_FillType); | 84 SkPath::kEvenOdd_FillType); |
| 85 secondClip->setFillType(doInvB ? SkPath::kInverseEvenOdd
_FillType : | 85 secondClip->setFillType(doInvB ? SkPath::kInverseEvenOdd
_FillType : |
| 86 SkPath::kEvenOdd_FillType); | 86 SkPath::kEvenOdd_FillType); |
| 87 canvas->clipPath(*firstClip, SkCanvas::kIntersect_Op, do
AAA); | 87 canvas->clipPath(*firstClip, doAAA); |
| 88 canvas->clipPath(*secondClip, gOps[op].fOp, doAAB); | 88 canvas->clipPath(*secondClip, gOps[op].fOp, doAAB); |
| 89 | 89 |
| 90 // draw rect clipped | 90 // draw rect clipped |
| 91 SkRect r = { 0, 0, 100, 100 }; | 91 SkRect r = { 0, 0, 100, 100 }; |
| 92 canvas->drawRect(r, pathPaint); | 92 canvas->drawRect(r, pathPaint); |
| 93 canvas->restore(); | 93 canvas->restore(); |
| 94 | 94 |
| 95 | 95 |
| 96 SkScalar txtX = SkIntToScalar(10); | 96 SkScalar txtX = SkIntToScalar(10); |
| 97 paint.setColor(SK_ColorBLACK); | 97 paint.setColor(SK_ColorBLACK); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 123 typedef GM INHERITED; | 123 typedef GM INHERITED; |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 ////////////////////////////////////////////////////////////////////////////// | 126 ////////////////////////////////////////////////////////////////////////////// |
| 127 | 127 |
| 128 // Simple clip first | 128 // Simple clip first |
| 129 DEF_GM( return new ComplexClip3GM(true); ) | 129 DEF_GM( return new ComplexClip3GM(true); ) |
| 130 // Complex clip first | 130 // Complex clip first |
| 131 DEF_GM( return new ComplexClip3GM(false); ) | 131 DEF_GM( return new ComplexClip3GM(false); ) |
| 132 } | 132 } |
| OLD | NEW |