| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 {SkRegion::kXOR_Op, "Xor " }, | 89 {SkRegion::kXOR_Op, "Xor " }, |
| 90 {SkRegion::kReverseDifference_Op, "RDiff "} | 90 {SkRegion::kReverseDifference_Op, "RDiff "} |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 canvas->translate(0, SkIntToScalar(40)); | 93 canvas->translate(0, SkIntToScalar(40)); |
| 94 canvas->scale(3 * SK_Scalar1 / 4, 3 * SK_Scalar1 / 4); | 94 canvas->scale(3 * SK_Scalar1 / 4, 3 * SK_Scalar1 / 4); |
| 95 canvas->save(); | 95 canvas->save(); |
| 96 | 96 |
| 97 for (int invA = 0; invA < 2; ++invA) { | 97 for (int invA = 0; invA < 2; ++invA) { |
| 98 for (size_t op = 0; op < SK_ARRAY_COUNT(gOps); ++op) { | 98 for (size_t op = 0; op < SK_ARRAY_COUNT(gOps); ++op) { |
| 99 int idx = invA * SK_ARRAY_COUNT(gOps) + op; | 99 size_t idx = invA * SK_ARRAY_COUNT(gOps) + op; |
| 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); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |