Backed out changeset abdb3afb7208 (bug 1014815) for B2G reftest failures.

This commit is contained in:
Ryan VanderMeulen 2014-06-07 00:02:28 -04:00
Родитель 7f3faf0795
Коммит c45db1581f
4 изменённых файлов: 16 добавлений и 78 удалений

Просмотреть файл

@ -842,10 +842,6 @@ public:
context->MarkContextClean();
context->UpdateLastUseIndex();
if (context->GL()->Screen()->HasDelayedFrame()) {
context->Invalidate();
}
}
private:

Просмотреть файл

@ -155,10 +155,6 @@ public:
const gfx::IntSize& size,
const SurfaceCaps& caps);
bool HasDelayedFrame() {
return mStream->HasDelayedFrame();
}
protected:
GLContext* const mGL; // Owns us.
SurfaceCaps mCaps;

Просмотреть файл

@ -31,16 +31,6 @@ SurfaceStream::ChooseGLStreamType(SurfaceStream::OMTC omtc,
}
}
static bool
ShouldDelayFrame()
{
#ifdef MOZ_WIDGET_GONK
return true;
#else
return false;
#endif
}
SurfaceStream*
SurfaceStream::CreateForType(SurfaceStreamType type, mozilla::gl::GLContext* glContext, SurfaceStream* prevStream)
{
@ -53,20 +43,12 @@ SurfaceStream::CreateForType(SurfaceStreamType type, mozilla::gl::GLContext* glC
case SurfaceStreamType::TripleBuffer_Copy:
result = new SurfaceStream_TripleBuffer_Copy(prevStream);
break;
case SurfaceStreamType::TripleBuffer_Async: {
result = new SurfaceStream_TripleBuffer_Async(ShouldDelayFrame(), prevStream);
case SurfaceStreamType::TripleBuffer_Async:
result = new SurfaceStream_TripleBuffer_Async(prevStream);
break;
}
case SurfaceStreamType::TripleBuffer: {
bool delayFrame = false;
#ifdef MOZ_WIDGET_GONK
// Give time for the frame to resolve instead of waiting for the
// fence right away.
delayFrame = true;
#endif
result = new SurfaceStream_TripleBuffer(delayFrame, prevStream);
case SurfaceStreamType::TripleBuffer:
result = new SurfaceStream_TripleBuffer(prevStream);
break;
}
default:
MOZ_CRASH("Invalid Type.");
}
@ -409,25 +391,18 @@ void SurfaceStream_TripleBuffer::Init(SurfaceStream* prevStream)
}
SurfaceStream_TripleBuffer::SurfaceStream_TripleBuffer(bool aUseSwapDelay,
SurfaceStreamType type,
SurfaceStream* prevStream)
SurfaceStream_TripleBuffer::SurfaceStream_TripleBuffer(SurfaceStreamType type, SurfaceStream* prevStream)
: SurfaceStream(type, prevStream)
, mStaging(nullptr)
, mConsumer(nullptr)
, mDelay(nullptr)
, mUseSwapDelay(aUseSwapDelay)
{
SurfaceStream_TripleBuffer::Init(prevStream);
}
SurfaceStream_TripleBuffer::SurfaceStream_TripleBuffer(bool aUseSwapDelay,
SurfaceStream* prevStream)
SurfaceStream_TripleBuffer::SurfaceStream_TripleBuffer(SurfaceStream* prevStream)
: SurfaceStream(SurfaceStreamType::TripleBuffer, prevStream)
, mStaging(nullptr)
, mConsumer(nullptr)
, mDelay(nullptr)
, mUseSwapDelay(aUseSwapDelay)
{
SurfaceStream_TripleBuffer::Init(prevStream);
}
@ -436,7 +411,6 @@ SurfaceStream_TripleBuffer::~SurfaceStream_TripleBuffer()
{
Delete(mStaging);
Delete(mConsumer);
Delete(mDelay);
}
void
@ -486,31 +460,17 @@ SharedSurface*
SurfaceStream_TripleBuffer::SwapConsumer_NoWait()
{
MonitorAutoLock lock(mMonitor);
if (mDelay) {
Scrap(mConsumer);
Move(mDelay, mConsumer);
mMonitor.NotifyAll();
}
if (mStaging) {
if (mUseSwapDelay && mConsumer) {
MOZ_ASSERT(!mDelay);
Move(mStaging, mDelay);
} else {
Scrap(mConsumer);
Move(mStaging, mConsumer);
mMonitor.NotifyAll();
}
Scrap(mConsumer);
Move(mStaging, mConsumer);
mMonitor.NotifyAll();
}
return mConsumer;
}
SurfaceStream_TripleBuffer_Async::SurfaceStream_TripleBuffer_Async(bool aSwapDelay,
SurfaceStream* prevStream)
: SurfaceStream_TripleBuffer(aSwapDelay,
SurfaceStreamType::TripleBuffer_Async,
prevStream)
SurfaceStream_TripleBuffer_Async::SurfaceStream_TripleBuffer_Async(SurfaceStream* prevStream)
: SurfaceStream_TripleBuffer(SurfaceStreamType::TripleBuffer_Async, prevStream)
{
}

Просмотреть файл

@ -53,13 +53,6 @@ public:
mozilla::gl::GLContext* GLContext() const { return mGLContext; }
/**
* If we have a pending frame in the queue then we will need
* another SwapConsumer.
*/
virtual bool HasDelayedFrame() const {
return false;
}
protected:
// |mProd| is owned by us, but can be ripped away when
@ -67,14 +60,13 @@ protected:
SharedSurface* mProducer;
std::set<SharedSurface*> mSurfaces;
std::stack<SharedSurface*> mScraps;
mutable Monitor mMonitor;
bool mIsAlive;
// Do not use this. It exists solely so we can ref it in CanvasClientWebGL::Update()
// before sent up to the compositor. You have been warned (Bug 894405)
mozilla::gl::GLContext* mGLContext;
mutable Monitor mMonitor;
bool mIsAlive;
// |previous| can be null, indicating this is the first one.
// Otherwise, we pull in |mProd| from |previous| an our initial surface.
SurfaceStream(SurfaceStreamType type, SurfaceStream* prevStream)
@ -198,25 +190,19 @@ class SurfaceStream_TripleBuffer
protected:
SharedSurface* mStaging;
SharedSurface* mConsumer;
SharedSurface* mDelay;
bool mUseSwapDelay;
// Returns true if we were able to wait, false if not
virtual void WaitForCompositor() {}
// To support subclasses initializing the mType.
SurfaceStream_TripleBuffer(bool aUseSwapDelay, SurfaceStreamType type, SurfaceStream* prevStream);
SurfaceStream_TripleBuffer(SurfaceStreamType type, SurfaceStream* prevStream);
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SurfaceStream_TripleBuffer)
SurfaceStream_TripleBuffer(bool aUseSwapDelay, SurfaceStream* prevStream);
SurfaceStream_TripleBuffer(SurfaceStream* prevStream);
virtual ~SurfaceStream_TripleBuffer();
virtual bool CopySurfaceToProducer(SharedSurface* src, SurfaceFactory* factory);
virtual bool HasDelayedFrame() const MOZ_OVERRIDE {
return !!mDelay;
}
private:
// Common constructor code.
void Init(SurfaceStream* prevStream);
@ -238,7 +224,7 @@ protected:
virtual void WaitForCompositor() MOZ_OVERRIDE;
public:
SurfaceStream_TripleBuffer_Async(bool aSwapDelay, SurfaceStream* prevStream);
SurfaceStream_TripleBuffer_Async(SurfaceStream* prevStream);
virtual ~SurfaceStream_TripleBuffer_Async();
};