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

Unified Diff: gm/beziers.cpp

Issue 2369933002: beziers: I missed an unsequenced moveTo() pair. (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/beziers.cpp
diff --git a/gm/beziers.cpp b/gm/beziers.cpp
index ffc3ba65fdcf94da9d3132b500d89a48513cf7e7..598ed62c5ec2b58cf65f694cdd142cde1f84d9da 100755
--- a/gm/beziers.cpp
+++ b/gm/beziers.cpp
@@ -16,13 +16,15 @@
constexpr SkScalar SH = SkIntToScalar(H);
static void rnd_quad(SkPath* p, SkPaint* paint, SkRandom& rand) {
- p->moveTo(rand.nextRangeScalar(0, W), rand.nextRangeScalar(0, H));
+ auto a = rand.nextRangeScalar(0,W),
+ b = rand.nextRangeScalar(0,H);
+ p->moveTo(a,b);
for (int x = 0; x < 2; ++x) {
- auto a = rand.nextRangeScalar(W/4, W),
- b = rand.nextRangeScalar( 0, H),
- c = rand.nextRangeScalar( 0, W),
- d = rand.nextRangeScalar(H/4, H);
- p->quadTo(a,b,c,d);
+ auto c = rand.nextRangeScalar(W/4, W),
+ d = rand.nextRangeScalar( 0, H),
+ e = rand.nextRangeScalar( 0, W),
+ f = rand.nextRangeScalar(H/4, H);
+ p->quadTo(c,d,e,f);
}
paint->setColor(rand.nextU());
SkScalar width = rand.nextRangeScalar(1, 5);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698