зеркало из https://github.com/mozilla/gecko-dev.git
Bug 952507 - Fix locking in double buffered ContentClient. r=nrc
This commit is contained in:
Родитель
1065d37c2e
Коммит
d2a76c0550
|
@ -148,7 +148,9 @@ ContentClientRemoteBuffer::EndPaint()
|
|||
SetBufferProvider(nullptr);
|
||||
SetBufferProviderOnWhite(nullptr);
|
||||
for (unsigned i = 0; i< mOldTextures.Length(); ++i) {
|
||||
mOldTextures[i]->Unlock();
|
||||
if (mOldTextures[i]->IsLocked()) {
|
||||
mOldTextures[i]->Unlock();
|
||||
}
|
||||
}
|
||||
mOldTextures.Clear();
|
||||
|
||||
|
@ -557,6 +559,15 @@ ContentClientDoubleBuffered::PrepareFrame()
|
|||
{
|
||||
mIsNewBuffer = false;
|
||||
|
||||
if (mTextureClient) {
|
||||
DebugOnly<bool> locked = mTextureClient->Lock(OPEN_READ_WRITE);
|
||||
MOZ_ASSERT(locked);
|
||||
}
|
||||
if (mTextureClientOnWhite) {
|
||||
DebugOnly<bool> locked = mTextureClientOnWhite->Lock(OPEN_READ_WRITE);
|
||||
MOZ_ASSERT(locked);
|
||||
}
|
||||
|
||||
if (!mFrontAndBackBufferDiffer) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -172,6 +172,8 @@ public:
|
|||
|
||||
virtual void Unlock() {}
|
||||
|
||||
virtual bool IsLocked() const = 0;
|
||||
|
||||
/**
|
||||
* Returns true if this texture has a lock/unlock mechanism.
|
||||
* Textures that do not implement locking should be immutable or should
|
||||
|
@ -313,6 +315,8 @@ public:
|
|||
|
||||
virtual void Unlock() MOZ_OVERRIDE;
|
||||
|
||||
virtual bool IsLocked() const MOZ_OVERRIDE { return mLocked; }
|
||||
|
||||
// TextureClientSurface
|
||||
|
||||
virtual TextureClientSurface* AsTextureClientSurface() MOZ_OVERRIDE { return this; }
|
||||
|
|
|
@ -41,6 +41,8 @@ public:
|
|||
|
||||
virtual void Unlock() MOZ_OVERRIDE;
|
||||
|
||||
virtual bool IsLocked() const MOZ_OVERRIDE { return mIsLocked; }
|
||||
|
||||
virtual bool ToSurfaceDescriptor(SurfaceDescriptor& aOutDescriptor) MOZ_OVERRIDE;
|
||||
|
||||
virtual gfx::IntSize GetSize() const MOZ_OVERRIDE { return mSize; }
|
||||
|
|
|
@ -194,6 +194,8 @@ public:
|
|||
|
||||
virtual void Unlock() MOZ_OVERRIDE;
|
||||
|
||||
virtual bool IsLocked() const MOZ_OVERRIDE { return mIsLocked; }
|
||||
|
||||
virtual bool ToSurfaceDescriptor(SurfaceDescriptor& aOutDescriptor) MOZ_OVERRIDE;
|
||||
|
||||
virtual gfx::IntSize GetSize() const { return mSize; }
|
||||
|
@ -242,6 +244,8 @@ public:
|
|||
|
||||
virtual void Unlock() MOZ_OVERRIDE;
|
||||
|
||||
virtual bool IsLocked() const MOZ_OVERRIDE { return mIsLocked; }
|
||||
|
||||
virtual bool ToSurfaceDescriptor(SurfaceDescriptor& aOutDescriptor) MOZ_OVERRIDE;
|
||||
|
||||
virtual gfx::IntSize GetSize() const { return mSize; }
|
||||
|
@ -287,6 +291,8 @@ public:
|
|||
|
||||
virtual void Unlock() MOZ_OVERRIDE;
|
||||
|
||||
virtual bool IsLocked() const MOZ_OVERRIDE { return mIsLocked; }
|
||||
|
||||
virtual bool ToSurfaceDescriptor(SurfaceDescriptor& aOutDescriptor) MOZ_OVERRIDE;
|
||||
|
||||
void InitWith(IDirect3DTexture9* aTexture, HANDLE aSharedHandle, D3DSURFACE_DESC aDesc)
|
||||
|
|
|
@ -60,6 +60,21 @@ SharedTextureClientOGL::InitWith(gl::SharedTextureHandle aHandle,
|
|||
}
|
||||
}
|
||||
|
||||
bool
|
||||
SharedTextureClientOGL::Lock(OpenMode mode)
|
||||
{
|
||||
MOZ_ASSERT(!mIsLocked);
|
||||
mIsLocked = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
SharedTextureClientOGL::Unlock()
|
||||
{
|
||||
MOZ_ASSERT(mIsLocked);
|
||||
mIsLocked = false;
|
||||
}
|
||||
|
||||
bool
|
||||
SharedTextureClientOGL::IsAllocated() const
|
||||
{
|
||||
|
@ -69,6 +84,7 @@ SharedTextureClientOGL::IsAllocated() const
|
|||
StreamTextureClientOGL::StreamTextureClientOGL(TextureFlags aFlags)
|
||||
: TextureClient(aFlags)
|
||||
, mStream(0)
|
||||
, mIsLocked(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -77,6 +93,21 @@ StreamTextureClientOGL::~StreamTextureClientOGL()
|
|||
// the data is owned externally.
|
||||
}
|
||||
|
||||
bool
|
||||
StreamTextureClientOGL::Lock(OpenMode mode)
|
||||
{
|
||||
MOZ_ASSERT(!mIsLocked);
|
||||
mIsLocked = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
StreamTextureClientOGL::Unlock()
|
||||
{
|
||||
MOZ_ASSERT(mIsLocked);
|
||||
mIsLocked = false;
|
||||
}
|
||||
|
||||
bool
|
||||
StreamTextureClientOGL::ToSurfaceDescriptor(SurfaceDescriptor& aOutDescriptor)
|
||||
{
|
||||
|
|
|
@ -40,6 +40,12 @@ public:
|
|||
|
||||
virtual bool ToSurfaceDescriptor(SurfaceDescriptor& aOutDescriptor) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool Lock(OpenMode mode) MOZ_OVERRIDE;
|
||||
|
||||
virtual void Unlock() MOZ_OVERRIDE;
|
||||
|
||||
virtual bool IsLocked() const MOZ_OVERRIDE { return mIsLocked; }
|
||||
|
||||
void InitWith(gl::SharedTextureHandle aHandle,
|
||||
gfx::IntSize aSize,
|
||||
gl::SharedTextureShareType aShareType,
|
||||
|
@ -61,6 +67,7 @@ protected:
|
|||
gfx::IntSize mSize;
|
||||
gl::SharedTextureShareType mShareType;
|
||||
bool mInverted;
|
||||
bool mIsLocked;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -75,6 +82,12 @@ public:
|
|||
|
||||
virtual bool IsAllocated() const MOZ_OVERRIDE;
|
||||
|
||||
virtual bool Lock(OpenMode mode) MOZ_OVERRIDE;
|
||||
|
||||
virtual void Unlock() MOZ_OVERRIDE;
|
||||
|
||||
virtual bool IsLocked() const MOZ_OVERRIDE { return mIsLocked; }
|
||||
|
||||
virtual bool ToSurfaceDescriptor(SurfaceDescriptor& aOutDescriptor) MOZ_OVERRIDE;
|
||||
|
||||
virtual TextureClientData* DropTextureData() MOZ_OVERRIDE { return nullptr; }
|
||||
|
@ -85,6 +98,7 @@ public:
|
|||
|
||||
protected:
|
||||
gfx::SurfaceStream* mStream;
|
||||
bool mIsLocked;
|
||||
};
|
||||
|
||||
class DeprecatedTextureClientSharedOGL : public DeprecatedTextureClient
|
||||
|
|
Загрузка…
Ссылка в новой задаче