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 "SkPaint.h" | 10 #include "SkPaint.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 } | 64 } |
65 | 65 |
66 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 66 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
67 | 67 |
68 SkCanvas::SaveFlags flags[] = { SkCanvas::kMatrix_SaveFlag, | 68 SkCanvas::SaveFlags flags[] = { SkCanvas::kMatrix_SaveFlag, |
69 SkCanvas::kClip_SaveFlag, | 69 SkCanvas::kClip_SaveFlag, |
70 SkCanvas::kMatrixClip_SaveFlag }; | 70 SkCanvas::kMatrixClip_SaveFlag }; |
71 | 71 |
72 // columns -- flags | 72 // columns -- flags |
73 // rows -- permutations of setting the clip and matrix | 73 // rows -- permutations of setting the clip and matrix |
74 for (size_t i = 0; i < SK_ARRAY_COUNT(flags); ++i) { | 74 for (int i = 0; i < static_cast<int>(SK_ARRAY_COUNT(flags)); ++i) { |
75 for (int j = 0; j < 2; ++j) { | 75 for (int j = 0; j < 2; ++j) { |
76 for (int k = 0; k < 2; ++k) { | 76 for (int k = 0; k < 2; ++k) { |
77 this->drawTestPattern(i, (2*j)+k, canvas, flags[i], | 77 this->drawTestPattern(i, (2*j)+k, canvas, flags[i], |
78 SkToBool(j), SkToBool(k)); | 78 SkToBool(j), SkToBool(k)); |
79 } | 79 } |
80 } | 80 } |
81 } | 81 } |
82 } | 82 } |
83 | 83 |
84 | 84 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 169 |
170 typedef GM INHERITED; | 170 typedef GM INHERITED; |
171 }; | 171 }; |
172 | 172 |
173 ////////////////////////////////////////////////////////////////////////////// | 173 ////////////////////////////////////////////////////////////////////////////// |
174 | 174 |
175 DEF_GM( return SkNEW(CanvasStateGM); ) | 175 DEF_GM( return SkNEW(CanvasStateGM); ) |
176 DEF_GM( return SkNEW(CanvasLayerStateGM); ) | 176 DEF_GM( return SkNEW(CanvasLayerStateGM); ) |
177 | 177 |
178 } // end namespace | 178 } // end namespace |
OLD | NEW |