Remove notion of default rendertarget. This doesn't map well to usage patterns outside sample app. Make binding between SkGpuDevice and a GrRenderTarget more explicit. Create method on GrContext to wrap the current target in the 3D API with a GrRenderTarget.
git-svn-id: http://skia.googlecode.com/svn/trunk@706 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/include/GrGpu.h b/gpu/include/GrGpu.h
index f1fdf01..6cbe53e 100644
--- a/gpu/include/GrGpu.h
+++ b/gpu/include/GrGpu.h
@@ -197,6 +197,17 @@
int width, int height) = 0;
/**
+ * Reads the current target object (e.g. FBO or IDirect3DSurface9*) and
+ * viewport state from the underlying 3D API and wraps it in a
+ * GrRenderTarget. The GrRenderTarget will not attempt to delete/destroy the
+ * underlying object in its destructor and it is up to caller to guarantee
+ * that it remains valid while the GrRenderTarget is used.
+ *
+ * @return the newly created GrRenderTarget
+ */
+ virtual GrRenderTarget* createRenderTargetFrom3DApiState() = 0;
+
+ /**
* Creates a vertex buffer.
*
* @param size size in bytes of the vertex buffer
@@ -221,21 +232,6 @@
virtual GrIndexBuffer* createIndexBuffer(uint32_t size, bool dynamic) = 0;
/**
- * Gets the default render target. This is the render target set in the
- * 3D API at the time the GrGpu was created.
- */
- virtual GrRenderTarget* defaultRenderTarget() = 0;
-
- /**
- * At construction time the GrGpu infers the render target and viewport from
- * the state of the underlying 3D API. However, a platform-specific resize
- * event may occur.
- * @param width new width of the default rendertarget
- * @param height new height of the default rendertarget
- */
- virtual void setDefaultRenderTargetSize(uint32_t width, uint32_t height) = 0;
-
- /**
* Erase the entire render target, ignoring any clips/scissors.
*
* This is issued to the GPU driver immediately.