OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SampleCode.h" | 8 #include "SampleCode.h" |
9 #include "SkView.h" | 9 #include "SkView.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 SkPath clipPath; | 136 SkPath clipPath; |
137 r.inset(SK_Scalar1 / 4, SK_Scalar1 / 4); | 137 r.inset(SK_Scalar1 / 4, SK_Scalar1 / 4); |
138 clipPath.addRoundRect(r, SkIntToScalar(20), SkIntToScalar(20)); | 138 clipPath.addRoundRect(r, SkIntToScalar(20), SkIntToScalar(20)); |
139 | 139 |
140 // clipPath.toggleInverseFillType(); | 140 // clipPath.toggleInverseFillType(); |
141 | 141 |
142 for (int aa = 0; aa <= 1; ++aa) { | 142 for (int aa = 0; aa <= 1; ++aa) { |
143 canvas->save(); | 143 canvas->save(); |
144 for (size_t i = 0; i < SK_ARRAY_COUNT(gProc); ++i) { | 144 for (size_t i = 0; i < SK_ARRAY_COUNT(gProc); ++i) { |
145 canvas->save(); | 145 canvas->save(); |
146 canvas->clipPath(clipPath, SkRegion::kIntersect_Op, SkToBool(aa)
); | 146 canvas->clipPath(clipPath, SkCanvas::kIntersect_Op, SkToBool(aa)
); |
147 // canvas->drawColor(SK_ColorWHITE); | 147 // canvas->drawColor(SK_ColorWHITE); |
148 gProc[i](canvas, SkToBool(aa)); | 148 gProc[i](canvas, SkToBool(aa)); |
149 canvas->restore(); | 149 canvas->restore(); |
150 canvas->translate(W * SK_Scalar1 * 8 / 7, 0); | 150 canvas->translate(W * SK_Scalar1 * 8 / 7, 0); |
151 } | 151 } |
152 canvas->restore(); | 152 canvas->restore(); |
153 canvas->translate(0, H * SK_Scalar1 * 8 / 7); | 153 canvas->translate(0, H * SK_Scalar1 * 8 / 7); |
154 } | 154 } |
155 } | 155 } |
156 | 156 |
157 private: | 157 private: |
158 typedef SampleView INHERITED; | 158 typedef SampleView INHERITED; |
159 }; | 159 }; |
160 | 160 |
161 ////////////////////////////////////////////////////////////////////////////// | 161 ////////////////////////////////////////////////////////////////////////////// |
162 | 162 |
163 static SkView* MyFactory() { return new ClipView; } | 163 static SkView* MyFactory() { return new ClipView; } |
164 static SkViewRegister reg(MyFactory); | 164 static SkViewRegister reg(MyFactory); |
OLD | NEW |