summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-02 21:23:52 +0000
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-02 21:23:52 +0000
commit676c5529e98d86445c853a79336e5420a5a847a2 (patch)
tree30e0715577b07a196318a10c2f1042ed6b81881b
parentd0001ccdf616e32f81a8f0d0215200816eed3d62 (diff)
downloadsrc-676c5529e98d86445c853a79336e5420a5a847a2.tar.gz
Remove setLocalMatrix calls from picture shader GM.
This makes all --skr tests pass for me. Enabling it by default in DM. BUG=skia:2378 Committed: http://code.google.com/p/skia/source/detail?r=14549 R=reed@google.com, mtklein@google.com, fmalita@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/260863007 git-svn-id: http://skia.googlecode.com/svn/trunk/src@14551 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--core/SkPictureShader.cpp12
-rw-r--r--core/SkPictureShader.h4
-rw-r--r--core/SkShader.cpp5
3 files changed, 13 insertions, 8 deletions
diff --git a/core/SkPictureShader.cpp b/core/SkPictureShader.cpp
index 27cbb00f..81f92428 100644
--- a/core/SkPictureShader.cpp
+++ b/core/SkPictureShader.cpp
@@ -18,8 +18,10 @@
#include "GrContext.h"
#endif
-SkPictureShader::SkPictureShader(SkPicture* picture, TileMode tmx, TileMode tmy)
- : fPicture(SkRef(picture))
+SkPictureShader::SkPictureShader(SkPicture* picture, TileMode tmx, TileMode tmy,
+ const SkMatrix* localMatrix)
+ : INHERITED(localMatrix)
+ , fPicture(SkRef(picture))
, fTmx(tmx)
, fTmy(tmy) { }
@@ -34,11 +36,12 @@ SkPictureShader::~SkPictureShader() {
fPicture->unref();
}
-SkPictureShader* SkPictureShader::Create(SkPicture* picture, TileMode tmx, TileMode tmy) {
+SkPictureShader* SkPictureShader::Create(SkPicture* picture, TileMode tmx, TileMode tmy,
+ const SkMatrix* localMatrix) {
if (!picture || 0 == picture->width() || 0 == picture->height()) {
return NULL;
}
- return SkNEW_ARGS(SkPictureShader, (picture, tmx, tmy));
+ return SkNEW_ARGS(SkPictureShader, (picture, tmx, tmy, localMatrix));
}
void SkPictureShader::flatten(SkWriteBuffer& buffer) const {
@@ -79,6 +82,7 @@ SkShader* SkPictureShader::refBitmapShader(const SkMatrix& matrix) const {
SkAutoMutexAcquire ama(fCachedBitmapShaderMutex);
+ // TODO(fmalita): remove fCachedLocalMatrix from this key after getLocalMatrix is removed.
if (!fCachedBitmapShader || tileScale != fCachedTileScale ||
this->getLocalMatrix() != fCachedLocalMatrix) {
SkBitmap bm;
diff --git a/core/SkPictureShader.h b/core/SkPictureShader.h
index 510c9888..2ef6c1c9 100644
--- a/core/SkPictureShader.h
+++ b/core/SkPictureShader.h
@@ -21,7 +21,7 @@ class SkPicture;
*/
class SkPictureShader : public SkShader {
public:
- static SkPictureShader* Create(SkPicture*, TileMode, TileMode);
+ static SkPictureShader* Create(SkPicture*, TileMode, TileMode, const SkMatrix* = NULL);
virtual ~SkPictureShader();
virtual bool validContext(const ContextRec&, SkMatrix* totalInverse) const SK_OVERRIDE;
@@ -59,7 +59,7 @@ protected:
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
private:
- SkPictureShader(SkPicture*, TileMode, TileMode);
+ SkPictureShader(SkPicture*, TileMode, TileMode, const SkMatrix* = NULL);
SkShader* validInternal(const ContextRec&, SkMatrix* totalInverse) const;
SkShader* refBitmapShader(const SkMatrix&) const;
diff --git a/core/SkShader.cpp b/core/SkShader.cpp
index 0f6ba4ce..67dd5815 100644
--- a/core/SkShader.cpp
+++ b/core/SkShader.cpp
@@ -193,8 +193,9 @@ SkShader* SkShader::CreateBitmapShader(const SkBitmap& src, TileMode tmx, TileMo
return ::CreateBitmapShader(src, tmx, tmy, localMatrix, NULL);
}
-SkShader* SkShader::CreatePictureShader(SkPicture* src, TileMode tmx, TileMode tmy) {
- return SkPictureShader::Create(src, tmx, tmy);
+SkShader* SkShader::CreatePictureShader(SkPicture* src, TileMode tmx, TileMode tmy,
+ const SkMatrix* localMatrix) {
+ return SkPictureShader::Create(src, tmx, tmy, localMatrix);
}
#ifndef SK_IGNORE_TO_STRING