Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: gm/rrects.cpp

Issue 194703011: Add effect-based clip for nine-patch SkRRects. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | include/core/SkRRect.h » ('j') | src/gpu/effects/GrRRectEffect.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 private: 182 private:
183 Type fType; 183 Type fType;
184 184
185 static const int kImageWidth = 640; 185 static const int kImageWidth = 640;
186 static const int kImageHeight = 480; 186 static const int kImageHeight = 480;
187 187
188 static const int kTileX = 80; 188 static const int kTileX = 80;
189 static const int kTileY = 40; 189 static const int kTileY = 40;
190 190
191 static const int kNumSimpleCases = 7; 191 static const int kNumSimpleCases = 7;
192 static const int kNumComplexCases = 27; 192 static const int kNumComplexCases = 29;
193 static const SkVector gRadii[kNumComplexCases][4]; 193 static const SkVector gRadii[kNumComplexCases][4];
194 194
195 static const int kNumRRects = kNumSimpleCases + kNumComplexCases; 195 static const int kNumRRects = kNumSimpleCases + kNumComplexCases;
196 SkRRect fRRects[kNumRRects]; 196 SkRRect fRRects[kNumRRects];
197 197
198 typedef GM INHERITED; 198 typedef GM INHERITED;
199 }; 199 };
200 200
201 // Radii for the various test cases. Order is UL, UR, LR, LL 201 // Radii for the various test cases. Order is UL, UR, LR, LL
202 const SkVector RRectGM::gRadii[kNumComplexCases][4] = { 202 const SkVector RRectGM::gRadii[kNumComplexCases][4] = {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 { { 0, 0 }, { 20, 20 }, { 20, 20 }, { 0, 0 } }, 237 { { 0, 0 }, { 20, 20 }, { 20, 20 }, { 0, 0 } },
238 { { 20, 20 }, { 20, 20 }, { 0, 0 }, { 0, 0 } }, 238 { { 20, 20 }, { 20, 20 }, { 0, 0 }, { 0, 0 } },
239 { { 0, 0 }, { 0, 0 }, { 20, 20 }, { 20, 20 } }, 239 { { 0, 0 }, { 0, 0 }, { 20, 20 }, { 20, 20 } },
240 { { 20, 20 }, { 0, 0 }, { 0, 0 }, { 20, 20 } }, 240 { { 20, 20 }, { 0, 0 }, { 0, 0 }, { 20, 20 } },
241 241
242 // single circular corner cases 242 // single circular corner cases
243 { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 15, 15 } }, 243 { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 15, 15 } },
244 { { 0, 0 }, { 0, 0 }, { 15, 15 }, { 0, 0 } }, 244 { { 0, 0 }, { 0, 0 }, { 15, 15 }, { 0, 0 } },
245 { { 0, 0 }, { 15, 15 }, { 0, 0 }, { 0, 0 } }, 245 { { 0, 0 }, { 15, 15 }, { 0, 0 }, { 0, 0 } },
246 { { 15, 15 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }, 246 { { 15, 15 }, { 0, 0 }, { 0, 0 }, { 0, 0 } },
247
248 // nine patch elliptical
249 { { 5, 7 }, { 8, 7 }, { 8, 12 }, { 5, 12 } },
250 { { 0, 7 }, { 8, 7 }, { 8, 12 }, { 0, 12 } },
247 }; 251 };
248 252
249 /////////////////////////////////////////////////////////////////////////////// 253 ///////////////////////////////////////////////////////////////////////////////
250 254
251 DEF_GM( return new RRectGM(RRectGM::kAA_Draw_Type); ) 255 DEF_GM( return new RRectGM(RRectGM::kAA_Draw_Type); )
252 DEF_GM( return new RRectGM(RRectGM::kBW_Draw_Type); ) 256 DEF_GM( return new RRectGM(RRectGM::kBW_Draw_Type); )
253 DEF_GM( return new RRectGM(RRectGM::kAA_Clip_Type); ) 257 DEF_GM( return new RRectGM(RRectGM::kAA_Clip_Type); )
254 DEF_GM( return new RRectGM(RRectGM::kBW_Clip_Type); ) 258 DEF_GM( return new RRectGM(RRectGM::kBW_Clip_Type); )
255 #if SK_SUPPORT_GPU 259 #if SK_SUPPORT_GPU
256 DEF_GM( return new RRectGM(RRectGM::kEffect_Type); ) 260 DEF_GM( return new RRectGM(RRectGM::kEffect_Type); )
257 #endif 261 #endif
258 262
259 } 263 }
OLDNEW
« no previous file with comments | « no previous file | include/core/SkRRect.h » ('j') | src/gpu/effects/GrRRectEffect.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698