aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpu.cpp
diff options
context:
space:
mode:
authorGravatar bungeman <bungeman@google.com>2016-10-27 09:30:08 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-10-27 09:30:08 -0700
commit6bd5284415bd983b0628c4941dff5def40018f5a (patch)
tree7de7e45431f76db69807204ecdce3ed6fcc4d9e8 /src/gpu/GrGpu.cpp
parent56380524d903f27627a75e2e1189463999725008 (diff)
Remove SkAutoTUnref and SkAutoTDelete from public includes.
This also makes the required changed to src, tests, and tools. The few public APIs modified by this change appear to be unused outside of Skia. Removing these from the public API makes it easier to ensure users are no longer using them. This also updates GrGpu::wrapBackendXXX and the ::onWrapBackendXXX methods to clarify ownership. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2448593002 Review-Url: https://codereview.chromium.org/2448593002
Diffstat (limited to 'src/gpu/GrGpu.cpp')
-rw-r--r--src/gpu/GrGpu.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 0de9fedb8c..f576424889 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -190,7 +190,8 @@ GrTexture* GrGpu::createTexture(const GrSurfaceDesc& origDesc, SkBudgeted budget
return tex;
}
-GrTexture* GrGpu::wrapBackendTexture(const GrBackendTextureDesc& desc, GrWrapOwnership ownership) {
+sk_sp<GrTexture> GrGpu::wrapBackendTexture(const GrBackendTextureDesc& desc,
+ GrWrapOwnership ownership) {
this->handleDirtyContext();
if (!this->caps()->isConfigTexturable(desc.fConfig)) {
return nullptr;
@@ -203,22 +204,20 @@ GrTexture* GrGpu::wrapBackendTexture(const GrBackendTextureDesc& desc, GrWrapOwn
if (desc.fWidth > maxSize || desc.fHeight > maxSize) {
return nullptr;
}
- GrTexture* tex = this->onWrapBackendTexture(desc, ownership);
- if (nullptr == tex) {
+ sk_sp<GrTexture> tex = this->onWrapBackendTexture(desc, ownership);
+ if (!tex) {
return nullptr;
}
// TODO: defer this and attach dynamically
GrRenderTarget* tgt = tex->asRenderTarget();
if (tgt && !fContext->resourceProvider()->attachStencilAttachment(tgt)) {
- tex->unref();
return nullptr;
- } else {
- return tex;
}
+ return tex;
}
-GrRenderTarget* GrGpu::wrapBackendRenderTarget(const GrBackendRenderTargetDesc& desc,
- GrWrapOwnership ownership) {
+sk_sp<GrRenderTarget> GrGpu::wrapBackendRenderTarget(const GrBackendRenderTargetDesc& desc,
+ GrWrapOwnership ownership) {
if (!this->caps()->isConfigRenderable(desc.fConfig, desc.fSampleCnt > 0)) {
return nullptr;
}
@@ -226,7 +225,7 @@ GrRenderTarget* GrGpu::wrapBackendRenderTarget(const GrBackendRenderTargetDesc&
return this->onWrapBackendRenderTarget(desc, ownership);
}
-GrRenderTarget* GrGpu::wrapBackendTextureAsRenderTarget(const GrBackendTextureDesc& desc) {
+sk_sp<GrRenderTarget> GrGpu::wrapBackendTextureAsRenderTarget(const GrBackendTextureDesc& desc) {
this->handleDirtyContext();
if (!(desc.fFlags & kRenderTarget_GrBackendTextureFlag)) {
return nullptr;