aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkRRect.h
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2014-10-22 11:23:56 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-22 11:23:56 -0700
commit727b8c1d1c0ba0634a97bff601e7af96bfd7daf8 (patch)
treed89f1fcfe398273e678b897ea004030ec27160e9 /include/core/SkRRect.h
parent171e5b73a862418f4acd61faf8cecfbc8f58694c (diff)
explicitly size fType in SkRRect, to ensure the are no uninitialized bytes
(so it can be used as a key in a cache) BUG=skia: Review URL: https://codereview.chromium.org/670183002
Diffstat (limited to 'include/core/SkRRect.h')
-rw-r--r--include/core/SkRRect.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/core/SkRRect.h b/include/core/SkRRect.h
index d3f48cd484..16670aab45 100644
--- a/include/core/SkRRect.h
+++ b/include/core/SkRRect.h
@@ -95,7 +95,7 @@ public:
this->computeType();
}
SkASSERT(kUnknown_Type != fType);
- return fType;
+ return static_cast<Type>(fType);
}
Type type() const { return this->getType(); }
@@ -304,7 +304,8 @@ private:
SkRect fRect;
// Radii order is UL, UR, LR, LL. Use Corner enum to index into fRadii[]
SkVector fRadii[4];
- mutable Type fType;
+ // use an explicitly sized type so we're sure the class is dense (no uninitialized bytes)
+ mutable int32_t fType;
// TODO: add padding so we can use memcpy for flattening and not copy
// uninitialized data