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

Unified Diff: src/gpu/gl/GrGLGpu.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/gl/GrGLGpu.h ('k') | src/gpu/gl/GrGLRenderTarget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLGpu.cpp
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 4e579cc5435da6ba4e5588cf3fb3e422b377aaf1..485a9bd09a77242af65035fa1cac887cbe8dfcc7 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -624,8 +624,8 @@ static GrSurfaceOrigin resolve_origin(GrSurfaceOrigin origin, bool renderTarget)
}
}
-GrTexture* GrGLGpu::onWrapBackendTexture(const GrBackendTextureDesc& desc,
- GrWrapOwnership ownership) {
+sk_sp<GrTexture> GrGLGpu::onWrapBackendTexture(const GrBackendTextureDesc& desc,
+ GrWrapOwnership ownership) {
const GrGLTextureInfo* info = reinterpret_cast<const GrGLTextureInfo*>(desc.fTextureHandle);
if (!info || !info->fID) {
return nullptr;
@@ -681,25 +681,18 @@ GrTexture* GrGLGpu::onWrapBackendTexture(const GrBackendTextureDesc& desc,
surfDesc.fOrigin = desc.fOrigin;
}
- GrGLTexture* texture = nullptr;
if (renderTarget) {
GrGLRenderTarget::IDDesc rtIDDesc;
if (!this->createRenderTargetObjects(surfDesc, idDesc.fInfo, &rtIDDesc)) {
return nullptr;
}
- texture = GrGLTextureRenderTarget::CreateWrapped(this, surfDesc, idDesc, rtIDDesc);
- } else {
- texture = GrGLTexture::CreateWrapped(this, surfDesc, idDesc);
- }
- if (nullptr == texture) {
- return nullptr;
+ return GrGLTextureRenderTarget::MakeWrapped(this, surfDesc, idDesc, rtIDDesc);
}
-
- return texture;
+ return GrGLTexture::MakeWrapped(this, surfDesc, idDesc);
}
-GrRenderTarget* GrGLGpu::onWrapBackendRenderTarget(const GrBackendRenderTargetDesc& wrapDesc,
- GrWrapOwnership ownership) {
+sk_sp<GrRenderTarget> GrGLGpu::onWrapBackendRenderTarget(const GrBackendRenderTargetDesc& wrapDesc,
+ GrWrapOwnership ownership) {
GrGLRenderTarget::IDDesc idDesc;
idDesc.fRTFBOID = static_cast<GrGLuint>(wrapDesc.fRenderTargetHandle);
idDesc.fMSColorRenderbufferID = 0;
@@ -719,10 +712,10 @@ GrRenderTarget* GrGLGpu::onWrapBackendRenderTarget(const GrBackendRenderTargetDe
desc.fSampleCnt = SkTMin(wrapDesc.fSampleCnt, this->caps()->maxSampleCount());
desc.fOrigin = resolve_origin(wrapDesc.fOrigin, true);
- return GrGLRenderTarget::CreateWrapped(this, desc, idDesc, wrapDesc.fStencilBits);
+ return GrGLRenderTarget::MakeWrapped(this, desc, idDesc, wrapDesc.fStencilBits);
}
-GrRenderTarget* GrGLGpu::onWrapBackendTextureAsRenderTarget(const GrBackendTextureDesc& desc) {
+sk_sp<GrRenderTarget> GrGLGpu::onWrapBackendTextureAsRenderTarget(const GrBackendTextureDesc& desc){
const GrGLTextureInfo* info = reinterpret_cast<const GrGLTextureInfo*>(desc.fTextureHandle);
if (!info || !info->fID) {
return nullptr;
@@ -759,7 +752,7 @@ GrRenderTarget* GrGLGpu::onWrapBackendTextureAsRenderTarget(const GrBackendTextu
if (!this->createRenderTargetObjects(surfDesc, texInfo, &rtIDDesc)) {
return nullptr;
}
- return GrGLRenderTarget::CreateWrapped(this, surfDesc, rtIDDesc, 0);
+ return GrGLRenderTarget::MakeWrapped(this, surfDesc, rtIDDesc, 0);
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « src/gpu/gl/GrGLGpu.h ('k') | src/gpu/gl/GrGLRenderTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698