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

Unified Diff: include/core/SkRRect.h

Issue 801693003: Fill SkRRect::fType proactively. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: debug only Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkRRect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkRRect.h
diff --git a/include/core/SkRRect.h b/include/core/SkRRect.h
index f27d798bd401acbd77e3c5c331f8954066885699..b9c3a79763fceba17e34f9400758b8088163de2b 100644
--- a/include/core/SkRRect.h
+++ b/include/core/SkRRect.h
@@ -52,9 +52,6 @@ public:
* by type(). The subtypes become progressively less restrictive.
*/
enum Type {
- // !< Internal indicator that the sub type must be computed.
- kUnknown_Type = -1,
-
// !< The RR is empty
kEmpty_Type,
@@ -90,11 +87,6 @@ public:
*/
Type getType() const {
SkDEBUGCODE(this->validate();)
-
- if (kUnknown_Type == fType) {
- this->computeType();
- }
- SkASSERT(kUnknown_Type != fType);
return static_cast<Type>(fType);
}
@@ -301,11 +293,11 @@ private:
// Radii order is UL, UR, LR, LL. Use Corner enum to index into fRadii[]
SkVector fRadii[4];
// use an explicitly sized type so we're sure the class is dense (no uninitialized bytes)
- mutable int32_t fType;
+ int32_t fType;
// TODO: add padding so we can use memcpy for flattening and not copy
// uninitialized data
- void computeType() const;
+ void computeType();
bool checkCornerContainment(SkScalar x, SkScalar y) const;
// to access fRadii directly
« no previous file with comments | « no previous file | src/core/SkRRect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698