aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar jvanverth <jvanverth@google.com>2016-05-03 05:37:45 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-05-03 05:37:46 -0700
commitdb1adf59890dfd50212ac217eaa2d04e70c0d37c (patch)
tree70eb7547f0c6802844c95c73c6a4e04f0016faf6 /src/gpu
parentde5bf0cfeca908b81a28cc50065f7bc2da3d2fd1 (diff)
Revert of Make stencils be attachable to render targets created via SkSurface::MakeFromBackendTextureAsRender… (patchset #9 id:150001 of https://codereview.chromium.org/1924183003/ )
Reason for revert: Appears to be breaking the roll. Original issue's description: > Make stencils be attachable to render targets created via SkSurface::MakeFromBackendTextureAsRenderTarget > > This is a regression from "Refactor to separate backend object lifecycle > and GpuResource budget decision". > > GrGLRenderTarget::CreateWrapped creates only render targets that wrap > the FBO. > GrGLRenderTargetTexture::CreateWrapped creates render targets that > wrap the texture. > > Use the latter as the implementation for > SkSurface::MakeFromBackendTextureAsRenderTarget. > > > BUG=608238 > > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1924183003 > > Committed: https://skia.googlesource.com/skia/+/fe635fd76bbc375d527d1884af23cc617ca364ee > > Committed: https://skia.googlesource.com/skia/+/1cb00e42bff455e23f6883bf09680438fa631224 TBR=bsalomon@google.com,kkinnunen@nvidia.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=608238 Review-Url: https://codereview.chromium.org/1943843002
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/gl/GrGLGpu.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index d24734fa57..027d9527c0 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -723,20 +723,19 @@ GrRenderTarget* GrGLGpu::onWrapBackendTextureAsRenderTarget(const GrBackendTextu
}
#endif
- GrGLTexture::IDDesc idDesc;
- idDesc.fOwnership = GrBackendObjectOwnership::kBorrowed;
+ GrGLTextureInfo texInfo;
GrSurfaceDesc surfDesc;
#ifdef SK_IGNORE_GL_TEXTURE_TARGET
- idDesc.fInfo.fID = static_cast<GrGLuint>(desc.fTextureHandle);
+ texInfo.fID = static_cast<GrGLuint>(desc.fTextureHandle);
// We only support GL_TEXTURE_2D at the moment.
- idDesc.fInfo.fTarget = GR_GL_TEXTURE_2D;
+ texInfo.fTarget = GR_GL_TEXTURE_2D;
#else
- idDesc.fInfo = *info;
+ texInfo = *info;
#endif
- if (GR_GL_TEXTURE_RECTANGLE != idDesc.fInfo.fTarget &&
- GR_GL_TEXTURE_2D != idDesc.fInfo.fTarget) {
+ if (GR_GL_TEXTURE_RECTANGLE != texInfo.fTarget &&
+ GR_GL_TEXTURE_2D != texInfo.fTarget) {
// Only texture rectangle and texture 2d are supported. We do not check whether texture
// rectangle is supported by Skia - if the caller provided us with a texture rectangle,
// we assume the necessary support exists.
@@ -759,10 +758,10 @@ GrRenderTarget* GrGLGpu::onWrapBackendTextureAsRenderTarget(const GrBackendTextu
}
GrGLRenderTarget::IDDesc rtIDDesc;
- if (!this->createRenderTargetObjects(surfDesc, idDesc.fInfo, &rtIDDesc)) {
+ if (!this->createRenderTargetObjects(surfDesc, texInfo, &rtIDDesc)) {
return nullptr;
}
- return GrGLTextureRenderTarget::CreateWrapped(this, surfDesc, idDesc, rtIDDesc);
+ return GrGLRenderTarget::CreateWrapped(this, surfDesc, rtIDDesc, 0);
}
////////////////////////////////////////////////////////////////////////////////