aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLGpu.cpp
diff options
context:
space:
mode:
authorGravatar benjaminwagner <benjaminwagner@google.com>2016-04-29 11:17:07 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-29 11:17:08 -0700
commit817fed3cb7d88e2b40b4c7cf887f34911aa79495 (patch)
tree1f467fa7cfadd065e2a1f0a1265e59d5fae35d07 /src/gpu/gl/GrGLGpu.cpp
parenta2ffa98323a17036c6df018127e3723099458a93 (diff)
Revert of Make stencils be attachable to render targets created via SkSurface::MakeFromBackendTextureAsRender… (patchset #5 id:80001 of https://codereview.chromium.org/1924183003/ )
Reason for revert: Breaking the DEPS roll. Also seems to be causing failure in DM on some Windows bots: c:\0\build\slave\workdir\build\skia\tests\surfacetest.cpp:963 kShapeColor == bitmap.getColor(kW / 2, kH / 2) 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. > > The test contains disabled code. The > MakeFromBackendTextureAsRenderTarget does not copy the existing texture > contents to the FBO render buffer. > 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 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 Review-Url: https://codereview.chromium.org/1931293003
Diffstat (limited to 'src/gpu/gl/GrGLGpu.cpp')
-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 7eb833c880..2fe9c023b2 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);
}
////////////////////////////////////////////////////////////////////////////////