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

Side by Side Diff: src/gpu/GrTestUtils.cpp

Issue 1129083005: AADistanceFieldPathRenderer unit tests (Closed) Base URL: https://skia.googlesource.com/skia.git@randbatch7
Patch Set: tweaks Created 5 years, 7 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/GrOvalRenderer.cpp ('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 2015 Google Inc. 2 * Copyright 2015 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 "GrTestUtils.h" 8 #include "GrTestUtils.h"
9 #include "SkMatrix.h" 9 #include "SkMatrix.h"
10 #include "SkPath.h" 10 #include "SkPath.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 gPath[6].lineTo(5.0f, 5.0f); 168 gPath[6].lineTo(5.0f, 5.0f);
169 gPath[6].lineTo(10.0f, 0.0f); 169 gPath[6].lineTo(10.0f, 0.0f);
170 gPath[6].lineTo(10.0f, 10.0f); 170 gPath[6].lineTo(10.0f, 10.0f);
171 gPath[6].lineTo(0.0f, 10.0f); 171 gPath[6].lineTo(0.0f, 10.0f);
172 gPath[6].close(); 172 gPath[6].close();
173 } 173 }
174 174
175 return gPath[random->nextULessThan(static_cast<uint32_t>(SK_ARRAY_COUNT(gPat h)))]; 175 return gPath[random->nextULessThan(static_cast<uint32_t>(SK_ARRAY_COUNT(gPat h)))];
176 } 176 }
177 177
178 SkStrokeRec TestStrokeRec(SkRandom* random) {
179 SkStrokeRec::InitStyle style =
180 SkStrokeRec::InitStyle(random->nextULessThan(SkStrokeRec::kFill_Init Style + 1));
181 SkStrokeRec rec(style);
182 bool strokeAndFill = random->nextBool();
183 SkScalar strokeWidth = random->nextBool() ? 0.f : 1.f;
184 rec.setStrokeStyle(strokeWidth, strokeAndFill);
185
186 SkPaint::Cap cap = SkPaint::Cap(random->nextULessThan(SkPaint::kCapCount));
187 SkPaint::Join join = SkPaint::Join(random->nextULessThan(SkPaint::kJoinCount ));
188 SkScalar miterLimit = random->nextRangeScalar(1.f, 5.f);
189 rec.setStrokeParams(cap, join, miterLimit);
190 return rec;
191 }
192
178 }; 193 };
179 194
180 #endif 195 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrOvalRenderer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698