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

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

Issue 1970003003: Add bounds to GrShape (Closed) Base URL: https://chromium.googlesource.com/skia.git@grshapeisempty
Patch Set: put back const& Created 4 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 | « include/core/SkRect.h ('k') | src/gpu/GrShape.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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 break; 141 break;
142 } 142 }
143 } 143 }
144 144
145 /** 145 /**
146 * Returns whether the geometry is empty. Note that applying the style could produce a 146 * Returns whether the geometry is empty. Note that applying the style could produce a
147 * non-empty shape. 147 * non-empty shape.
148 */ 148 */
149 bool isEmpty() const { return Type::kEmpty == fType; } 149 bool isEmpty() const { return Type::kEmpty == fType; }
150 150
151 /** Gets the bounds of the geometry without reflecting the shape's styling. */
152 const SkRect& bounds() const;
153
154 /** Gets the bounds of the geometry reflecting the shape's styling. */
155 void styledBounds(SkRect* bounds) const;
156
151 /** 157 /**
152 * Is it known that the unstyled geometry has no unclosed contours. This mea ns that it will 158 * Is it known that the unstyled geometry has no unclosed contours. This mea ns that it will
153 * not have any caps if stroked (modulo the effect of any path effect). 159 * not have any caps if stroked (modulo the effect of any path effect).
154 */ 160 */
155 bool knownToBeClosed() const { 161 bool knownToBeClosed() const {
156 switch (fType) { 162 switch (fType) {
157 case Type::kEmpty: 163 case Type::kEmpty:
158 return true; 164 return true;
159 case Type::kRRect: 165 case Type::kRRect:
160 return true; 166 return true;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 return Type::kPath; 242 return Type::kPath;
237 } 243 }
238 244
239 Type fType; 245 Type fType;
240 SkRRect fRRect; 246 SkRRect fRRect;
241 SkTLazy<SkPath> fPath; 247 SkTLazy<SkPath> fPath;
242 GrStyle fStyle; 248 GrStyle fStyle;
243 SkAutoSTArray<8, uint32_t> fInheritedKey; 249 SkAutoSTArray<8, uint32_t> fInheritedKey;
244 }; 250 };
245 #endif 251 #endif
OLDNEW
« no previous file with comments | « include/core/SkRect.h ('k') | src/gpu/GrShape.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698