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

Side by Side Diff: tests/DashPathEffectTest.cpp

Issue 1312163008: Forward declare SkStrokeRec in SkPathEffect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « src/utils/SkDashPath.cpp ('k') | tests/DrawPathTest.cpp » ('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 * 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 "Test.h" 8 #include "Test.h"
9 9
10 #include "SkDashPathEffect.h" 10 #include "SkDashPathEffect.h"
11 #include "SkWriteBuffer.h" 11 #include "SkWriteBuffer.h"
12 #include "SkStrokeRec.h"
12 13
13 // crbug.com/348821 was rooted in SkDashPathEffect refusing to flatten and unfla tten itself when 14 // crbug.com/348821 was rooted in SkDashPathEffect refusing to flatten and unfla tten itself when
14 // fInitialDashLength < 0 (a signal the effect is nonsense). Here we test that it flattens. 15 // fInitialDashLength < 0 (a signal the effect is nonsense). Here we test that it flattens.
15 16
16 DEF_TEST(DashPathEffectTest_crbug_348821, r) { 17 DEF_TEST(DashPathEffectTest_crbug_348821, r) {
17 SkScalar intervals[] = { 1.76934361e+36f, 2.80259693e-45f }; // Values from bug. 18 SkScalar intervals[] = { 1.76934361e+36f, 2.80259693e-45f }; // Values from bug.
18 const int count = 2; 19 const int count = 2;
19 SkScalar phase = SK_ScalarInfinity; // Used to force the bad fInitialDashLe ngth = -1 path. 20 SkScalar phase = SK_ScalarInfinity; // Used to force the bad fInitialDashLe ngth = -1 path.
20 SkAutoTUnref<SkDashPathEffect> dash(SkDashPathEffect::Create(intervals, coun t, phase)); 21 SkAutoTUnref<SkDashPathEffect> dash(SkDashPathEffect::Create(intervals, coun t, phase));
21 22
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 if (i < 2) { 80 if (i < 2) {
80 REPORTER_ASSERT(r, actualResult == testCases[j].fExpectedRes ult); 81 REPORTER_ASSERT(r, actualResult == testCases[j].fExpectedRes ult);
81 } else { 82 } else {
82 // On the third pass all the lines should be outside the tra nslated cull rect 83 // On the third pass all the lines should be outside the tra nslated cull rect
83 REPORTER_ASSERT(r, !actualResult); 84 REPORTER_ASSERT(r, !actualResult);
84 } 85 }
85 } 86 }
86 } 87 }
87 } 88 }
88 } 89 }
OLDNEW
« no previous file with comments | « src/utils/SkDashPath.cpp ('k') | tests/DrawPathTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698