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

Unified Diff: src/core/SkLocalMatrixShader.h

Issue 386693003: Use SkShader's localMat for SkLocalMatrixShader. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Refine comment. Created 6 years, 5 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 | « include/core/SkShader.h ('k') | src/core/SkLocalMatrixShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkLocalMatrixShader.h
diff --git a/src/core/SkLocalMatrixShader.h b/src/core/SkLocalMatrixShader.h
index b56cd4726fb4beaaa00cccdae19ff70fe3366708..7eb7c1337aa1ae830b13ca241668411276828a01 100644
--- a/src/core/SkLocalMatrixShader.h
+++ b/src/core/SkLocalMatrixShader.h
@@ -15,8 +15,8 @@
class SkLocalMatrixShader : public SkShader {
public:
SkLocalMatrixShader(SkShader* proxy, const SkMatrix& localMatrix)
- : fProxyShader(SkRef(proxy))
- , fProxyLocalMatrix(localMatrix)
+ : INHERITED(&localMatrix)
+ , fProxyShader(SkRef(proxy))
{}
virtual size_t contextSize() const SK_OVERRIDE {
@@ -36,7 +36,7 @@ public:
virtual bool asNewEffect(GrContext* context, const SkPaint& paint, const SkMatrix* localMatrix,
GrColor* grColor, GrEffect** grEffect) const SK_OVERRIDE {
- SkMatrix tmp = fProxyLocalMatrix;
+ SkMatrix tmp = this->getLocalMatrix();
if (localMatrix) {
tmp.preConcat(*localMatrix);
}
@@ -55,7 +55,7 @@ public:
virtual SkShader* refAsALocalMatrixShader(SkMatrix* localMatrix) const SK_OVERRIDE {
if (localMatrix) {
- *localMatrix = fProxyLocalMatrix;
+ *localMatrix = this->getLocalMatrix();
}
return SkRef(fProxyShader.get());
}
@@ -70,7 +70,6 @@ protected:
private:
SkAutoTUnref<SkShader> fProxyShader;
- SkMatrix fProxyLocalMatrix;
typedef SkShader INHERITED;
};
« no previous file with comments | « include/core/SkShader.h ('k') | src/core/SkLocalMatrixShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698