Add APIs and plumbing for external rendertaret-textures w/ and w/out MSAA.

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



git-svn-id: http://skia.googlecode.com/svn/trunk@1102 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/src/GrGpu.cpp b/gpu/src/GrGpu.cpp
index 4aaed79..2407cdf 100644
--- a/gpu/src/GrGpu.cpp
+++ b/gpu/src/GrGpu.cpp
@@ -158,6 +158,11 @@
     return this->createRenderTargetFrom3DApiStateHelper();
 }
 
+GrResource* GrGpu::createPlatformSurface(const GrPlatformSurfaceDesc& desc) {
+    this->handleDirtyContext();
+    return this->onCreatePlatformSurface(desc);
+}
+
 GrVertexBuffer* GrGpu::createVertexBuffer(uint32_t size, bool dynamic) {
     this->handleDirtyContext();
     return this->createVertexBufferHelper(size, dynamic);
@@ -183,12 +188,7 @@
                        GrPixelConfig config, void* buffer) {
 
     this->handleDirtyContext();
-    GrRenderTarget* prevTarget = fCurrDrawState.fRenderTarget;
-    if (NULL != target) {
-        fCurrDrawState.fRenderTarget = target;
-    }
-    return this->readPixelsHelper(left, top, width, height, config, buffer);
-    fCurrDrawState.fRenderTarget = prevTarget;
+    return this->onReadPixels(target, left, top, width, height, config, buffer);
 }
 
 ////////////////////////////////////////////////////////////////////////////////