OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 | 7 |
8 #include "gm.h" | 8 #include "gm.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkPath.h" | 10 #include "SkPath.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 for (size_t i = 0; i < 4; i++) { | 54 for (size_t i = 0; i < 4; i++) { |
55 fCircle1.toggleInverseFillType(); | 55 fCircle1.toggleInverseFillType(); |
56 if (i % 2 == 0) { | 56 if (i % 2 == 0) { |
57 fCircle2.toggleInverseFillType(); | 57 fCircle2.toggleInverseFillType(); |
58 } | 58 } |
59 | 59 |
60 canvas->save(); | 60 canvas->save(); |
61 for (size_t op = 0; op < SK_ARRAY_COUNT(ops); op++) { | 61 for (size_t op = 0; op < SK_ARRAY_COUNT(ops); op++) { |
62 canvas->save(); | 62 canvas->save(); |
63 | 63 |
64 canvas->clipPath(fCircle1, SkRegion::kReplace_Op); | 64 canvas->legacyClipPath(fCircle1, SkRegion::kReplace_Op); |
65 canvas->clipPath(fCircle2, ops[op]); | 65 canvas->legacyClipPath(fCircle2, ops[op]); |
66 | 66 |
67 canvas->drawRect(rect, fillPaint); | 67 canvas->drawRect(rect, fillPaint); |
68 | 68 |
69 canvas->restore(); | 69 canvas->restore(); |
70 canvas->translate(0, 2 * fY); | 70 canvas->translate(0, 2 * fY); |
71 } | 71 } |
72 canvas->restore(); | 72 canvas->restore(); |
73 canvas->translate(fX1 + fX2, 0); | 73 canvas->translate(fX1 + fX2, 0); |
74 } | 74 } |
75 } | 75 } |
76 | 76 |
77 private: | 77 private: |
78 typedef skiagm::GM INHERITED; | 78 typedef skiagm::GM INHERITED; |
79 }; | 79 }; |
80 | 80 |
81 ////////////////////////////////////////////////////////////////////////////// | 81 ////////////////////////////////////////////////////////////////////////////// |
82 | 82 |
83 DEF_GM( return new CircularClipsGM; ) | 83 DEF_GM( return new CircularClipsGM; ) |
OLD | NEW |