diff options
author | bungeman <bungeman@google.com> | 2016-10-27 09:30:08 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-10-27 09:30:08 -0700 |
commit | 6bd5284415bd983b0628c4941dff5def40018f5a (patch) | |
tree | 7de7e45431f76db69807204ecdce3ed6fcc4d9e8 /src/gpu/vk/GrVkGpu.cpp | |
parent | 56380524d903f27627a75e2e1189463999725008 (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/vk/GrVkGpu.cpp')
-rw-r--r-- | src/gpu/vk/GrVkGpu.cpp | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp index b13e16282e..7d75921c23 100644 --- a/src/gpu/vk/GrVkGpu.cpp +++ b/src/gpu/vk/GrVkGpu.cpp @@ -756,8 +756,8 @@ static GrSurfaceOrigin resolve_origin(GrSurfaceOrigin origin) { } } -GrTexture* GrVkGpu::onWrapBackendTexture(const GrBackendTextureDesc& desc, - GrWrapOwnership ownership) { +sk_sp<GrTexture> GrVkGpu::onWrapBackendTexture(const GrBackendTextureDesc& desc, + GrWrapOwnership ownership) { if (0 == desc.fTextureHandle) { return nullptr; } @@ -791,22 +791,14 @@ GrTexture* GrVkGpu::onWrapBackendTexture(const GrBackendTextureDesc& desc, // In VK, we don't have this restriction surfDesc.fOrigin = resolve_origin(desc.fOrigin); - GrVkTexture* texture = nullptr; - if (renderTarget) { - texture = GrVkTextureRenderTarget::CreateWrappedTextureRenderTarget(this, surfDesc, - ownership, info); - } else { - texture = GrVkTexture::CreateWrappedTexture(this, surfDesc, ownership, info); + if (!renderTarget) { + return GrVkTexture::MakeWrappedTexture(this, surfDesc, ownership, info); } - if (!texture) { - return nullptr; - } - - return texture; + return GrVkTextureRenderTarget::MakeWrappedTextureRenderTarget(this, surfDesc, ownership, info); } -GrRenderTarget* GrVkGpu::onWrapBackendRenderTarget(const GrBackendRenderTargetDesc& wrapDesc, - GrWrapOwnership ownership) { +sk_sp<GrRenderTarget> GrVkGpu::onWrapBackendRenderTarget(const GrBackendRenderTargetDesc& wrapDesc, + GrWrapOwnership ownership) { const GrVkImageInfo* info = reinterpret_cast<const GrVkImageInfo*>(wrapDesc.fRenderTargetHandle); @@ -824,12 +816,10 @@ GrRenderTarget* GrVkGpu::onWrapBackendRenderTarget(const GrBackendRenderTargetDe desc.fOrigin = resolve_origin(wrapDesc.fOrigin); - GrVkRenderTarget* tgt = GrVkRenderTarget::CreateWrappedRenderTarget(this, desc, - ownership, - info); + sk_sp<GrVkRenderTarget> tgt = GrVkRenderTarget::MakeWrappedRenderTarget(this, desc, + ownership, info); if (tgt && wrapDesc.fStencilBits) { - if (!createStencilAttachmentForRenderTarget(tgt, desc.fWidth, desc.fHeight)) { - tgt->unref(); + if (!createStencilAttachmentForRenderTarget(tgt.get(), desc.fWidth, desc.fHeight)) { return nullptr; } } |