diff options
author | 2014-12-18 13:29:54 -0800 | |
---|---|---|
committer | 2014-12-18 13:29:54 -0800 | |
commit | 8aacf2085673f6302a43d590d4d2890789b87192 (patch) | |
tree | ee82bfd1b0289e9f715ec86c7aed8e413c4e4de0 /include | |
parent | 152d42f628335b747c7b527cedbb69fe2dc3d3ee (diff) |
Fill SkRRect::fType proactively.
I found no external mentions of SkRRect::kUnknown_Type.
Motivating race found by TSAN:
http://build.chromium.org/p/client.skia/builders/Test-Ubuntu13.10-GCE-NoGPU-x86_64-Release-TSAN-Trybot/builds/48/steps/dm/logs/stdio
BUG=skia:
Review URL: https://codereview.chromium.org/801693003
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkRRect.h | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/include/core/SkRRect.h b/include/core/SkRRect.h index f27d798bd4..b9c3a79763 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 |