summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-06 17:16:03 +0000
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-06 17:16:03 +0000
commitc7557fbeb626b286d27a1b46b93da5a030df12b3 (patch)
treebc7f117fd6a44db83a9f64d4632dcf9f77b00119
parentabc68a8eeb478a8123d4d283bab5088d0bb949f9 (diff)
downloadinclude-c7557fbeb626b286d27a1b46b93da5a030df12b3.tar.gz
add local-matrix to shader::context
BUG=skia: R=scroggo@google.com, dominikg@chromium.org Author: reed@google.com Review URL: https://codereview.chromium.org/263293005 git-svn-id: http://skia.googlecode.com/svn/trunk/include@14592 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--core/SkShader.h29
1 files changed, 15 insertions, 14 deletions
diff --git a/core/SkShader.h b/core/SkShader.h
index 0417306..dc93b84 100644
--- a/core/SkShader.h
+++ b/core/SkShader.h
@@ -123,17 +123,17 @@ public:
* ContextRec acts as a parameter bundle for creating Contexts.
*/
struct ContextRec {
- ContextRec() : fDevice(NULL), fPaint(NULL), fMatrix(NULL) {}
- ContextRec(const ContextRec& other)
- : fDevice(other.fDevice), fPaint(other.fPaint), fMatrix(other.fMatrix) {}
+ ContextRec() : fDevice(NULL), fPaint(NULL), fMatrix(NULL), fLocalMatrix(NULL) {}
ContextRec(const SkBitmap& device, const SkPaint& paint, const SkMatrix& matrix)
: fDevice(&device)
, fPaint(&paint)
- , fMatrix(&matrix) {}
+ , fMatrix(&matrix)
+ , fLocalMatrix(NULL) {}
- const SkBitmap* fDevice; // the bitmap we are drawing into
- const SkPaint* fPaint; // the current paint associated with the draw
- const SkMatrix* fMatrix; // the current matrix in the canvas
+ const SkBitmap* fDevice; // the bitmap we are drawing into
+ const SkPaint* fPaint; // the current paint associated with the draw
+ const SkMatrix* fMatrix; // the current matrix in the canvas
+ const SkMatrix* fLocalMatrix; // optional local matrix
};
class Context : public ::SkNoncopyable {
@@ -200,14 +200,15 @@ public:
};
static MatrixClass ComputeMatrixClass(const SkMatrix&);
- uint8_t getPaintAlpha() const { return fPaintAlpha; }
- const SkMatrix& getTotalInverse() const { return fTotalInverse; }
- MatrixClass getInverseClass() const { return (MatrixClass)fTotalInverseClass; }
-
+ uint8_t getPaintAlpha() const { return fPaintAlpha; }
+ const SkMatrix& getTotalInverse() const { return fTotalInverse; }
+ MatrixClass getInverseClass() const { return (MatrixClass)fTotalInverseClass; }
+ const SkMatrix& getCTM() const { return fCTM; }
private:
- SkMatrix fTotalInverse;
- uint8_t fPaintAlpha;
- uint8_t fTotalInverseClass;
+ SkMatrix fCTM;
+ SkMatrix fTotalInverse;
+ uint8_t fPaintAlpha;
+ uint8_t fTotalInverseClass;
typedef SkNoncopyable INHERITED;
};