From 4f83be8f865921b60e3326b3fed6d5bc8281b541 Mon Sep 17 00:00:00 2001 From: "bsalomon@google.com" Date: Mon, 12 Sep 2011 13:52:51 +0000 Subject: 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 --- gpu/include/GrContext.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'gpu/include') 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: -- cgit v1.2.3