2013-02-13 15:26:24 -08:00
|
|
|
/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#include "SurfaceStream.h"
|
|
|
|
|
|
|
|
#include "gfxPoint.h"
|
|
|
|
#include "SharedSurface.h"
|
2014-03-05 13:49:37 -08:00
|
|
|
#include "SharedSurfaceGL.h"
|
2013-02-13 15:26:24 -08:00
|
|
|
#include "SurfaceFactory.h"
|
2013-03-15 17:48:56 -07:00
|
|
|
#include "GeckoProfiler.h"
|
2013-02-13 15:26:24 -08:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace gfx {
|
|
|
|
|
|
|
|
SurfaceStreamType
|
|
|
|
SurfaceStream::ChooseGLStreamType(SurfaceStream::OMTC omtc,
|
|
|
|
bool preserveBuffer)
|
|
|
|
{
|
2013-02-20 23:52:17 -08:00
|
|
|
if (omtc == SurfaceStream::OffMainThread) {
|
2013-02-13 15:26:24 -08:00
|
|
|
if (preserveBuffer)
|
|
|
|
return SurfaceStreamType::TripleBuffer_Copy;
|
|
|
|
else
|
2014-04-14 15:37:06 -07:00
|
|
|
return SurfaceStreamType::TripleBuffer_Async;
|
2013-02-13 15:26:24 -08:00
|
|
|
} else {
|
|
|
|
if (preserveBuffer)
|
|
|
|
return SurfaceStreamType::SingleBuffer;
|
|
|
|
else
|
|
|
|
return SurfaceStreamType::TripleBuffer;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SurfaceStream*
|
2013-07-17 10:03:18 -07:00
|
|
|
SurfaceStream::CreateForType(SurfaceStreamType type, mozilla::gl::GLContext* glContext, SurfaceStream* prevStream)
|
2013-02-13 15:26:24 -08:00
|
|
|
{
|
2013-07-17 10:03:18 -07:00
|
|
|
SurfaceStream* result = nullptr;
|
|
|
|
|
2013-02-13 15:26:24 -08:00
|
|
|
switch (type) {
|
|
|
|
case SurfaceStreamType::SingleBuffer:
|
2013-07-17 10:03:18 -07:00
|
|
|
result = new SurfaceStream_SingleBuffer(prevStream);
|
|
|
|
break;
|
2013-02-13 15:26:24 -08:00
|
|
|
case SurfaceStreamType::TripleBuffer_Copy:
|
2013-07-17 10:03:18 -07:00
|
|
|
result = new SurfaceStream_TripleBuffer_Copy(prevStream);
|
|
|
|
break;
|
2014-04-14 15:37:06 -07:00
|
|
|
case SurfaceStreamType::TripleBuffer_Async:
|
|
|
|
result = new SurfaceStream_TripleBuffer_Async(prevStream);
|
|
|
|
break;
|
2013-02-13 15:26:24 -08:00
|
|
|
case SurfaceStreamType::TripleBuffer:
|
2013-07-17 10:03:18 -07:00
|
|
|
result = new SurfaceStream_TripleBuffer(prevStream);
|
|
|
|
break;
|
2013-02-13 15:26:24 -08:00
|
|
|
default:
|
2013-06-28 18:38:30 -07:00
|
|
|
MOZ_CRASH("Invalid Type.");
|
2013-02-13 15:26:24 -08:00
|
|
|
}
|
2013-07-17 10:03:18 -07:00
|
|
|
|
|
|
|
result->mGLContext = glContext;
|
|
|
|
return result;
|
2013-02-13 15:26:24 -08:00
|
|
|
}
|
|
|
|
|
2014-03-05 13:49:37 -08:00
|
|
|
bool
|
|
|
|
SurfaceStream_TripleBuffer::CopySurfaceToProducer(SharedSurface* src, SurfaceFactory* factory)
|
|
|
|
{
|
|
|
|
if (!mProducer) {
|
|
|
|
New(factory, src->Size(), mProducer);
|
|
|
|
if (!mProducer) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MOZ_ASSERT(src->Size() == mProducer->Size(), "Size mismatch");
|
|
|
|
|
|
|
|
SharedSurface::Copy(src, mProducer, factory);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-02-13 15:26:24 -08:00
|
|
|
void
|
2013-12-10 08:12:18 -08:00
|
|
|
SurfaceStream::New(SurfaceFactory* factory, const gfx::IntSize& size,
|
2013-02-13 15:26:24 -08:00
|
|
|
SharedSurface*& surf)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(!surf);
|
|
|
|
surf = factory->NewSharedSurface(size);
|
|
|
|
|
2014-05-14 15:40:15 -07:00
|
|
|
if (surf) {
|
|
|
|
// Before next use, wait until SharedSurface's buffer
|
|
|
|
// is no longer being used.
|
|
|
|
surf->WaitForBufferOwnership();
|
2013-02-13 15:26:24 -08:00
|
|
|
mSurfaces.insert(surf);
|
2014-05-14 15:40:15 -07:00
|
|
|
}
|
2013-02-13 15:26:24 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SurfaceStream::Recycle(SurfaceFactory* factory, SharedSurface*& surf)
|
|
|
|
{
|
|
|
|
if (surf) {
|
|
|
|
mSurfaces.erase(surf);
|
|
|
|
factory->Recycle(surf);
|
|
|
|
}
|
|
|
|
MOZ_ASSERT(!surf);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SurfaceStream::Delete(SharedSurface*& surf)
|
|
|
|
{
|
|
|
|
if (surf) {
|
|
|
|
mSurfaces.erase(surf);
|
|
|
|
delete surf;
|
|
|
|
surf = nullptr;
|
|
|
|
}
|
|
|
|
MOZ_ASSERT(!surf);
|
|
|
|
}
|
|
|
|
|
|
|
|
SharedSurface*
|
|
|
|
SurfaceStream::Surrender(SharedSurface*& surf)
|
|
|
|
{
|
|
|
|
SharedSurface* ret = surf;
|
|
|
|
|
|
|
|
if (surf) {
|
|
|
|
mSurfaces.erase(surf);
|
|
|
|
surf = nullptr;
|
|
|
|
}
|
|
|
|
MOZ_ASSERT(!surf);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
SharedSurface*
|
|
|
|
SurfaceStream::Absorb(SharedSurface*& surf)
|
|
|
|
{
|
|
|
|
SharedSurface* ret = surf;
|
|
|
|
|
|
|
|
if (surf) {
|
|
|
|
mSurfaces.insert(surf);
|
|
|
|
surf = nullptr;
|
|
|
|
}
|
|
|
|
MOZ_ASSERT(!surf);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SurfaceStream::Scrap(SharedSurface*& scrap)
|
|
|
|
{
|
|
|
|
if (scrap) {
|
|
|
|
mScraps.push(scrap);
|
|
|
|
scrap = nullptr;
|
|
|
|
}
|
|
|
|
MOZ_ASSERT(!scrap);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SurfaceStream::RecycleScraps(SurfaceFactory* factory)
|
|
|
|
{
|
|
|
|
while (!mScraps.empty()) {
|
|
|
|
SharedSurface* cur = mScraps.top();
|
|
|
|
mScraps.pop();
|
|
|
|
|
|
|
|
Recycle(factory, cur);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SurfaceStream::~SurfaceStream()
|
|
|
|
{
|
|
|
|
Delete(mProducer);
|
|
|
|
|
|
|
|
while (!mScraps.empty()) {
|
|
|
|
SharedSurface* cur = mScraps.top();
|
|
|
|
mScraps.pop();
|
|
|
|
|
|
|
|
Delete(cur);
|
|
|
|
}
|
|
|
|
|
|
|
|
MOZ_ASSERT(mSurfaces.empty());
|
|
|
|
}
|
|
|
|
|
|
|
|
SharedSurface*
|
|
|
|
SurfaceStream::SwapConsumer()
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(mIsAlive);
|
|
|
|
|
|
|
|
SharedSurface* ret = SwapConsumer_NoWait();
|
|
|
|
if (!ret)
|
|
|
|
return nullptr;
|
|
|
|
|
|
|
|
if (!ret->WaitSync()) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2013-03-22 12:22:20 -07:00
|
|
|
SharedSurface*
|
2013-12-10 08:12:18 -08:00
|
|
|
SurfaceStream::Resize(SurfaceFactory* factory, const gfx::IntSize& size)
|
2013-03-22 12:22:20 -07:00
|
|
|
{
|
|
|
|
MonitorAutoLock lock(mMonitor);
|
|
|
|
|
|
|
|
if (mProducer) {
|
|
|
|
Scrap(mProducer);
|
|
|
|
}
|
2013-02-13 15:26:24 -08:00
|
|
|
|
2013-03-22 12:22:20 -07:00
|
|
|
New(factory, size, mProducer);
|
|
|
|
return mProducer;
|
|
|
|
}
|
2013-02-13 15:26:24 -08:00
|
|
|
|
|
|
|
SurfaceStream_SingleBuffer::SurfaceStream_SingleBuffer(SurfaceStream* prevStream)
|
|
|
|
: SurfaceStream(SurfaceStreamType::SingleBuffer, prevStream)
|
|
|
|
, mConsumer(nullptr)
|
|
|
|
{
|
|
|
|
if (!prevStream)
|
|
|
|
return;
|
|
|
|
|
|
|
|
SharedSurface* prevProducer = nullptr;
|
|
|
|
SharedSurface* prevConsumer = nullptr;
|
|
|
|
prevStream->SurrenderSurfaces(prevProducer, prevConsumer);
|
|
|
|
|
|
|
|
if (prevConsumer == prevProducer)
|
|
|
|
prevConsumer = nullptr;
|
|
|
|
|
|
|
|
mProducer = Absorb(prevProducer);
|
|
|
|
mConsumer = Absorb(prevConsumer);
|
|
|
|
}
|
|
|
|
|
|
|
|
SurfaceStream_SingleBuffer::~SurfaceStream_SingleBuffer()
|
|
|
|
{
|
|
|
|
Delete(mConsumer);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SurfaceStream_SingleBuffer::SurrenderSurfaces(SharedSurface*& producer,
|
|
|
|
SharedSurface*& consumer)
|
|
|
|
{
|
|
|
|
mIsAlive = false;
|
|
|
|
|
|
|
|
producer = Surrender(mProducer);
|
|
|
|
consumer = Surrender(mConsumer);
|
|
|
|
|
|
|
|
if (!consumer)
|
|
|
|
consumer = producer;
|
|
|
|
}
|
|
|
|
|
|
|
|
SharedSurface*
|
|
|
|
SurfaceStream_SingleBuffer::SwapProducer(SurfaceFactory* factory,
|
2013-12-10 08:12:18 -08:00
|
|
|
const gfx::IntSize& size)
|
2013-02-13 15:26:24 -08:00
|
|
|
{
|
2013-03-22 12:22:20 -07:00
|
|
|
MonitorAutoLock lock(mMonitor);
|
2013-02-13 15:26:24 -08:00
|
|
|
if (mConsumer) {
|
|
|
|
Recycle(factory, mConsumer);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mProducer) {
|
|
|
|
// Fence now, before we start (maybe) juggling Prod around.
|
|
|
|
mProducer->Fence();
|
|
|
|
|
|
|
|
// Size mismatch means we need to squirrel the current Prod
|
|
|
|
// into Cons, and leave Prod empty, so it gets a new surface below.
|
|
|
|
bool needsNewBuffer = mProducer->Size() != size;
|
|
|
|
|
|
|
|
// Even if we're the right size, if the type has changed, and we don't
|
|
|
|
// need to preserve, we should switch out for (presumedly) better perf.
|
|
|
|
if (mProducer->Type() != factory->Type() &&
|
|
|
|
!factory->Caps().preserve)
|
|
|
|
{
|
|
|
|
needsNewBuffer = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (needsNewBuffer) {
|
|
|
|
Move(mProducer, mConsumer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// The old Prod (if there every was one) was invalid,
|
|
|
|
// so we need a new one.
|
|
|
|
if (!mProducer) {
|
|
|
|
New(factory, size, mProducer);
|
|
|
|
}
|
|
|
|
|
|
|
|
return mProducer;
|
|
|
|
}
|
|
|
|
|
|
|
|
SharedSurface*
|
|
|
|
SurfaceStream_SingleBuffer::SwapConsumer_NoWait()
|
|
|
|
{
|
2013-03-22 12:22:20 -07:00
|
|
|
MonitorAutoLock lock(mMonitor);
|
2013-02-13 15:26:24 -08:00
|
|
|
|
|
|
|
// Use Cons, if present.
|
|
|
|
// Otherwise, just use Prod directly.
|
|
|
|
SharedSurface* toConsume = mConsumer;
|
|
|
|
if (!toConsume)
|
|
|
|
toConsume = mProducer;
|
|
|
|
|
|
|
|
return toConsume;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SurfaceStream_TripleBuffer_Copy::SurfaceStream_TripleBuffer_Copy(SurfaceStream* prevStream)
|
|
|
|
: SurfaceStream(SurfaceStreamType::TripleBuffer_Copy, prevStream)
|
|
|
|
, mStaging(nullptr)
|
|
|
|
, mConsumer(nullptr)
|
|
|
|
{
|
|
|
|
if (!prevStream)
|
|
|
|
return;
|
|
|
|
|
|
|
|
SharedSurface* prevProducer = nullptr;
|
|
|
|
SharedSurface* prevConsumer = nullptr;
|
|
|
|
prevStream->SurrenderSurfaces(prevProducer, prevConsumer);
|
|
|
|
|
|
|
|
if (prevConsumer == prevProducer)
|
|
|
|
prevConsumer = nullptr;
|
|
|
|
|
|
|
|
mProducer = Absorb(prevProducer);
|
|
|
|
mConsumer = Absorb(prevConsumer);
|
|
|
|
}
|
|
|
|
|
|
|
|
SurfaceStream_TripleBuffer_Copy::~SurfaceStream_TripleBuffer_Copy()
|
|
|
|
{
|
|
|
|
Delete(mStaging);
|
|
|
|
Delete(mConsumer);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SurfaceStream_TripleBuffer_Copy::SurrenderSurfaces(SharedSurface*& producer,
|
|
|
|
SharedSurface*& consumer)
|
|
|
|
{
|
|
|
|
mIsAlive = false;
|
|
|
|
|
|
|
|
producer = Surrender(mProducer);
|
|
|
|
consumer = Surrender(mConsumer);
|
|
|
|
|
|
|
|
if (!consumer)
|
|
|
|
consumer = Surrender(mStaging);
|
|
|
|
}
|
|
|
|
|
|
|
|
SharedSurface*
|
|
|
|
SurfaceStream_TripleBuffer_Copy::SwapProducer(SurfaceFactory* factory,
|
2013-12-10 08:12:18 -08:00
|
|
|
const gfx::IntSize& size)
|
2013-02-13 15:26:24 -08:00
|
|
|
{
|
2013-03-22 12:22:20 -07:00
|
|
|
MonitorAutoLock lock(mMonitor);
|
2013-02-13 15:26:24 -08:00
|
|
|
|
|
|
|
RecycleScraps(factory);
|
|
|
|
if (mProducer) {
|
2013-04-25 13:27:43 -07:00
|
|
|
if (mStaging) {
|
|
|
|
// We'll re-use this for a new mProducer later on if
|
|
|
|
// the size remains the same
|
2013-02-13 15:26:24 -08:00
|
|
|
Recycle(factory, mStaging);
|
2013-04-25 13:27:43 -07:00
|
|
|
}
|
2013-02-13 15:26:24 -08:00
|
|
|
|
2013-04-25 13:27:43 -07:00
|
|
|
Move(mProducer, mStaging);
|
2013-02-13 15:26:24 -08:00
|
|
|
mStaging->Fence();
|
|
|
|
|
2013-04-25 13:27:43 -07:00
|
|
|
New(factory, size, mProducer);
|
|
|
|
|
|
|
|
if (mProducer && mStaging->Size() == mProducer->Size())
|
|
|
|
SharedSurface::Copy(mStaging, mProducer, factory);
|
|
|
|
} else {
|
2013-02-13 15:26:24 -08:00
|
|
|
New(factory, size, mProducer);
|
|
|
|
}
|
|
|
|
|
|
|
|
return mProducer;
|
|
|
|
}
|
|
|
|
|
2013-03-22 12:22:20 -07:00
|
|
|
|
2013-02-13 15:26:24 -08:00
|
|
|
SharedSurface*
|
|
|
|
SurfaceStream_TripleBuffer_Copy::SwapConsumer_NoWait()
|
|
|
|
{
|
2013-03-22 12:22:20 -07:00
|
|
|
MonitorAutoLock lock(mMonitor);
|
2013-02-13 15:26:24 -08:00
|
|
|
|
|
|
|
if (mStaging) {
|
|
|
|
Scrap(mConsumer);
|
|
|
|
Move(mStaging, mConsumer);
|
|
|
|
}
|
|
|
|
|
|
|
|
return mConsumer;
|
|
|
|
}
|
|
|
|
|
2013-04-07 06:35:21 -07:00
|
|
|
void SurfaceStream_TripleBuffer::Init(SurfaceStream* prevStream)
|
2013-02-13 15:26:24 -08:00
|
|
|
{
|
|
|
|
if (!prevStream)
|
|
|
|
return;
|
|
|
|
|
|
|
|
SharedSurface* prevProducer = nullptr;
|
|
|
|
SharedSurface* prevConsumer = nullptr;
|
|
|
|
prevStream->SurrenderSurfaces(prevProducer, prevConsumer);
|
|
|
|
|
|
|
|
if (prevConsumer == prevProducer)
|
|
|
|
prevConsumer = nullptr;
|
|
|
|
|
|
|
|
mProducer = Absorb(prevProducer);
|
|
|
|
mConsumer = Absorb(prevConsumer);
|
|
|
|
}
|
|
|
|
|
2013-04-07 06:35:21 -07:00
|
|
|
|
|
|
|
SurfaceStream_TripleBuffer::SurfaceStream_TripleBuffer(SurfaceStreamType type, SurfaceStream* prevStream)
|
|
|
|
: SurfaceStream(type, prevStream)
|
|
|
|
, mStaging(nullptr)
|
|
|
|
, mConsumer(nullptr)
|
|
|
|
{
|
|
|
|
SurfaceStream_TripleBuffer::Init(prevStream);
|
|
|
|
}
|
|
|
|
|
|
|
|
SurfaceStream_TripleBuffer::SurfaceStream_TripleBuffer(SurfaceStream* prevStream)
|
|
|
|
: SurfaceStream(SurfaceStreamType::TripleBuffer, prevStream)
|
|
|
|
, mStaging(nullptr)
|
|
|
|
, mConsumer(nullptr)
|
|
|
|
{
|
|
|
|
SurfaceStream_TripleBuffer::Init(prevStream);
|
|
|
|
}
|
|
|
|
|
2013-02-13 15:26:24 -08:00
|
|
|
SurfaceStream_TripleBuffer::~SurfaceStream_TripleBuffer()
|
|
|
|
{
|
|
|
|
Delete(mStaging);
|
|
|
|
Delete(mConsumer);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SurfaceStream_TripleBuffer::SurrenderSurfaces(SharedSurface*& producer,
|
|
|
|
SharedSurface*& consumer)
|
|
|
|
{
|
|
|
|
mIsAlive = false;
|
|
|
|
|
|
|
|
producer = Surrender(mProducer);
|
|
|
|
consumer = Surrender(mConsumer);
|
|
|
|
|
|
|
|
if (!consumer)
|
|
|
|
consumer = Surrender(mStaging);
|
|
|
|
}
|
|
|
|
|
|
|
|
SharedSurface*
|
|
|
|
SurfaceStream_TripleBuffer::SwapProducer(SurfaceFactory* factory,
|
2013-12-10 08:12:18 -08:00
|
|
|
const gfx::IntSize& size)
|
2013-02-13 15:26:24 -08:00
|
|
|
{
|
2013-03-15 17:48:56 -07:00
|
|
|
PROFILER_LABEL("SurfaceStream_TripleBuffer", "SwapProducer");
|
2013-03-22 12:22:20 -07:00
|
|
|
|
|
|
|
MonitorAutoLock lock(mMonitor);
|
2013-02-13 15:26:24 -08:00
|
|
|
if (mProducer) {
|
|
|
|
RecycleScraps(factory);
|
|
|
|
|
2014-04-14 15:37:06 -07:00
|
|
|
// If WaitForCompositor succeeds, mStaging has moved to mConsumer.
|
|
|
|
// If it failed, we might have to scrap it.
|
2014-05-13 21:10:00 -07:00
|
|
|
if (mStaging) {
|
|
|
|
WaitForCompositor();
|
|
|
|
}
|
|
|
|
if (mStaging) {
|
2013-03-22 12:22:20 -07:00
|
|
|
Scrap(mStaging);
|
2014-05-13 21:10:00 -07:00
|
|
|
}
|
2013-02-13 15:26:24 -08:00
|
|
|
|
|
|
|
Move(mProducer, mStaging);
|
|
|
|
mStaging->Fence();
|
|
|
|
}
|
|
|
|
|
|
|
|
MOZ_ASSERT(!mProducer);
|
|
|
|
New(factory, size, mProducer);
|
|
|
|
|
|
|
|
return mProducer;
|
|
|
|
}
|
|
|
|
|
|
|
|
SharedSurface*
|
|
|
|
SurfaceStream_TripleBuffer::SwapConsumer_NoWait()
|
|
|
|
{
|
2013-03-22 12:22:20 -07:00
|
|
|
MonitorAutoLock lock(mMonitor);
|
2013-02-13 15:26:24 -08:00
|
|
|
if (mStaging) {
|
|
|
|
Scrap(mConsumer);
|
|
|
|
Move(mStaging, mConsumer);
|
2013-03-22 12:22:20 -07:00
|
|
|
mMonitor.NotifyAll();
|
2013-02-13 15:26:24 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
return mConsumer;
|
|
|
|
}
|
|
|
|
|
2014-04-14 15:37:06 -07:00
|
|
|
SurfaceStream_TripleBuffer_Async::SurfaceStream_TripleBuffer_Async(SurfaceStream* prevStream)
|
|
|
|
: SurfaceStream_TripleBuffer(SurfaceStreamType::TripleBuffer_Async, prevStream)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
SurfaceStream_TripleBuffer_Async::~SurfaceStream_TripleBuffer_Async()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-05-13 21:10:00 -07:00
|
|
|
void
|
2014-04-14 15:37:06 -07:00
|
|
|
SurfaceStream_TripleBuffer_Async::WaitForCompositor()
|
|
|
|
{
|
|
|
|
PROFILER_LABEL("SurfaceStream_TripleBuffer_Async", "WaitForCompositor");
|
|
|
|
|
2014-05-13 21:10:00 -07:00
|
|
|
// If we haven't be notified within 100ms, then
|
|
|
|
// something must have happened and it will never arrive.
|
|
|
|
// Bail out to avoid deadlocking.
|
|
|
|
mMonitor.Wait(PR_MillisecondsToInterval(100));
|
2014-04-14 15:37:06 -07:00
|
|
|
}
|
|
|
|
|
2013-02-13 15:26:24 -08:00
|
|
|
} /* namespace gfx */
|
|
|
|
} /* namespace mozilla */
|