diff --git a/src/gpu/GrAARectRenderer.cpp b/src/gpu/GrAARectRenderer.cpp
index 0b593b9..883305e 100644
--- a/src/gpu/GrAARectRenderer.cpp
+++ b/src/gpu/GrAARectRenderer.cpp
@@ -364,7 +364,6 @@
                                           GrDrawTarget* target,
                                           const GrRect& rect,
                                           const SkMatrix& combinedMatrix,
-                                          const GrRect& devRect,
                                           bool useVertexCoverage) {
     GrDrawState* drawState = target->drawState();
 
@@ -389,6 +388,9 @@
     GrPoint* fan0Pos = reinterpret_cast<GrPoint*>(verts);
     GrPoint* fan1Pos = reinterpret_cast<GrPoint*>(verts + 4 * vsize);
 
+    SkRect devRect;
+    combinedMatrix.mapRect(&devRect, rect);
+
     if (combinedMatrix.rectStaysRect()) {
         set_inset_fan(fan0Pos, vsize, devRect, -SK_ScalarHalf, -SK_ScalarHalf);
         set_inset_fan(fan1Pos, vsize, devRect,  SK_ScalarHalf,  SK_ScalarHalf);
@@ -616,16 +618,20 @@
 
 void GrAARectRenderer::strokeAARect(GrGpu* gpu,
                                     GrDrawTarget* target,
-                                    const GrRect& devRect,
+                                    const GrRect& rect,
+                                    const SkMatrix& combinedMatrix,
                                     const GrVec& devStrokeSize,
                                     bool useVertexCoverage) {
     GrDrawState* drawState = target->drawState();
 
-    const SkScalar& dx = devStrokeSize.fX;
-    const SkScalar& dy = devStrokeSize.fY;
+    const SkScalar dx = devStrokeSize.fX;
+    const SkScalar dy = devStrokeSize.fY;
     const SkScalar rx = SkScalarMul(dx, SK_ScalarHalf);
     const SkScalar ry = SkScalarMul(dy, SK_ScalarHalf);
 
+    SkRect devRect;
+    combinedMatrix.mapRect(&devRect, rect);
+
     SkScalar spare;
     {
         SkScalar w = devRect.width() - dx;
@@ -634,9 +640,8 @@
     }
 
     if (spare <= 0) {
-        GrRect r(devRect);
-        r.inset(-rx, -ry);
-        this->fillAARect(gpu, target, r, SkMatrix::I(), r, useVertexCoverage);
+        devRect.inset(-rx, -ry);
+        this->fillAARect(gpu, target, devRect, SkMatrix::I(), useVertexCoverage);
         return;
     }
 
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index c022b34d..164e1f8 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -282,7 +282,6 @@
                                                               fGpu,
                                                               element->getRect(),
                                                               SkMatrix::I(),
-                                                              element->getRect(),
                                                               false);
             } else {
                 fGpu->drawSimpleRect(element->getRect(), NULL);
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index bde3320..679771e 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -680,20 +680,10 @@
     verts[9] = verts[1];
 }
 
-/**
- * Returns true if the rects edges are integer-aligned.
- */
-static bool isIRect(const GrRect& r) {
-    return SkScalarIsInt(r.fLeft) && SkScalarIsInt(r.fTop) &&
-           SkScalarIsInt(r.fRight) && SkScalarIsInt(r.fBottom);
-}
-
 static bool apply_aa_to_rect(GrDrawTarget* target,
-                             const GrRect& rect,
                              SkScalar strokeWidth,
                              const SkMatrix* matrix,
                              SkMatrix* combinedMatrix,
-                             GrRect* devRect,
                              bool* useVertexCoverage) {
     // we use a simple coverage ramp to do aa on axis-aligned rects
     // we check if the rect will be axis-aligned, and the rect won't land on
@@ -763,17 +753,7 @@
 #endif
     }
 
-    combinedMatrix->mapRect(devRect, rect);
-
-    if (strokeWidth < 0
-#if defined(SHADER_AA_FILL_RECT) || !defined(IGNORE_ROT_AA_RECT_OPT)
-        && drawState.getViewMatrix().preservesAxisAlignment()
-#endif
-        ) {
-        return !isIRect(*devRect);
-    } else {
-        return true;
-    }
+    return true;
 }
 
 void GrContext::drawRect(const GrPaint& paint,
@@ -785,13 +765,12 @@
     GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW);
     GrDrawState::AutoStageDisable atr(fDrawState);
 
-    GrRect devRect;
     SkMatrix combinedMatrix;
     bool useVertexCoverage;
     bool needAA = paint.isAntiAlias() &&
                   !this->getRenderTarget()->isMultisampled();
-    bool doAA = needAA && apply_aa_to_rect(target, rect, width, matrix,
-                                           &combinedMatrix, &devRect,
+    bool doAA = needAA && apply_aa_to_rect(target, width, matrix,
+                                           &combinedMatrix,
                                            &useVertexCoverage);
     if (doAA) {
         GrDrawState::AutoDeviceCoordDraw adcd(target->drawState());
@@ -807,12 +786,13 @@
             } else {
                 strokeSize.set(SK_Scalar1, SK_Scalar1);
             }
-            fAARectRenderer->strokeAARect(this->getGpu(), target, devRect,
+            fAARectRenderer->strokeAARect(this->getGpu(), target,
+                                          rect, combinedMatrix,
                                           strokeSize, useVertexCoverage);
         } else {
             // filled AA rect
             fAARectRenderer->fillAARect(this->getGpu(), target,
-                                        rect, combinedMatrix, devRect,
+                                        rect, combinedMatrix,
                                         useVertexCoverage);
         }
         return;
