4x4 SSAA with improvements in determination of when to apply. Still disabled at compile time.

Review URL: http://codereview.appspot.com/4445075/




git-svn-id: http://skia.googlecode.com/svn/trunk@1218 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/src/GrTexture.cpp b/gpu/src/GrTexture.cpp
index 1ea02a7..e9ec4e6 100644
--- a/gpu/src/GrTexture.cpp
+++ b/gpu/src/GrTexture.cpp
@@ -28,6 +28,28 @@
                                            config, buffer);
 }
 
+void GrRenderTarget::flagAsNeedingResolve(const GrIRect* rect) {
+    if (kCanResolve_ResolveType == getResolveType()) {
+        if (NULL != rect) {
+            fResolveRect.growToInclude(*rect);
+            fResolveRect.intersectWith(0, 0, this->width(), this->height());
+        } else {
+            fResolveRect.setLTRB(0, 0, this->width(), this->height());
+        }
+    }
+}
+
+void GrRenderTarget::overrideResolveRect(const GrIRect rect) {
+    fResolveRect = rect;
+    if (fResolveRect.isEmpty()) {
+        fResolveRect.setLargestInverted();
+    } else {
+        if (!fResolveRect.intersectWith(0, 0, this->width(), this->height())) {
+            fResolveRect.setLargestInverted();
+        }
+    }
+}
+
 bool GrTexture::readPixels(int left, int top, int width, int height,
                            GrPixelConfig config, void* buffer) {
     // go through context so that all necessary flushing occurs