No need to cache local matrix in picture shader.
authorscroggo <scroggo@google.com>
Fri, 11 Jul 2014 19:19:00 +0000 (12:19 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 11 Jul 2014 19:19:02 +0000 (12:19 -0700)
Now that the local matrix cannot be changed, we no longer need
to keep track of it to regenerate the bitmap shader.

Depends on https://codereview.chromium.org/379323002

R=fmalita@google.com, fmalita@chromium.org

Author: scroggo@google.com

Review URL: https://codereview.chromium.org/387043002

src/core/SkPictureShader.cpp
src/core/SkPictureShader.h

index d6b84c3..ab4de03 100644 (file)
@@ -81,9 +81,7 @@ SkShader* SkPictureShader::refBitmapShader(const SkMatrix& matrix, const SkMatri
 
     SkAutoMutexAcquire ama(fCachedBitmapShaderMutex);
 
-    // TODO(fmalita): remove fCachedLocalMatrix from this key after getLocalMatrix is removed.
-    if (!fCachedBitmapShader || tileScale != fCachedTileScale ||
-        this->getLocalMatrix() != fCachedLocalMatrix) {
+    if (!fCachedBitmapShader || tileScale != fCachedTileScale) {
         SkBitmap bm;
         if (!bm.allocN32Pixels(tileSize.width(), tileSize.height())) {
             return NULL;
@@ -95,7 +93,6 @@ SkShader* SkPictureShader::refBitmapShader(const SkMatrix& matrix, const SkMatri
         canvas.drawPicture(fPicture);
 
         fCachedTileScale = tileScale;
-        fCachedLocalMatrix = this->getLocalMatrix();
 
         SkMatrix shaderMatrix = this->getLocalMatrix();
         shaderMatrix.preScale(1 / tileScale.width(), 1 / tileScale.height());
index 4995d26..8df6030 100644 (file)
@@ -48,7 +48,6 @@ private:
     mutable SkMutex                 fCachedBitmapShaderMutex;
     mutable SkAutoTUnref<SkShader>  fCachedBitmapShader;
     mutable SkSize                  fCachedTileScale;
-    mutable SkMatrix                fCachedLocalMatrix;
 
     class PictureShaderContext : public SkShader::Context {
     public: