From ff5cbecd34a807ce9b589e505754ed0d10247e6f Mon Sep 17 00:00:00 2001 From: Daniel Varga Date: Sat, 15 Jun 2019 04:18:28 +0300 Subject: [PATCH] Backed out changeset d75e4cb5b188 (bug 1546192) for build bustage at /builds/worker/workspace/build/src/gfx/gl/GLScreenBuffer.cpp. On a CLOSED TREE --- gfx/gl/GLScreenBuffer.cpp | 7 ++----- gfx/gl/SharedSurface.cpp | 21 ++++++++------------- gfx/gl/SharedSurface.h | 2 +- gfx/layers/client/CanvasClient.cpp | 6 +----- 4 files changed, 12 insertions(+), 24 deletions(-) diff --git a/gfx/gl/GLScreenBuffer.cpp b/gfx/gl/GLScreenBuffer.cpp index 509999ffc0cb..35f58cb54479 100644 --- a/gfx/gl/GLScreenBuffer.cpp +++ b/gfx/gl/GLScreenBuffer.cpp @@ -477,9 +477,7 @@ bool GLScreenBuffer::Swap(const gfx::IntSize& size) { GLContext::LocalErrorScope errorScope(*mGL); #endif - if (!SharedSurface::ProdCopy(src, dest, mFactory.get())) { - ret = false; - } + SharedSurface::ProdCopy(src, dest, mFactory.get()); #ifdef DEBUG MOZ_ASSERT(!errorScope.GetError()); @@ -498,7 +496,7 @@ bool GLScreenBuffer::Swap(const gfx::IntSize& size) { mFront->Surf()->ProducerRelease(); } - return ret; + return true; } bool GLScreenBuffer::PublishFrame(const gfx::IntSize& size) { @@ -517,7 +515,6 @@ bool GLScreenBuffer::Resize(const gfx::IntSize& size) { if (mBack) mBack->Surf()->ProducerRelease(); mBack = newBack; - bool ret = true; mBack->Surf()->ProducerAcquire(); diff --git a/gfx/gl/SharedSurface.cpp b/gfx/gl/SharedSurface.cpp index 35d134742ecc..5329e7a677ee 100644 --- a/gfx/gl/SharedSurface.cpp +++ b/gfx/gl/SharedSurface.cpp @@ -13,7 +13,6 @@ #include "nsThreadUtils.h" #include "ScopedGLHelpers.h" #include "SharedSurfaceGL.h" -#include "mozilla/gfx/Logging.h" #include "mozilla/layers/CompositorTypes.h" #include "mozilla/layers/TextureClientSharedSurface.h" #include "mozilla/layers/TextureForwarder.h" @@ -24,7 +23,7 @@ namespace mozilla { namespace gl { /*static*/ -bool SharedSurface::ProdCopy(SharedSurface* src, SharedSurface* dest, +void SharedSurface::ProdCopy(SharedSurface* src, SharedSurface* dest, SurfaceFactory* factory) { GLContext* gl = src->mGL; @@ -40,14 +39,10 @@ bool SharedSurface::ProdCopy(SharedSurface* src, SharedSurface* dest, UniquePtr tempSurf; tempSurf = SharedSurface_Basic::Create(gl, factory->mFormats, src->mSize, factory->mCaps.alpha); - if (!tempSurf) { - gfxCriticalNote << "Failed to allocate SharedSurface_Basic."; - return false; - } ProdCopy(src, tempSurf.get(), factory); ProdCopy(tempSurf.get(), dest, factory); - return true; + return; } if (src->mAttachType == AttachmentType::Screen) { @@ -86,7 +81,7 @@ bool SharedSurface::ProdCopy(SharedSurface* src, SharedSurface* dest, if (origNeedsRelock) origLocked->LockProd(); - return true; + return; } if (dest->mAttachType == AttachmentType::Screen) { @@ -125,7 +120,7 @@ bool SharedSurface::ProdCopy(SharedSurface* src, SharedSurface* dest, if (origNeedsRelock) origLocked->LockProd(); - return true; + return; } // Alright, done with cases involving Screen types. @@ -142,7 +137,7 @@ bool SharedSurface::ProdCopy(SharedSurface* src, SharedSurface* dest, gl->BlitHelper()->BlitTextureToTexture( srcTex, destTex, src->mSize, dest->mSize, srcTarget, destTarget); - return true; + return; } if (dest->mAttachType == AttachmentType::GLRenderbuffer) { @@ -152,7 +147,7 @@ bool SharedSurface::ProdCopy(SharedSurface* src, SharedSurface* dest, gl->BlitHelper()->BlitTextureToFramebuffer(srcTex, src->mSize, dest->mSize, srcTarget); - return true; + return; } MOZ_CRASH("GFX: Unhandled dest->mAttachType 3."); @@ -170,7 +165,7 @@ bool SharedSurface::ProdCopy(SharedSurface* src, SharedSurface* dest, gl->BlitHelper()->BlitFramebufferToTexture(destTex, src->mSize, dest->mSize, destTarget); - return true; + return; } if (dest->mAttachType == AttachmentType::GLRenderbuffer) { @@ -180,7 +175,7 @@ bool SharedSurface::ProdCopy(SharedSurface* src, SharedSurface* dest, gl->BlitHelper()->BlitFramebufferToFramebuffer( srcWrapper.FB(), destWrapper.FB(), src->mSize, dest->mSize); - return true; + return; } MOZ_CRASH("GFX: Unhandled dest->mAttachType 4."); diff --git a/gfx/gl/SharedSurface.h b/gfx/gl/SharedSurface.h index 0a62cd7aecf1..2797bdc29bed 100644 --- a/gfx/gl/SharedSurface.h +++ b/gfx/gl/SharedSurface.h @@ -54,7 +54,7 @@ class ShSurfHandle; class SharedSurface { public: - static bool ProdCopy(SharedSurface* src, SharedSurface* dest, + static void ProdCopy(SharedSurface* src, SharedSurface* dest, SurfaceFactory* factory); const SharedSurfaceType mType; diff --git a/gfx/layers/client/CanvasClient.cpp b/gfx/layers/client/CanvasClient.cpp index 19b061bbb428..64eace1c4bfa 100644 --- a/gfx/layers/client/CanvasClient.cpp +++ b/gfx/layers/client/CanvasClient.cpp @@ -365,13 +365,9 @@ static already_AddRefed CloneSurface( gl::SharedSurface* destSurf = dest->Surf(); destSurf->ProducerAcquire(); - bool ret = SharedSurface::ProdCopy(src, dest->Surf(), factory); + SharedSurface::ProdCopy(src, dest->Surf(), factory); destSurf->ProducerRelease(); - if (!ret) { - return nullptr; - } - return dest.forget(); }