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

Side by Side Diff: src/gpu/GrStyle.h

Issue 2064753003: Remove style application from GrPathRenderer subclasses (Closed) Base URL: https://chromium.googlesource.com/skia.git@pathshape
Patch Set: Remove random style from DF batch test create, since it now only allows simple fill Created 4 years, 5 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/batches/GrAADistanceFieldPathRenderer.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 2016 Google Inc. 2 * Copyright 2016 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 GrStyle_DEFINED 8 #ifndef GrStyle_DEFINED
9 #define GrStyle_DEFINED 9 #define GrStyle_DEFINED
10 10
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 fStrokeRec.setHairlineStyle(); 106 fStrokeRec.setHairlineStyle();
107 } 107 }
108 } 108 }
109 109
110 /** Is this style a fill with no path effect? */ 110 /** Is this style a fill with no path effect? */
111 bool isSimpleFill() const { return fStrokeRec.isFillStyle() && !fPathEffect; } 111 bool isSimpleFill() const { return fStrokeRec.isFillStyle() && !fPathEffect; }
112 112
113 /** Is this style a hairline with no path effect? */ 113 /** Is this style a hairline with no path effect? */
114 bool isSimpleHairline() const { return fStrokeRec.isHairlineStyle() && !fPat hEffect; } 114 bool isSimpleHairline() const { return fStrokeRec.isHairlineStyle() && !fPat hEffect; }
115 115
116 bool couldBeHairline() const {
117 // If the original stroke rec has hairline style then either a null or d ash patheffect
118 // would preserve the hairline status. An arbitrary path effect could in troduce hairline
119 // style.
120 return this->strokeRec().isHairlineStyle() || this->hasNonDashPathEffect ();
121 }
122
123 SkPathEffect* pathEffect() const { return fPathEffect.get(); } 116 SkPathEffect* pathEffect() const { return fPathEffect.get(); }
124 117
125 bool hasPathEffect() const { return SkToBool(fPathEffect.get()); } 118 bool hasPathEffect() const { return SkToBool(fPathEffect.get()); }
126 119
127 bool hasNonDashPathEffect() const { return fPathEffect.get() && !this->isDas hed(); } 120 bool hasNonDashPathEffect() const { return fPathEffect.get() && !this->isDas hed(); }
128 121
129 bool isDashed() const { return SkPathEffect::kDash_DashType == fDashInfo.fTy pe; } 122 bool isDashed() const { return SkPathEffect::kDash_DashType == fDashInfo.fTy pe; }
130 SkScalar dashPhase() const { 123 SkScalar dashPhase() const {
131 SkASSERT(this->isDashed()); 124 SkASSERT(this->isDashed());
132 return fDashInfo.fPhase; 125 return fDashInfo.fPhase;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 }; 202 };
210 203
211 bool applyPathEffect(SkPath* dst, SkStrokeRec* strokeRec, const SkPath& src) const; 204 bool applyPathEffect(SkPath* dst, SkStrokeRec* strokeRec, const SkPath& src) const;
212 205
213 SkStrokeRec fStrokeRec; 206 SkStrokeRec fStrokeRec;
214 sk_sp<SkPathEffect> fPathEffect; 207 sk_sp<SkPathEffect> fPathEffect;
215 DashInfo fDashInfo; 208 DashInfo fDashInfo;
216 }; 209 };
217 210
218 #endif 211 #endif
OLDNEW
« no previous file with comments | « no previous file | src/gpu/batches/GrAADistanceFieldPathRenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698