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: include/core/SkStrokeRec.h

Issue 1130153002: Fix SkStrokeRec == to report true for all fills (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: the testcase had some doubles 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 | « no previous file | src/gpu/GrPath.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 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 7
8 #ifndef SkStrokeRec_DEFINED 8 #ifndef SkStrokeRec_DEFINED
9 #define SkStrokeRec_DEFINED 9 #define SkStrokeRec_DEFINED
10 10
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 * 88 *
89 * src and dst may be the same path. 89 * src and dst may be the same path.
90 */ 90 */
91 bool applyToPath(SkPath* dst, const SkPath& src) const; 91 bool applyToPath(SkPath* dst, const SkPath& src) const;
92 92
93 /** 93 /**
94 * Apply these stroke parameters to a paint. 94 * Apply these stroke parameters to a paint.
95 */ 95 */
96 void applyToPaint(SkPaint* paint) const; 96 void applyToPaint(SkPaint* paint) const;
97 97
98 bool operator==(const SkStrokeRec& other) const { 98 /**
99 return fWidth == other.fWidth && 99 * Compare if two SkStrokeRecs have an equal effect on a path.
100 fMiterLimit == other.fMiterLimit && 100 * Equal SkStrokeRecs produce equal paths. Equality of produced
101 fCap == other.fCap && 101 * paths does not take the ResScale parameter into account.
102 fJoin == other.fJoin && 102 */
103 fStrokeAndFill == other.fStrokeAndFill; 103 bool hasEqualEffect(const SkStrokeRec& other) const {
104 if (!this->needToApply()) {
105 return this->getStyle() == other.getStyle();
106 }
107 return fWidth == other.fWidth &&
108 fMiterLimit == other.fMiterLimit &&
109 fCap == other.fCap &&
110 fJoin == other.fJoin &&
111 fStrokeAndFill == other.fStrokeAndFill;
104 } 112 }
105 113
106 private: 114 private:
107 void init(const SkPaint&, SkPaint::Style, SkScalar resScale); 115 void init(const SkPaint&, SkPaint::Style, SkScalar resScale);
108 116
109 SkScalar fResScale; 117 SkScalar fResScale;
110 SkScalar fWidth; 118 SkScalar fWidth;
111 SkScalar fMiterLimit; 119 SkScalar fMiterLimit;
112 SkPaint::Cap fCap; 120 SkPaint::Cap fCap;
113 SkPaint::Join fJoin; 121 SkPaint::Join fJoin;
114 bool fStrokeAndFill; 122 bool fStrokeAndFill;
115 }; 123 };
116 124
117 #endif 125 #endif
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrPath.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698