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

Side by Side Diff: src/gpu/effects/GrDashingEffect.cpp

Issue 2125663003: Add gm that tests shaded stroked rectangles. (Closed) Base URL: https://skia.googlesource.com/skia.git@fixgmwidth
Patch Set: fix windows double->scalar warning Created 4 years, 5 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
« no previous file with comments | « src/gpu/batches/GrRectBatchFactory.h ('k') | no next file » | 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 2014 Google Inc. 2 * Copyright 2014 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 "GrDashingEffect.h" 8 #include "GrDashingEffect.h"
9 9
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1233 pts[1].fY = random->nextF() * 10.f; 1233 pts[1].fY = random->nextF() * 10.f;
1234 } else { 1234 } else {
1235 // horizontal 1235 // horizontal
1236 pts[0].fX = random->nextF() * 10.f; 1236 pts[0].fX = random->nextF() * 10.f;
1237 pts[0].fY = 1.f; 1237 pts[0].fY = 1.f;
1238 pts[1].fX = random->nextF() * 10.f; 1238 pts[1].fX = random->nextF() * 10.f;
1239 pts[1].fY = 1.f; 1239 pts[1].fY = 1.f;
1240 } 1240 }
1241 1241
1242 // pick random cap 1242 // pick random cap
1243 SkPaint::Cap cap = SkPaint::Cap(random->nextULessThan(SkPaint::Cap::kCapCoun t)); 1243 SkPaint::Cap cap = SkPaint::Cap(random->nextULessThan(SkPaint::kCapCount));
1244 1244
1245 SkScalar intervals[2]; 1245 SkScalar intervals[2];
1246 1246
1247 // We can only dash with the following intervals 1247 // We can only dash with the following intervals
1248 enum Intervals { 1248 enum Intervals {
1249 kOpenOpen_Intervals , 1249 kOpenOpen_Intervals ,
1250 kOpenClose_Intervals, 1250 kOpenClose_Intervals,
1251 kCloseOpen_Intervals, 1251 kCloseOpen_Intervals,
1252 }; 1252 };
1253 1253
(...skipping 26 matching lines...) Expand all
1280 p.setStrokeWidth(SkIntToScalar(1)); 1280 p.setStrokeWidth(SkIntToScalar(1));
1281 p.setStrokeCap(cap); 1281 p.setStrokeCap(cap);
1282 p.setPathEffect(GrTest::TestDashPathEffect::Make(intervals, 2, phase)); 1282 p.setPathEffect(GrTest::TestDashPathEffect::Make(intervals, 2, phase));
1283 1283
1284 GrStyle style(p); 1284 GrStyle style(p);
1285 1285
1286 return GrDashingEffect::CreateDashLineBatch(color, viewMatrix, pts, aaMode, style); 1286 return GrDashingEffect::CreateDashLineBatch(color, viewMatrix, pts, aaMode, style);
1287 } 1287 }
1288 1288
1289 #endif 1289 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrRectBatchFactory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698