зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset d75e4cb5b188 (bug 1546192
) for build bustage at /builds/worker/workspace/build/src/gfx/gl/GLScreenBuffer.cpp. On a CLOSED TREE
This commit is contained in:
Родитель
7a71e98214
Коммит
ff5cbecd34
|
@ -477,9 +477,7 @@ bool GLScreenBuffer::Swap(const gfx::IntSize& size) {
|
||||||
GLContext::LocalErrorScope errorScope(*mGL);
|
GLContext::LocalErrorScope errorScope(*mGL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!SharedSurface::ProdCopy(src, dest, mFactory.get())) {
|
SharedSurface::ProdCopy(src, dest, mFactory.get());
|
||||||
ret = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
MOZ_ASSERT(!errorScope.GetError());
|
MOZ_ASSERT(!errorScope.GetError());
|
||||||
|
@ -498,7 +496,7 @@ bool GLScreenBuffer::Swap(const gfx::IntSize& size) {
|
||||||
mFront->Surf()->ProducerRelease();
|
mFront->Surf()->ProducerRelease();
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GLScreenBuffer::PublishFrame(const gfx::IntSize& size) {
|
bool GLScreenBuffer::PublishFrame(const gfx::IntSize& size) {
|
||||||
|
@ -517,7 +515,6 @@ bool GLScreenBuffer::Resize(const gfx::IntSize& size) {
|
||||||
if (mBack) mBack->Surf()->ProducerRelease();
|
if (mBack) mBack->Surf()->ProducerRelease();
|
||||||
|
|
||||||
mBack = newBack;
|
mBack = newBack;
|
||||||
bool ret = true;
|
|
||||||
|
|
||||||
mBack->Surf()->ProducerAcquire();
|
mBack->Surf()->ProducerAcquire();
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
#include "nsThreadUtils.h"
|
#include "nsThreadUtils.h"
|
||||||
#include "ScopedGLHelpers.h"
|
#include "ScopedGLHelpers.h"
|
||||||
#include "SharedSurfaceGL.h"
|
#include "SharedSurfaceGL.h"
|
||||||
#include "mozilla/gfx/Logging.h"
|
|
||||||
#include "mozilla/layers/CompositorTypes.h"
|
#include "mozilla/layers/CompositorTypes.h"
|
||||||
#include "mozilla/layers/TextureClientSharedSurface.h"
|
#include "mozilla/layers/TextureClientSharedSurface.h"
|
||||||
#include "mozilla/layers/TextureForwarder.h"
|
#include "mozilla/layers/TextureForwarder.h"
|
||||||
|
@ -24,7 +23,7 @@ namespace mozilla {
|
||||||
namespace gl {
|
namespace gl {
|
||||||
|
|
||||||
/*static*/
|
/*static*/
|
||||||
bool SharedSurface::ProdCopy(SharedSurface* src, SharedSurface* dest,
|
void SharedSurface::ProdCopy(SharedSurface* src, SharedSurface* dest,
|
||||||
SurfaceFactory* factory) {
|
SurfaceFactory* factory) {
|
||||||
GLContext* gl = src->mGL;
|
GLContext* gl = src->mGL;
|
||||||
|
|
||||||
|
@ -40,14 +39,10 @@ bool SharedSurface::ProdCopy(SharedSurface* src, SharedSurface* dest,
|
||||||
UniquePtr<SharedSurface_Basic> tempSurf;
|
UniquePtr<SharedSurface_Basic> tempSurf;
|
||||||
tempSurf = SharedSurface_Basic::Create(gl, factory->mFormats, src->mSize,
|
tempSurf = SharedSurface_Basic::Create(gl, factory->mFormats, src->mSize,
|
||||||
factory->mCaps.alpha);
|
factory->mCaps.alpha);
|
||||||
if (!tempSurf) {
|
|
||||||
gfxCriticalNote << "Failed to allocate SharedSurface_Basic.";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
ProdCopy(src, tempSurf.get(), factory);
|
ProdCopy(src, tempSurf.get(), factory);
|
||||||
ProdCopy(tempSurf.get(), dest, factory);
|
ProdCopy(tempSurf.get(), dest, factory);
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (src->mAttachType == AttachmentType::Screen) {
|
if (src->mAttachType == AttachmentType::Screen) {
|
||||||
|
@ -86,7 +81,7 @@ bool SharedSurface::ProdCopy(SharedSurface* src, SharedSurface* dest,
|
||||||
|
|
||||||
if (origNeedsRelock) origLocked->LockProd();
|
if (origNeedsRelock) origLocked->LockProd();
|
||||||
|
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dest->mAttachType == AttachmentType::Screen) {
|
if (dest->mAttachType == AttachmentType::Screen) {
|
||||||
|
@ -125,7 +120,7 @@ bool SharedSurface::ProdCopy(SharedSurface* src, SharedSurface* dest,
|
||||||
|
|
||||||
if (origNeedsRelock) origLocked->LockProd();
|
if (origNeedsRelock) origLocked->LockProd();
|
||||||
|
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Alright, done with cases involving Screen types.
|
// Alright, done with cases involving Screen types.
|
||||||
|
@ -142,7 +137,7 @@ bool SharedSurface::ProdCopy(SharedSurface* src, SharedSurface* dest,
|
||||||
gl->BlitHelper()->BlitTextureToTexture(
|
gl->BlitHelper()->BlitTextureToTexture(
|
||||||
srcTex, destTex, src->mSize, dest->mSize, srcTarget, destTarget);
|
srcTex, destTex, src->mSize, dest->mSize, srcTarget, destTarget);
|
||||||
|
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dest->mAttachType == AttachmentType::GLRenderbuffer) {
|
if (dest->mAttachType == AttachmentType::GLRenderbuffer) {
|
||||||
|
@ -152,7 +147,7 @@ bool SharedSurface::ProdCopy(SharedSurface* src, SharedSurface* dest,
|
||||||
gl->BlitHelper()->BlitTextureToFramebuffer(srcTex, src->mSize,
|
gl->BlitHelper()->BlitTextureToFramebuffer(srcTex, src->mSize,
|
||||||
dest->mSize, srcTarget);
|
dest->mSize, srcTarget);
|
||||||
|
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MOZ_CRASH("GFX: Unhandled dest->mAttachType 3.");
|
MOZ_CRASH("GFX: Unhandled dest->mAttachType 3.");
|
||||||
|
@ -170,7 +165,7 @@ bool SharedSurface::ProdCopy(SharedSurface* src, SharedSurface* dest,
|
||||||
gl->BlitHelper()->BlitFramebufferToTexture(destTex, src->mSize,
|
gl->BlitHelper()->BlitFramebufferToTexture(destTex, src->mSize,
|
||||||
dest->mSize, destTarget);
|
dest->mSize, destTarget);
|
||||||
|
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dest->mAttachType == AttachmentType::GLRenderbuffer) {
|
if (dest->mAttachType == AttachmentType::GLRenderbuffer) {
|
||||||
|
@ -180,7 +175,7 @@ bool SharedSurface::ProdCopy(SharedSurface* src, SharedSurface* dest,
|
||||||
gl->BlitHelper()->BlitFramebufferToFramebuffer(
|
gl->BlitHelper()->BlitFramebufferToFramebuffer(
|
||||||
srcWrapper.FB(), destWrapper.FB(), src->mSize, dest->mSize);
|
srcWrapper.FB(), destWrapper.FB(), src->mSize, dest->mSize);
|
||||||
|
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MOZ_CRASH("GFX: Unhandled dest->mAttachType 4.");
|
MOZ_CRASH("GFX: Unhandled dest->mAttachType 4.");
|
||||||
|
|
|
@ -54,7 +54,7 @@ class ShSurfHandle;
|
||||||
|
|
||||||
class SharedSurface {
|
class SharedSurface {
|
||||||
public:
|
public:
|
||||||
static bool ProdCopy(SharedSurface* src, SharedSurface* dest,
|
static void ProdCopy(SharedSurface* src, SharedSurface* dest,
|
||||||
SurfaceFactory* factory);
|
SurfaceFactory* factory);
|
||||||
|
|
||||||
const SharedSurfaceType mType;
|
const SharedSurfaceType mType;
|
||||||
|
|
|
@ -365,13 +365,9 @@ static already_AddRefed<SharedSurfaceTextureClient> CloneSurface(
|
||||||
gl::SharedSurface* destSurf = dest->Surf();
|
gl::SharedSurface* destSurf = dest->Surf();
|
||||||
|
|
||||||
destSurf->ProducerAcquire();
|
destSurf->ProducerAcquire();
|
||||||
bool ret = SharedSurface::ProdCopy(src, dest->Surf(), factory);
|
SharedSurface::ProdCopy(src, dest->Surf(), factory);
|
||||||
destSurf->ProducerRelease();
|
destSurf->ProducerRelease();
|
||||||
|
|
||||||
if (!ret) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
return dest.forget();
|
return dest.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче