mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 02:14:43 +00:00
Bug 1555653
Fix asserts in WindowBackBufferShm; r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D33147 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
3edf01f700
commit
89fcedf92d
@ -409,6 +409,7 @@ already_AddRefed<gfx::DrawTarget> WindowBackBufferShm::Lock() {
|
||||
mWaylandBuffer ? wl_proxy_get_id((struct wl_proxy*)mWaylandBuffer) : -1));
|
||||
|
||||
gfx::IntSize lockSize(mWidth, mHeight);
|
||||
mIsLocked = true;
|
||||
return gfxPlatform::CreateDrawTargetForData(
|
||||
static_cast<unsigned char*>(mShmPool.GetImageData()), lockSize,
|
||||
BUFFER_BPP * mWidth, GetSurfaceFormat());
|
||||
@ -593,9 +594,6 @@ WindowBackBuffer* WindowSurfaceWayland::GetWaylandBufferToDraw(
|
||||
return mWaylandBuffer;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(!mPendingCommit,
|
||||
"Uncommitted buffer switch, screen artifacts ahead.");
|
||||
|
||||
// Front buffer is used by compositor, select a back buffer
|
||||
int availableBuffer;
|
||||
for (availableBuffer = 0; availableBuffer < BACK_BUFFER_NUM;
|
||||
|
@ -44,8 +44,8 @@ class WaylandShmPool {
|
||||
class WindowBackBuffer {
|
||||
public:
|
||||
virtual already_AddRefed<gfx::DrawTarget> Lock() = 0;
|
||||
virtual void Unlock(){};
|
||||
virtual bool IsLocked() { return false; };
|
||||
virtual void Unlock() = 0;
|
||||
virtual bool IsLocked() = 0;
|
||||
|
||||
void Attach(wl_surface* aSurface);
|
||||
virtual void Detach(wl_buffer* aBuffer) = 0;
|
||||
@ -89,9 +89,12 @@ class WindowBackBufferShm : public WindowBackBuffer {
|
||||
~WindowBackBufferShm();
|
||||
|
||||
already_AddRefed<gfx::DrawTarget> Lock();
|
||||
bool IsLocked() { return mIsLocked; };
|
||||
void Unlock() { mIsLocked = false; };
|
||||
|
||||
void Detach(wl_buffer* aBuffer);
|
||||
bool IsAttached() { return mAttached; }
|
||||
void SetAttached() { mAttached = true; };
|
||||
|
||||
void Clear();
|
||||
bool Resize(int aWidth, int aHeight);
|
||||
@ -101,7 +104,6 @@ class WindowBackBufferShm : public WindowBackBuffer {
|
||||
int GetHeight() { return mHeight; };
|
||||
|
||||
wl_buffer* GetWlBuffer() { return mWaylandBuffer; };
|
||||
void SetAttached() { mAttached = true; };
|
||||
|
||||
private:
|
||||
void Create(int aWidth, int aHeight);
|
||||
@ -116,6 +118,7 @@ class WindowBackBufferShm : public WindowBackBuffer {
|
||||
int mWidth;
|
||||
int mHeight;
|
||||
bool mAttached;
|
||||
bool mIsLocked;
|
||||
};
|
||||
|
||||
#ifdef HAVE_LIBDRM
|
||||
|
Loading…
Reference in New Issue
Block a user