diff options
author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-02-01 19:12:40 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-02-01 19:12:40 +0000 |
commit | 6f7fbc9fbb584b9b9fa6ed3a677d71ecd49aafce (patch) | |
tree | 4c5cc5e7e00780b179bfd3995eb6f2cfc64797df /gpu/src/GrDrawTarget.cpp | |
parent | fb697e7a37adf34cbafaedb94cc373e7b6d1fa57 (diff) |
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
Diffstat (limited to 'gpu/src/GrDrawTarget.cpp')
-rw-r--r-- | gpu/src/GrDrawTarget.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
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; } |