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

Unified Diff: src/core/SkShader.cpp

Issue 279903002: reland hide get/setLocalMatrix (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: remember global initialization of flattenables Created 6 years, 7 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.cpp ('k') | src/effects/SkRectShaderImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkShader.cpp
diff --git a/src/core/SkShader.cpp b/src/core/SkShader.cpp
index 75a5fdbd3680f8e805d45a4b67d5d6763cb592d0..6a418b6b4578eb6c2be004f5d809dcb984ff9b4b 100644
--- a/src/core/SkShader.cpp
+++ b/src/core/SkShader.cpp
@@ -60,7 +60,7 @@ SkShader::~SkShader() {
void SkShader::flatten(SkWriteBuffer& buffer) const {
this->INHERITED::flatten(buffer);
- bool hasLocalM = this->hasLocalMatrix();
+ bool hasLocalM = !fLocalMatrix.isIdentity();
buffer.writeBool(hasLocalM);
if (hasLocalM) {
buffer.writeMatrix(fLocalMatrix);
@@ -68,13 +68,10 @@ void SkShader::flatten(SkWriteBuffer& buffer) const {
}
bool SkShader::computeTotalInverse(const ContextRec& rec, SkMatrix* totalInverse) const {
- const SkMatrix* m = rec.fMatrix;
- SkMatrix total;
+ SkMatrix total;
+ total.setConcat(*rec.fMatrix, fLocalMatrix);
- if (this->hasLocalMatrix()) {
- total.setConcat(*m, this->getLocalMatrix());
- m = &total;
- }
+ const SkMatrix* m = &total;
scroggo 2014/05/14 15:03:21 Is 'm' still necessary?
if (rec.fLocalMatrix) {
total.setConcat(*m, *rec.fLocalMatrix);
m = &total;
@@ -235,9 +232,9 @@ SkShader* SkShader::CreatePictureShader(SkPicture* src, TileMode tmx, TileMode t
#ifndef SK_IGNORE_TO_STRING
void SkShader::toString(SkString* str) const {
- if (this->hasLocalMatrix()) {
+ if (!fLocalMatrix.isIdentity()) {
str->append(" ");
- this->getLocalMatrix().toString(str);
+ fLocalMatrix.toString(str);
}
}
#endif
« no previous file with comments | « src/core/SkPictureShader.cpp ('k') | src/effects/SkRectShaderImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698