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

Side by Side Diff: gm/rrects.cpp

Issue 175423002: Add effect-based clipping for circular "tab" style rrects. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix gcc warnings Created 6 years, 10 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 | src/gpu/effects/GrRRectEffect.cpp » ('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 #include "SkRRect.h" 9 #include "SkRRect.h"
10 10
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 bool fDoAA; 91 bool fDoAA;
92 bool fDoClip; // use clipRRect & drawRect instead of drawRRect 92 bool fDoClip; // use clipRRect & drawRect instead of drawRRect
93 93
94 static const int kImageWidth = 640; 94 static const int kImageWidth = 640;
95 static const int kImageHeight = 480; 95 static const int kImageHeight = 480;
96 96
97 static const int kTileX = 80; 97 static const int kTileX = 80;
98 static const int kTileY = 40; 98 static const int kTileY = 40;
99 99
100 static const int kNumSimpleCases = 7; 100 static const int kNumSimpleCases = 7;
101 static const int kNumComplexCases = 19; 101 static const int kNumComplexCases = 23;
102 static const SkVector gRadii[kNumComplexCases][4]; 102 static const SkVector gRadii[kNumComplexCases][4];
103 103
104 static const int kNumRRects = kNumSimpleCases + kNumComplexCases; 104 static const int kNumRRects = kNumSimpleCases + kNumComplexCases;
105 SkRRect fRRects[kNumRRects]; 105 SkRRect fRRects[kNumRRects];
106 106
107 typedef GM INHERITED; 107 typedef GM INHERITED;
108 }; 108 };
109 109
110 // Radii for the various test cases. Order is UL, UR, LR, LL 110 // Radii for the various test cases. Order is UL, UR, LR, LL
111 const SkVector RRectGM::gRadii[kNumComplexCases][4] = { 111 const SkVector RRectGM::gRadii[kNumComplexCases][4] = {
(...skipping 22 matching lines...) Expand all
134 134
135 // LL 135 // LL
136 { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 30, 30 } }, 136 { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 30, 30 } },
137 { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 30, 15 } }, 137 { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 30, 15 } },
138 { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 15, 30 } }, 138 { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 15, 30 } },
139 139
140 // over-sized radii 140 // over-sized radii
141 { { 0, 0 }, { 100, 400 }, { 0, 0 }, { 0, 0 } }, 141 { { 0, 0 }, { 100, 400 }, { 0, 0 }, { 0, 0 } },
142 { { 0, 0 }, { 400, 400 }, { 0, 0 }, { 0, 0 } }, 142 { { 0, 0 }, { 400, 400 }, { 0, 0 }, { 0, 0 } },
143 { { 400, 400 }, { 400, 400 }, { 400, 400 }, { 400, 400 } }, 143 { { 400, 400 }, { 400, 400 }, { 400, 400 }, { 400, 400 } },
144
145 // circular corner tabs
146 { { 0, 0 }, { 20, 20 }, { 20, 20 }, { 0, 0 } },
147 { { 20, 20 }, { 20, 20 }, { 0, 0 }, { 0, 0 } },
148 { { 0, 0 }, { 0, 0 }, { 20, 20 }, { 20, 20 } },
149 { { 20, 20 }, { 0, 0 }, { 0, 0 }, { 20, 20 } },
144 }; 150 };
145 151
146 /////////////////////////////////////////////////////////////////////////////// 152 ///////////////////////////////////////////////////////////////////////////////
147 153
148 DEF_GM( return new RRectGM(false, false); ) 154 DEF_GM( return new RRectGM(false, false); )
149 DEF_GM( return new RRectGM(true, false); ) 155 DEF_GM( return new RRectGM(true, false); )
150 DEF_GM( return new RRectGM(false, true); ) 156 DEF_GM( return new RRectGM(false, true); )
151 DEF_GM( return new RRectGM(true, true); ) 157 DEF_GM( return new RRectGM(true, true); )
152 158
153 } 159 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/effects/GrRRectEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698