| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 #if SK_SUPPORT_GPU | 9 #if SK_SUPPORT_GPU |
| 10 #include "GrTest.h" | 10 #include "GrTest.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 private: | 178 private: |
| 179 Type fType; | 179 Type fType; |
| 180 | 180 |
| 181 static const int kImageWidth = 640; | 181 static const int kImageWidth = 640; |
| 182 static const int kImageHeight = 480; | 182 static const int kImageHeight = 480; |
| 183 | 183 |
| 184 static const int kTileX = 80; | 184 static const int kTileX = 80; |
| 185 static const int kTileY = 40; | 185 static const int kTileY = 40; |
| 186 | 186 |
| 187 static const int kNumSimpleCases = 7; | 187 static const int kNumSimpleCases = 7; |
| 188 static const int kNumComplexCases = 29; | 188 static const int kNumComplexCases = 35; |
| 189 static const SkVector gRadii[kNumComplexCases][4]; | 189 static const SkVector gRadii[kNumComplexCases][4]; |
| 190 | 190 |
| 191 static const int kNumRRects = kNumSimpleCases + kNumComplexCases; | 191 static const int kNumRRects = kNumSimpleCases + kNumComplexCases; |
| 192 SkRRect fRRects[kNumRRects]; | 192 SkRRect fRRects[kNumRRects]; |
| 193 | 193 |
| 194 typedef GM INHERITED; | 194 typedef GM INHERITED; |
| 195 }; | 195 }; |
| 196 | 196 |
| 197 // Radii for the various test cases. Order is UL, UR, LR, LL | 197 // Radii for the various test cases. Order is UL, UR, LR, LL |
| 198 const SkVector RRectGM::gRadii[kNumComplexCases][4] = { | 198 const SkVector RRectGM::gRadii[kNumComplexCases][4] = { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 228 { { 0, 0 }, { 100, 400 }, { 0, 0 }, { 0, 0 } }, | 228 { { 0, 0 }, { 100, 400 }, { 0, 0 }, { 0, 0 } }, |
| 229 { { 0, 0 }, { 400, 400 }, { 0, 0 }, { 0, 0 } }, | 229 { { 0, 0 }, { 400, 400 }, { 0, 0 }, { 0, 0 } }, |
| 230 { { 400, 400 }, { 400, 400 }, { 400, 400 }, { 400, 400 } }, | 230 { { 400, 400 }, { 400, 400 }, { 400, 400 }, { 400, 400 } }, |
| 231 | 231 |
| 232 // circular corner tabs | 232 // circular corner tabs |
| 233 { { 0, 0 }, { 20, 20 }, { 20, 20 }, { 0, 0 } }, | 233 { { 0, 0 }, { 20, 20 }, { 20, 20 }, { 0, 0 } }, |
| 234 { { 20, 20 }, { 20, 20 }, { 0, 0 }, { 0, 0 } }, | 234 { { 20, 20 }, { 20, 20 }, { 0, 0 }, { 0, 0 } }, |
| 235 { { 0, 0 }, { 0, 0 }, { 20, 20 }, { 20, 20 } }, | 235 { { 0, 0 }, { 0, 0 }, { 20, 20 }, { 20, 20 } }, |
| 236 { { 20, 20 }, { 0, 0 }, { 0, 0 }, { 20, 20 } }, | 236 { { 20, 20 }, { 0, 0 }, { 0, 0 }, { 20, 20 } }, |
| 237 | 237 |
| 238 // small radius circular corner tabs |
| 239 { { 0, 0 }, { 0.2f, 0.2f }, { 0.2f, 0.2f }, { 0, 0 } }, |
| 240 { { 0.3f, 0.3f }, { 0.3f, .3f }, { 0, 0 }, { 0, 0 } }, |
| 241 |
| 238 // single circular corner cases | 242 // single circular corner cases |
| 239 { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 15, 15 } }, | 243 { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 15, 15 } }, |
| 240 { { 0, 0 }, { 0, 0 }, { 15, 15 }, { 0, 0 } }, | 244 { { 0, 0 }, { 0, 0 }, { 15, 15 }, { 0, 0 } }, |
| 241 { { 0, 0 }, { 15, 15 }, { 0, 0 }, { 0, 0 } }, | 245 { { 0, 0 }, { 15, 15 }, { 0, 0 }, { 0, 0 } }, |
| 242 { { 15, 15 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }, | 246 { { 15, 15 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }, |
| 243 | 247 |
| 244 // nine patch elliptical | 248 // nine patch elliptical |
| 245 { { 5, 7 }, { 8, 7 }, { 8, 12 }, { 5, 12 } }, | 249 { { 5, 7 }, { 8, 7 }, { 8, 12 }, { 5, 12 } }, |
| 246 { { 0, 7 }, { 8, 7 }, { 8, 12 }, { 0, 12 } }, | 250 { { 0, 7 }, { 8, 7 }, { 8, 12 }, { 0, 12 } }, |
| 251 |
| 252 // nine patch elliptical, small radii |
| 253 { { 0.4f, 7 }, { 8, 7 }, { 8, 12 }, { 0.4f, 12 } }, |
| 254 { { 0.4f, 0.4f }, { 8, 0.4f }, { 8, 12 }, { 0.4f, 12 } }, |
| 255 { { 20, 0.4f }, { 18, 0.4f }, { 18, 0.4f }, { 20, 0.4f } }, |
| 256 { { 0.3f, 0.4f }, { 0.3f, 0.4f }, { 0.3f, 0.4f }, { 0.3f, 0.4f } }, |
| 257 |
| 247 }; | 258 }; |
| 248 | 259 |
| 249 /////////////////////////////////////////////////////////////////////////////// | 260 /////////////////////////////////////////////////////////////////////////////// |
| 250 | 261 |
| 251 DEF_GM( return new RRectGM(RRectGM::kAA_Draw_Type); ) | 262 DEF_GM( return new RRectGM(RRectGM::kAA_Draw_Type); ) |
| 252 DEF_GM( return new RRectGM(RRectGM::kBW_Draw_Type); ) | 263 DEF_GM( return new RRectGM(RRectGM::kBW_Draw_Type); ) |
| 253 DEF_GM( return new RRectGM(RRectGM::kAA_Clip_Type); ) | 264 DEF_GM( return new RRectGM(RRectGM::kAA_Clip_Type); ) |
| 254 DEF_GM( return new RRectGM(RRectGM::kBW_Clip_Type); ) | 265 DEF_GM( return new RRectGM(RRectGM::kBW_Clip_Type); ) |
| 255 #if SK_SUPPORT_GPU | 266 #if SK_SUPPORT_GPU |
| 256 DEF_GM( return new RRectGM(RRectGM::kEffect_Type); ) | 267 DEF_GM( return new RRectGM(RRectGM::kEffect_Type); ) |
| 257 #endif | 268 #endif |
| 258 | 269 |
| 259 } | 270 } |
| OLD | NEW |