From 6f7fbc9fbb584b9b9fa6ed3a677d71ecd49aafce Mon Sep 17 00:00:00 2001 From: "bsalomon@google.com" Date: Tue, 1 Feb 2011 19:12:40 +0000 Subject: Adds ability to draw rects using a unit square vertex buffer. Useful when matrix/uniform changes are less expensive than sending new verts. Adds optional matrix parameters to GrContext drawRect and drawRectToRect so that non-axis-aligned matrices can be drawn using these functions. codereview Issue 4105049 git-svn-id: http://skia.googlecode.com/svn/trunk@749 2bbb7eff-a529-9590-31e7-b0007b416f81 --- gpu/src/GrDrawTarget.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gpu/src/GrDrawTarget.cpp') diff --git a/gpu/src/GrDrawTarget.cpp b/gpu/src/GrDrawTarget.cpp index 0101ecd685..96afe2f8ed 100644 --- a/gpu/src/GrDrawTarget.cpp +++ b/gpu/src/GrDrawTarget.cpp @@ -358,6 +358,16 @@ void GrDrawTarget::setTextureMatrix(int stage, const GrMatrix& m) { fCurrDrawState.fTextureMatrices[stage] = m; } +void GrDrawTarget::concatTextureMatrix(int stage, const GrMatrix& m) { + GrAssert(stage >= 0 && stage < kNumStages); + fCurrDrawState.fTextureMatrices[stage].preConcat(m); +} + +const GrMatrix& GrDrawTarget::getTextureMatrix(int stage) const { + GrAssert(stage >= 0 && stage < kNumStages); + return fCurrDrawState.fTextureMatrices[stage]; +} + void GrDrawTarget::setStencilPass(StencilPass pass) { fCurrDrawState.fStencilPass = pass; } -- cgit v1.2.3