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

Side by Side Diff: gm/convexpolyeffect.cpp

Issue 1457123002: Make block size a template parameter of SkTLList (Closed) Base URL: https://skia.googlesource.com/skia.git@forward
Patch Set: another missing typename Created 5 years, 1 month 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
« no previous file with comments | « gm/convexpolyclip.cpp ('k') | src/core/SkTLList.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 /* 2 /*
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 // This test only works with the GPU backend. 9 // This test only works with the GPU backend.
10 10
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 return; 159 return;
160 } 160 }
161 161
162 Color color(0xff000000); 162 Color color(0xff000000);
163 Coverage coverage(Coverage::kSolid_Type); 163 Coverage coverage(Coverage::kSolid_Type);
164 LocalCoords localCoords(LocalCoords::kUnused_Type); 164 LocalCoords localCoords(LocalCoords::kUnused_Type);
165 SkAutoTUnref<const GrGeometryProcessor> gp( 165 SkAutoTUnref<const GrGeometryProcessor> gp(
166 GrDefaultGeoProcFactory::Create(color, coverage, localCoords, Sk Matrix::I())); 166 GrDefaultGeoProcFactory::Create(color, coverage, localCoords, Sk Matrix::I()));
167 167
168 SkScalar y = 0; 168 SkScalar y = 0;
169 for (SkTLList<SkPath>::Iter iter(fPaths, SkTLList<SkPath>::Iter::kHead_I terStart); 169 for (PathList::Iter iter(fPaths, PathList::Iter::kHead_IterStart);
170 iter.get(); 170 iter.get();
171 iter.next()) { 171 iter.next()) {
172 const SkPath* path = iter.get(); 172 const SkPath* path = iter.get();
173 SkScalar x = 0; 173 SkScalar x = 0;
174 174
175 for (int et = 0; et < kGrProcessorEdgeTypeCnt; ++et) { 175 for (int et = 0; et < kGrProcessorEdgeTypeCnt; ++et) {
176 GrTestTarget tt; 176 GrTestTarget tt;
177 context->getTestTarget(&tt, rt); 177 context->getTestTarget(&tt, rt);
178 if (nullptr == tt.target()) { 178 if (nullptr == tt.target()) {
179 SkDEBUGFAIL("Couldn't get Gr test target."); 179 SkDEBUGFAIL("Couldn't get Gr test target.");
(...skipping 30 matching lines...) Expand all
210 SkPaint paint; 210 SkPaint paint;
211 canvas->drawPath(*path, paint); 211 canvas->drawPath(*path, paint);
212 canvas->translate(path->getBounds().width() + 10.f, 0); 212 canvas->translate(path->getBounds().width() + 10.f, 0);
213 paint.setAntiAlias(true); 213 paint.setAntiAlias(true);
214 canvas->drawPath(*path, paint); 214 canvas->drawPath(*path, paint);
215 canvas->restore(); 215 canvas->restore();
216 216
217 y += SkScalarCeilToScalar(path->getBounds().height() + 20.f); 217 y += SkScalarCeilToScalar(path->getBounds().height() + 20.f);
218 } 218 }
219 219
220 for (SkTLList<SkRect>::Iter iter(fRects, SkTLList<SkRect>::Iter::kHead_I terStart); 220 for (RectList::Iter iter(fRects, RectList::Iter::kHead_IterStart);
221 iter.get(); 221 iter.get();
222 iter.next()) { 222 iter.next()) {
223 223
224 SkScalar x = 0; 224 SkScalar x = 0;
225 225
226 for (int et = 0; et < kGrProcessorEdgeTypeCnt; ++et) { 226 for (int et = 0; et < kGrProcessorEdgeTypeCnt; ++et) {
227 GrTestTarget tt; 227 GrTestTarget tt;
228 context->getTestTarget(&tt, rt); 228 context->getTestTarget(&tt, rt);
229 if (nullptr == tt.target()) { 229 if (nullptr == tt.target()) {
230 SkDEBUGFAIL("Couldn't get Gr test target."); 230 SkDEBUGFAIL("Couldn't get Gr test target.");
(...skipping 30 matching lines...) Expand all
261 x += SkScalarCeilToScalar(iter.get()->width() + 10.f); 261 x += SkScalarCeilToScalar(iter.get()->width() + 10.f);
262 paint.setAntiAlias(true); 262 paint.setAntiAlias(true);
263 canvas->drawRect(*iter.get(), paint); 263 canvas->drawRect(*iter.get(), paint);
264 canvas->restore(); 264 canvas->restore();
265 265
266 y += SkScalarCeilToScalar(iter.get()->height() + 20.f); 266 y += SkScalarCeilToScalar(iter.get()->height() + 20.f);
267 } 267 }
268 } 268 }
269 269
270 private: 270 private:
271 SkTLList<SkPath> fPaths; 271 typedef SkTLList<SkPath, 1> PathList;
272 SkTLList<SkRect> fRects; 272 typedef SkTLList<SkRect, 1> RectList;
273 PathList fPaths;
274 RectList fRects;
273 275
274 typedef GM INHERITED; 276 typedef GM INHERITED;
275 }; 277 };
276 278
277 DEF_GM(return new ConvexPolyEffect;) 279 DEF_GM(return new ConvexPolyEffect;)
278 } 280 }
279 281
280 #endif 282 #endif
OLDNEW
« no previous file with comments | « gm/convexpolyclip.cpp ('k') | src/core/SkTLList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698