Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(901)

Unified Diff: src/gpu/vk/GrVkGpu.cpp

Issue 2448593002: Remove SkAutoTUnref and SkAutoTDelete from public includes. (Closed)
Patch Set: And Vulcan. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/vk/GrVkGpu.h ('k') | src/gpu/vk/GrVkRenderTarget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkGpu.cpp
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index b13e16282e808b53a10c3081541f64085af79fc6..7d75921c238419e96b27ceb3b893f55f793ecf98 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;
}
}
« no previous file with comments | « src/gpu/vk/GrVkGpu.h ('k') | src/gpu/vk/GrVkRenderTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698