diff options
author | 2012-10-31 18:09:01 +0000 | |
---|---|---|
committer | 2012-10-31 18:09:01 +0000 | |
commit | f94b3a4cebd4adab09c40ebe23c02a615e10c394 (patch) | |
tree | a611a0cb0e1db232fbe5a1af0312eea05428dce1 /include/core | |
parent | c1f6db86dcf478d3c067bfc3fd99174b23d81732 (diff) |
Make SkShader store localM directly rather than as a separate alloc.
May cause very slight GM changes in gpu two pt radial/conical radients.
Review URL: https://codereview.appspot.com/6821056
git-svn-id: http://skia.googlecode.com/svn/trunk@6221 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkShader.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/include/core/SkShader.h b/include/core/SkShader.h index 90d831710c..1286177271 100644 --- a/include/core/SkShader.h +++ b/include/core/SkShader.h @@ -39,22 +39,25 @@ public: virtual ~SkShader(); /** - * Return true if the shader has a non-identity local matrix. - * @param localM Optional: If not null, return the shader's local matrix - * @return true if the shader has a non-identity local matrix. + * Returns true if the local matrix is not an identity matrix. */ - bool getLocalMatrix(SkMatrix* localM) const; + bool hasLocalMatrix() const { return !fLocalMatrix.isIdentity(); } + + /** + * Returns the local matrix. + */ + const SkMatrix& getLocalMatrix() const { return fLocalMatrix; } /** * Set the shader's local matrix. * @param localM The shader's new local matrix. */ - void setLocalMatrix(const SkMatrix& localM); + void setLocalMatrix(const SkMatrix& localM) { fLocalMatrix = localM; } /** * Reset the shader's local matrix to identity. */ - void resetLocalMatrix(); + void resetLocalMatrix() { fLocalMatrix.reset(); } enum TileMode { /** replicate the edge color if the shader draws outside of its @@ -347,7 +350,7 @@ protected: SkShader(SkFlattenableReadBuffer& ); virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; private: - SkMatrix* fLocalMatrix; + SkMatrix fLocalMatrix; SkMatrix fTotalInverse; uint8_t fPaintAlpha; uint8_t fDeviceConfig; |