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

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

Issue 2046753002: Get segment masks from GrShape. (Closed) Base URL: https://chromium.googlesource.com/skia.git@shapedirandstart
Patch Set: Created 4 years, 6 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 | tests/GrShapeTest.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 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 GrShape_DEFINED 8 #ifndef GrShape_DEFINED
9 #define GrShape_DEFINED 9 #define GrShape_DEFINED
10 10
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 case Type::kEmpty: 189 case Type::kEmpty:
190 return true; 190 return true;
191 case Type::kRRect: 191 case Type::kRRect:
192 return true; 192 return true;
193 case Type::kPath: 193 case Type::kPath:
194 return false; 194 return false;
195 } 195 }
196 return false; 196 return false;
197 } 197 }
198 198
199 uint32_t segmentMask() const {
200 switch (fType) {
201 case Type::kEmpty:
202 return 0;
203 case Type::kRRect:
204 if (fRRect.getType() == SkRRect::kOval_Type) {
205 return SkPath::kConic_SegmentMask;
206 } else if (fRRect.getType() == SkRRect::kRect_Type) {
207 return SkPath::kLine_SegmentMask;
208 }
209 return SkPath::kLine_SegmentMask | SkPath::kConic_SegmentMask;
210 case Type::kPath:
211 return fPath.get()->getSegmentMasks();
212 }
213 return 0;
214 }
215
199 /** 216 /**
200 * Gets the size of the key for the shape represented by this GrShape (ignor ing its styling). 217 * Gets the size of the key for the shape represented by this GrShape (ignor ing its styling).
201 * A negative value is returned if the shape has no key (shouldn't be cached ). 218 * A negative value is returned if the shape has no key (shouldn't be cached ).
202 */ 219 */
203 int unstyledKeySize() const; 220 int unstyledKeySize() const;
204 221
205 /** 222 /**
206 * Writes unstyledKeySize() bytes into the provided pointer. Assumes that th ere is enough 223 * Writes unstyledKeySize() bytes into the provided pointer. Assumes that th ere is enough
207 * space allocated for the key and that unstyledKeySize() does not return a negative value 224 * space allocated for the key and that unstyledKeySize() does not return a negative value
208 * for this shape. 225 * for this shape.
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 311
295 Type fType; 312 Type fType;
296 SkRRect fRRect; 313 SkRRect fRRect;
297 SkPath::Direction fRRectDir; 314 SkPath::Direction fRRectDir;
298 unsigned fRRectStart; 315 unsigned fRRectStart;
299 SkTLazy<SkPath> fPath; 316 SkTLazy<SkPath> fPath;
300 GrStyle fStyle; 317 GrStyle fStyle;
301 SkAutoSTArray<8, uint32_t> fInheritedKey; 318 SkAutoSTArray<8, uint32_t> fInheritedKey;
302 }; 319 };
303 #endif 320 #endif
OLDNEW
« no previous file with comments | « no previous file | tests/GrShapeTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698