| 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);
|
| }
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
|
|