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

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: rebase again 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') | no next file with comments »
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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 = 27; 188 static const int kNumComplexCases = 29;
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // single circular corner cases 238 // single circular corner cases
239 { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 15, 15 } }, 239 { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 15, 15 } },
240 { { 0, 0 }, { 0, 0 }, { 15, 15 }, { 0, 0 } }, 240 { { 0, 0 }, { 0, 0 }, { 15, 15 }, { 0, 0 } },
241 { { 0, 0 }, { 15, 15 }, { 0, 0 }, { 0, 0 } }, 241 { { 0, 0 }, { 15, 15 }, { 0, 0 }, { 0, 0 } },
242 { { 15, 15 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }, 242 { { 15, 15 }, { 0, 0 }, { 0, 0 }, { 0, 0 } },
243
244 // nine patch elliptical
245 { { 5, 7 }, { 8, 7 }, { 8, 12 }, { 5, 12 } },
246 { { 0, 7 }, { 8, 7 }, { 8, 12 }, { 0, 12 } },
243 }; 247 };
244 248
245 /////////////////////////////////////////////////////////////////////////////// 249 ///////////////////////////////////////////////////////////////////////////////
246 250
247 DEF_GM( return new RRectGM(RRectGM::kAA_Draw_Type); ) 251 DEF_GM( return new RRectGM(RRectGM::kAA_Draw_Type); )
248 DEF_GM( return new RRectGM(RRectGM::kBW_Draw_Type); ) 252 DEF_GM( return new RRectGM(RRectGM::kBW_Draw_Type); )
249 DEF_GM( return new RRectGM(RRectGM::kAA_Clip_Type); ) 253 DEF_GM( return new RRectGM(RRectGM::kAA_Clip_Type); )
250 DEF_GM( return new RRectGM(RRectGM::kBW_Clip_Type); ) 254 DEF_GM( return new RRectGM(RRectGM::kBW_Clip_Type); )
251 #if SK_SUPPORT_GPU 255 #if SK_SUPPORT_GPU
252 DEF_GM( return new RRectGM(RRectGM::kEffect_Type); ) 256 DEF_GM( return new RRectGM(RRectGM::kEffect_Type); )
253 #endif 257 #endif
254 258
255 } 259 }
OLDNEW
« no previous file with comments | « no previous file | include/core/SkRRect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698