diff options
author | fmalita <fmalita@chromium.org> | 2014-12-10 13:01:43 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-10 13:01:43 -0800 |
commit | 04b49c31789201fbef969f5598a286187920dd56 (patch) | |
tree | 99c1df79b95ce740b028382680a9af5359663219 /src/core | |
parent | 733fc2054044377e914559fa4f46db66ab7d9cea (diff) |
Don't store an SkMatrix in BitmapShaderKey.
SkMatrix makes for a poor key component due to mutable/cache fields.
Use its canonical scalars instead.
R=reed@google.com,mtklein@google.com
Review URL: https://codereview.chromium.org/792123002
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkPictureShader.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/SkPictureShader.cpp b/src/core/SkPictureShader.cpp index fb05597db8..73807b38c1 100644 --- a/src/core/SkPictureShader.cpp +++ b/src/core/SkPictureShader.cpp @@ -34,14 +34,17 @@ public: , fTile(tile) , fTmx(tmx) , fTmy(tmy) - , fScale(scale) - , fLocalMatrix(localMatrix) { + , fScale(scale) { + + for (int i = 0; i < 9; ++i) { + fLocalMatrixStorage[i] = localMatrix[i]; + } static const size_t keySize = sizeof(fPictureID) + sizeof(fTile) + sizeof(fTmx) + sizeof(fTmy) + sizeof(fScale) + - sizeof(fLocalMatrix); + sizeof(fLocalMatrixStorage); // This better be packed. SkASSERT(sizeof(uint32_t) * (&fEndOfStruct - &fPictureID) == keySize); this->init(&gBitmapSkaderKeyNamespaceLabel, keySize); @@ -52,7 +55,7 @@ private: SkRect fTile; SkShader::TileMode fTmx, fTmy; SkSize fScale; - SkMatrix fLocalMatrix; + SkScalar fLocalMatrixStorage[9]; SkDEBUGCODE(uint32_t fEndOfStruct;) }; |