From 0736f3386820f19c0fe90b5dda2094e253780071 Mon Sep 17 00:00:00 2001 From: ericrk Date: Tue, 3 May 2016 17:14:07 -0700 Subject: Allow stencils to be attached to render targets created via SkSurface::MakeFromBackendTextureAsRenderTarget This is a regression from "Refactor to separate backend object lifecycle and GpuResource budget decision". GrGLRenderer::canAttemptStencilAttachment was incorrectly returning false for all wrapped render targets. This function should return false only if the FBO is wrapped (unowned). If the FBO is owned by Skia, we can attach stencils. BUG=608238 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1924183003 Review-Url: https://codereview.chromium.org/1941353003 --- src/gpu/gl/GrGLRenderTarget.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/gpu/gl/GrGLRenderTarget.cpp') diff --git a/src/gpu/gl/GrGLRenderTarget.cpp b/src/gpu/gl/GrGLRenderTarget.cpp index 3c27535825..026c46bd5f 100644 --- a/src/gpu/gl/GrGLRenderTarget.cpp +++ b/src/gpu/gl/GrGLRenderTarget.cpp @@ -159,10 +159,8 @@ GrGLGpu* GrGLRenderTarget::getGLGpu() const { } bool GrGLRenderTarget::canAttemptStencilAttachment() const { - // When we have not created the FBO ID we do not attempt to modify its attachments. - // Direct GrGLRenderTarget instances are always created with CreateWrapped. - SkASSERT(this->resourcePriv().refsWrappedObjects()); - return false; + // Only modify the FBO's attachments if we have created the FBO. + return this->fRTFBOOwnership == GrBackendObjectOwnership::kOwned; } void GrGLRenderTarget::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { -- cgit v1.2.3