diff options
author | 2011-09-12 13:52:51 +0000 | |
---|---|---|
committer | 2011-09-12 13:52:51 +0000 | |
commit | 4f83be8f865921b60e3326b3fed6d5bc8281b541 (patch) | |
tree | 541238eb9ac8d27761d65a4c2c3c9fc3792a2547 /gpu/include | |
parent | 383963280ddd13030331765fe88d2aefa3e32130 (diff) |
Fix GrContext::drawPaint with perspective, also never apply AA
Review URL: http://codereview.appspot.com/4969074/
git-svn-id: http://skia.googlecode.com/svn/trunk@2247 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gpu/include')
-rw-r--r-- | gpu/include/GrContext.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/gpu/include/GrContext.h b/gpu/include/GrContext.h index 3fe1a7b367..37ac1c4999 100644 --- a/gpu/include/GrContext.h +++ b/gpu/include/GrContext.h @@ -645,6 +645,7 @@ private: */ class GrAutoMatrix : GrNoncopyable { public: + GrAutoMatrix() : fContext(NULL) {} GrAutoMatrix(GrContext* ctx) : fContext(ctx) { fMatrix = ctx->getMatrix(); } @@ -652,8 +653,25 @@ public: fMatrix = ctx->getMatrix(); ctx->setMatrix(matrix); } + void set(GrContext* ctx) { + if (NULL != fContext) { + fContext->setMatrix(fMatrix); + } + fMatrix = ctx->getMatrix(); + fContext = ctx; + } + void set(GrContext* ctx, const GrMatrix& matrix) { + if (NULL != fContext) { + fContext->setMatrix(fMatrix); + } + fMatrix = ctx->getMatrix(); + ctx->setMatrix(matrix); + fContext = ctx; + } ~GrAutoMatrix() { - fContext->setMatrix(fMatrix); + if (NULL != fContext) { + fContext->setMatrix(fMatrix); + } } private: |