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

Side by Side Diff: tests/PathOpsSimplifyTest.cpp

Issue 1126193004: fix path op builder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « tests/PathOpsBuilderTest.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 2012 Google Inc. 2 * Copyright 2012 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 #include "PathOpsExtendedTest.h" 7 #include "PathOpsExtendedTest.h"
8 8
9 #define TEST(name) { name, #name } 9 #define TEST(name) { name, #name }
10 10
(...skipping 4741 matching lines...) Expand 10 before | Expand all | Expand 10 after
4752 testSimplify(reporter, path, filename); 4752 testSimplify(reporter, path, filename);
4753 } 4753 }
4754 4754
4755 static void testArc(skiatest::Reporter* reporter,const char* filename) { 4755 static void testArc(skiatest::Reporter* reporter,const char* filename) {
4756 SkRect r = SkRect::MakeWH(150, 100); 4756 SkRect r = SkRect::MakeWH(150, 100);
4757 SkPath path; 4757 SkPath path;
4758 path.arcTo(r, 0, 0.0025f, false); 4758 path.arcTo(r, 0, 0.0025f, false);
4759 testSimplify(reporter, path, filename); 4759 testSimplify(reporter, path, filename);
4760 } 4760 }
4761 4761
4762 static void testIssue3838(skiatest::Reporter* reporter,const char* filename) {
4763 SkPath path;
4764 path.moveTo(220, 170);
4765 path.lineTo(200, 170);
4766 path.lineTo(200, 190);
4767 path.lineTo(180, 190);
4768 path.lineTo(180, 210);
4769 path.lineTo(200, 210);
4770 path.lineTo(200, 250);
4771 path.lineTo(260, 250);
4772 path.lineTo(260, 190);
4773 path.lineTo(220, 190);
4774 path.lineTo(220, 170);
4775 path.close();
4776 path.moveTo(220, 210);
4777 path.lineTo(220, 230);
4778 path.lineTo(240, 230);
4779 path.lineTo(240, 210);
4780 path.lineTo(220, 210);
4781 path.close();
4782 testSimplify(reporter, path, filename);
4783 }
4784
4762 static void (*skipTest)(skiatest::Reporter* , const char* filename) = 0; 4785 static void (*skipTest)(skiatest::Reporter* , const char* filename) = 0;
4763 static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0; 4786 static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0;
4764 static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0; 4787 static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0;
4765 4788
4766 static TestDesc tests[] = { 4789 static TestDesc tests[] = {
4790 TEST(testIssue3838),
4767 TEST(testArc), 4791 TEST(testArc),
4768 TEST(testTriangle2), 4792 TEST(testTriangle2),
4769 TEST(testTriangle1), 4793 TEST(testTriangle1),
4770 TEST(testQuads64), 4794 TEST(testQuads64),
4771 TEST(testQuads63), 4795 TEST(testQuads63),
4772 TEST(testQuads62), 4796 TEST(testQuads62),
4773 TEST(testRect4), 4797 TEST(testRect4),
4774 TEST(testRect3), 4798 TEST(testRect3),
4775 TEST(testQuadralateral10), 4799 TEST(testQuadralateral10),
4776 TEST(testQuads61), 4800 TEST(testQuads61),
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
5203 5227
5204 DEF_TEST(PathOpsSimplify, reporter) { 5228 DEF_TEST(PathOpsSimplify, reporter) {
5205 if (runSubTests && runSubTestsFirst) { 5229 if (runSubTests && runSubTestsFirst) {
5206 RunTestSet(reporter, subTests, subTestCount, firstSubTest, NULL, stopTes t, runReverse); 5230 RunTestSet(reporter, subTests, subTestCount, firstSubTest, NULL, stopTes t, runReverse);
5207 } 5231 }
5208 RunTestSet(reporter, tests, testCount, firstTest, skipTest, stopTest, runRev erse); 5232 RunTestSet(reporter, tests, testCount, firstTest, skipTest, stopTest, runRev erse);
5209 if (runSubTests && !runSubTestsFirst) { 5233 if (runSubTests && !runSubTestsFirst) {
5210 RunTestSet(reporter, subTests, subTestCount, firstSubTest, NULL, stopTes t, runReverse); 5234 RunTestSet(reporter, subTests, subTestCount, firstSubTest, NULL, stopTes t, runReverse);
5211 } 5235 }
5212 } 5236 }
OLDNEW
« no previous file with comments | « tests/PathOpsBuilderTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698