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 | 8 |
9 #include "gm.h" | 9 #include "gm.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 SkRandom r; | 95 SkRandom r; |
96 for (int i = 0; i < kRows; ++i) { | 96 for (int i = 0; i < kRows; ++i) { |
97 for (int j = 0; j < kCols; ++j) { | 97 for (int j = 0; j < kCols; ++j) { |
98 for (int k = 0; k < 5; ++k) { | 98 for (int k = 0; k < 5; ++k) { |
99 fOps[j*kRows+i][k] = ops[r.nextU() % SK_ARRAY_COUNT(ops)]; | 99 fOps[j*kRows+i][k] = ops[r.nextU() % SK_ARRAY_COUNT(ops)]; |
100 } | 100 } |
101 } | 101 } |
102 } | 102 } |
103 } | 103 } |
104 | 104 |
105 static const int kRows = 5; | 105 static constexpr int kRows = 5; |
106 static const int kCols = 5; | 106 static constexpr int kCols = 5; |
107 static const int kPadX = 20; | 107 static constexpr int kPadX = 20; |
108 static const int kPadY = 20; | 108 static constexpr int kPadY = 20; |
109 | 109 |
110 static const char* ClipStr(Clip clip) { | 110 static const char* ClipStr(Clip clip) { |
111 switch (clip) { | 111 switch (clip) { |
112 case kRect_Clip: | 112 case kRect_Clip: |
113 return "rect"; | 113 return "rect"; |
114 case kRRect_Clip: | 114 case kRRect_Clip: |
115 return "rrect"; | 115 return "rrect"; |
116 case kPath_Clip: | 116 case kPath_Clip: |
117 return "path"; | 117 return "path"; |
118 } | 118 } |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 DEF_GM( return new ComplexClip2GM(ComplexClip2GM::kRect_Clip, false); ) | 215 DEF_GM( return new ComplexClip2GM(ComplexClip2GM::kRect_Clip, false); ) |
216 DEF_GM( return new ComplexClip2GM(ComplexClip2GM::kRRect_Clip, false); ) | 216 DEF_GM( return new ComplexClip2GM(ComplexClip2GM::kRRect_Clip, false); ) |
217 DEF_GM( return new ComplexClip2GM(ComplexClip2GM::kPath_Clip, false); ) | 217 DEF_GM( return new ComplexClip2GM(ComplexClip2GM::kPath_Clip, false); ) |
218 | 218 |
219 // aa | 219 // aa |
220 DEF_GM( return new ComplexClip2GM(ComplexClip2GM::kRect_Clip, true); ) | 220 DEF_GM( return new ComplexClip2GM(ComplexClip2GM::kRect_Clip, true); ) |
221 DEF_GM( return new ComplexClip2GM(ComplexClip2GM::kRRect_Clip, true); ) | 221 DEF_GM( return new ComplexClip2GM(ComplexClip2GM::kRRect_Clip, true); ) |
222 DEF_GM( return new ComplexClip2GM(ComplexClip2GM::kPath_Clip, true); ) | 222 DEF_GM( return new ComplexClip2GM(ComplexClip2GM::kPath_Clip, true); ) |
223 | 223 |
224 } | 224 } |
OLD | NEW |