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

Side by Side Diff: gm/strokefill.cpp

Issue 834503002: Update stroke path to use rect returned from isRect (to fix trailing moveTo bug) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add comment Created 5 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 | « expectations/gm/ignored-tests.txt ('k') | include/core/SkPath.h » ('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 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 "gm.h" 8 #include "gm.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkPath.h" 10 #include "SkPath.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 path2.reset(); 72 path2.reset();
73 path2.addCircle(x + SkIntToScalar(240), y + SkIntToScalar(200), SkIntToS calar(50), SkPath::kCCW_Direction); 73 path2.addCircle(x + SkIntToScalar(240), y + SkIntToScalar(200), SkIntToS calar(50), SkPath::kCCW_Direction);
74 canvas->drawPath(path2, paint); 74 canvas->drawPath(path2, paint);
75 SkASSERT(path2.cheapIsDirection(SkPath::kCCW_Direction)); 75 SkASSERT(path2.cheapIsDirection(SkPath::kCCW_Direction));
76 76
77 path2.reset(); 77 path2.reset();
78 SkASSERT(!path2.cheapComputeDirection(NULL)); 78 SkASSERT(!path2.cheapComputeDirection(NULL));
79 path2.addCircle(x + SkIntToScalar(360), y + SkIntToScalar(200), SkIntToS calar(50), SkPath::kCW_Direction); 79 path2.addCircle(x + SkIntToScalar(360), y + SkIntToScalar(200), SkIntToS calar(50), SkPath::kCW_Direction);
80 SkASSERT(path2.cheapIsDirection(SkPath::kCW_Direction)); 80 SkASSERT(path2.cheapIsDirection(SkPath::kCW_Direction));
81 canvas->drawPath(path2, paint); 81 canvas->drawPath(path2, paint);
82
83 SkRect r = SkRect::MakeXYWH(x - SkIntToScalar(50), y + SkIntToScalar(280 ),
84 SkIntToScalar(100), SkIntToScalar(100));
85 SkPath path3;
86 path3.setFillType(SkPath::kWinding_FillType);
87 path3.addRect(r, SkPath::kCW_Direction);
88 r.inset(SkIntToScalar(10), SkIntToScalar(10));
89 path3.addRect(r, SkPath::kCCW_Direction);
90 canvas->drawPath(path3, paint);
91
92 r = SkRect::MakeXYWH(x + SkIntToScalar(70), y + SkIntToScalar(280),
93 SkIntToScalar(100), SkIntToScalar(100));
94 SkPath path4;
95 path4.setFillType(SkPath::kWinding_FillType);
96 path4.addRect(r, SkPath::kCCW_Direction);
97 r.inset(SkIntToScalar(10), SkIntToScalar(10));
98 path4.addRect(r, SkPath::kCW_Direction);
99 canvas->drawPath(path4, paint);
100
101 r = SkRect::MakeXYWH(x + SkIntToScalar(190), y + SkIntToScalar(280),
102 SkIntToScalar(100), SkIntToScalar(100));
103 path4.reset();
104 SkASSERT(!path4.cheapComputeDirection(NULL));
105 path4.addRect(r, SkPath::kCCW_Direction);
106 SkASSERT(path4.cheapIsDirection(SkPath::kCCW_Direction));
107 path4.moveTo(0, 0); // test for crbug.com/247770
108 canvas->drawPath(path4, paint);
109
110 r = SkRect::MakeXYWH(x + SkIntToScalar(310), y + SkIntToScalar(280),
111 SkIntToScalar(100), SkIntToScalar(100));
112 path4.reset();
113 SkASSERT(!path4.cheapComputeDirection(NULL));
114 path4.addRect(r, SkPath::kCW_Direction);
115 SkASSERT(path4.cheapIsDirection(SkPath::kCW_Direction));
116 path4.moveTo(0, 0); // test for crbug.com/247770
117 canvas->drawPath(path4, paint);
82 } 118 }
83 119
84 private: 120 private:
85 typedef GM INHERITED; 121 typedef GM INHERITED;
86 }; 122 };
87 123
88 ////////////////////////////////////////////////////////////////////////////// 124 //////////////////////////////////////////////////////////////////////////////
89 125
90 static GM* MyFactory(void*) { return new StrokeFillGM; } 126 DEF_GM(return SkNEW(StrokeFillGM);)
91 static GMRegistry reg(MyFactory);
92 127
93 } 128 }
OLDNEW
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | include/core/SkPath.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698