aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-04-11 17:58:48 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-04-11 17:58:48 +0000
commit5877ffd5ea71a3ea70096d5c11c843798defa690 (patch)
treee9c898ced0fdd91487cd265618db1be03f920844 /src
parentafac88855a31bea16143028f51935d00be177dc6 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/gpu/SkGpuDevice.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 2d50c3652d..4d3aa3a228 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1453,12 +1453,27 @@ SkGpuDeviceFactory::SkGpuDeviceFactory(GrContext* context,
rootRenderTarget->ref();
}
context->ref();
+ fRootTexture = NULL;
+}
+
+SkGpuDeviceFactory::SkGpuDeviceFactory(GrContext* context, GrTexture* rootRenderTargetTexture) {
+ GrAssert(NULL != context);
+ GrAssert(NULL != rootRenderTargetTexture);
+ GrAssert(NULL != rootRenderTargetTexture->asRenderTarget());
+ fRootTexture = rootRenderTargetTexture;
+ rootRenderTargetTexture->ref();
+
+ fRootRenderTarget = rootRenderTargetTexture->asRenderTarget();
+ fRootRenderTarget->ref();
+
+ context->ref();
}
SkGpuDeviceFactory::~SkGpuDeviceFactory() {
fContext->unref();
fRootRenderTarget->unref();
+ GrSafeUnref(fRootTexture);
}
SkDevice* SkGpuDeviceFactory::newDevice(SkCanvas*, SkBitmap::Config config,