Chromium Code Reviews| Index: src/core/SkPictureShader.cpp |
| diff --git a/src/core/SkPictureShader.cpp b/src/core/SkPictureShader.cpp |
| index 198a2a9e497602b24e0ed7b5ed4a9f66c9899a19..947a5383210e8d94355fdbe5d4437e53e374213f 100644 |
| --- a/src/core/SkPictureShader.cpp |
| +++ b/src/core/SkPictureShader.cpp |
| @@ -14,6 +14,7 @@ |
| #include "SkPicture.h" |
| #include "SkReadBuffer.h" |
| #include "SkResourceCache.h" |
| +#include "SkTypes.h" |
| #if SK_SUPPORT_GPU |
| #include "GrContext.h" |
| @@ -34,14 +35,17 @@ public: |
| , fTile(tile) |
| , fTmx(tmx) |
| , fTmy(tmy) |
| - , fScale(scale) |
| - , fLocalMatrix(localMatrix) { |
| + , fScale(scale) { |
| + |
| + size_t matrixSize = localMatrix.writeToMemory(fLocalMatrixStorage); |
| + SkASSERT(matrixSize <= sizeof(fLocalMatrixStorage)); |
| + sk_bzero(fLocalMatrixStorage + matrixSize, sizeof(fLocalMatrixStorage) - matrixSize); |
| 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 +56,7 @@ private: |
| SkRect fTile; |
| SkShader::TileMode fTmx, fTmy; |
| SkSize fScale; |
| - SkMatrix fLocalMatrix; |
| + uint8_t fLocalMatrixStorage[SkMatrix::kMaxFlattenSize]; |
|
mtklein
2014/12/10 19:52:47
Let's be even more explicit? This actually includ
f(malita)
2014/12/10 20:03:29
Done.
|
| SkDEBUGCODE(uint32_t fEndOfStruct;) |
| }; |