Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1131)

Unified Diff: src/core/SkPictureShader.cpp

Issue 260863007: Remove setLocalMatrix calls from picture shader GM. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: pass the localMatrix... Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkPictureShader.h ('k') | src/core/SkShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPictureShader.cpp
diff --git a/src/core/SkPictureShader.cpp b/src/core/SkPictureShader.cpp
index 27cbb00f63d0bd0ad0a9feaea43a75e97783c092..81f9242854576442f221cce7814261b10bb41817 100644
--- a/src/core/SkPictureShader.cpp
+++ b/src/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;
« no previous file with comments | « src/core/SkPictureShader.h ('k') | src/core/SkShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698