Add GrRenderTexture cons for gpu dev. Remove factory from gpu device.
Review URL: http://codereview.appspot.com/4631046/
git-svn-id: http://skia.googlecode.com/svn/trunk@1634 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/gpu/SkGpuDevice.h b/include/gpu/SkGpuDevice.h
index 3a675be..afb1459 100644
--- a/include/gpu/SkGpuDevice.h
+++ b/include/gpu/SkGpuDevice.h
@@ -50,6 +50,13 @@
SkGpuDevice(GrContext*, GrRenderTarget*);
/**
+ * New device that will render to the texture (as a rendertarget).
+ * The GrTexture's asRenderTarget() must be non-NULL or device will not
+ * function.
+ */
+ SkGpuDevice(GrContext*, GrTexture*);
+
+ /**
* Magic value that can be passed to constructor. Causes
* the device to infer rendertarget from underlying 3D API (e.g. GL or D3D).
* This isn't a valid pointer, don't attempt to dereference.
@@ -129,8 +136,6 @@
virtual void makeRenderTargetCurrent();
protected:
- // override
- virtual SkDeviceFactory* onNewDeviceFactory();
class TexCache;
enum TexType {
@@ -173,6 +178,9 @@
bool fNeedClear;
bool fNeedPrepareRenderTarget;
+ // called from rt and tex cons
+ void initFromRenderTarget(GrContext*, GrRenderTarget*);
+
// doesn't set the texture/sampler/matrix state
// caller needs to null out GrPaint's texture if
// non-textured drawing is desired.