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

Side by Side Diff: tests/PathMeasureTest.cpp

Issue 1602153002: fix circular dashing (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix test Created 4 years, 11 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/core/SkPathMeasure.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 2011 Google Inc. 2 * Copyright 2011 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 "SkPathMeasure.h" 8 #include "SkPathMeasure.h"
9 #include "Test.h" 9 #include "Test.h"
10 10
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 SkScalarNearlyEqual(position.fY, 194 SkScalarNearlyEqual(position.fY,
195 2.0f, 195 2.0f,
196 0.0001f)); 196 0.0001f));
197 REPORTER_ASSERT(reporter, tangent.fX == -SK_Scalar1); 197 REPORTER_ASSERT(reporter, tangent.fX == -SK_Scalar1);
198 REPORTER_ASSERT(reporter, tangent.fY == 0); 198 REPORTER_ASSERT(reporter, tangent.fY == 0);
199 199
200 test_small_segment(); 200 test_small_segment();
201 test_small_segment2(); 201 test_small_segment2();
202 test_small_segment3(); 202 test_small_segment3();
203 } 203 }
204
205 DEF_TEST(PathMeasureConic, reporter) {
206 SkPoint stdP, hiP, pts[] = {{0,0}, {100,0}, {100,0}};
207 SkPath p;
208 p.moveTo(0, 0);
209 p.conicTo(pts[1], pts[2], 1);
210 SkPathMeasure stdm(p, false);
211 REPORTER_ASSERT(reporter, stdm.getPosTan(20, &stdP, nullptr));
212 p.reset();
213 p.moveTo(0, 0);
214 p.conicTo(pts[1], pts[2], 10);
215 stdm.setPath(&p, false);
216 REPORTER_ASSERT(reporter, stdm.getPosTan(20, &hiP, nullptr));
217 REPORTER_ASSERT(reporter, 19.5f < stdP.fX && stdP.fX < 20.5f);
218 REPORTER_ASSERT(reporter, 19.5f < hiP.fX && hiP.fX < 20.5f);
219 }
OLDNEW
« no previous file with comments | « src/core/SkPathMeasure.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698