diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 15 |
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, |