aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-28 19:18:12 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-28 19:18:12 +0000
commit123ac1d4eab757052407064623643fdc59f85363 (patch)
treefb5c869b92981d4a8dbfc65faf5cf8b15700aacd /include/gpu
parentce89a19dd676cdc4300bd1bf1a1e98ce823f0ac0 (diff)
Make GM render to render targets that are also textures.
Review URL: https://codereview.chromium.org/13211002 git-svn-id: http://skia.googlecode.com/svn/trunk@8438 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/gpu')
-rw-r--r--include/gpu/SkGpuDevice.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/gpu/SkGpuDevice.h b/include/gpu/SkGpuDevice.h
index a6087c88b8..8aa7d4aac8 100644
--- a/include/gpu/SkGpuDevice.h
+++ b/include/gpu/SkGpuDevice.h
@@ -27,16 +27,24 @@ class GrTextContext;
*/
class SK_API SkGpuDevice : public SkDevice {
public:
+
+ /**
+ * Creates an SkGpuDevice from a GrSurface. This will fail if the surface is not a render
+ * target. The caller owns a ref on the returned device.
+ */
+ static SkGpuDevice* Create(GrSurface* surface);
+
/**
* New device that will create an offscreen renderTarget based on the
* config, width, height, and sampleCount. The device's storage will not
* count against the GrContext's texture cache budget. The device's pixels
- * will be uninitialized.
+ * will be uninitialized. TODO: This can fail, replace with a factory function.
*/
SkGpuDevice(GrContext*, SkBitmap::Config, int width, int height, int sampleCount = 0);
/**
* New device that will render to the specified renderTarget.
+ * DEPRECATED: Use Create(surface)
*/
SkGpuDevice(GrContext*, GrRenderTarget*);
@@ -44,6 +52,7 @@ public:
* New device that will render to the texture (as a rendertarget).
* The GrTexture's asRenderTarget() must be non-NULL or device will not
* function.
+ * DEPRECATED: Use Create(surface)
*/
SkGpuDevice(GrContext*, GrTexture*);