Skip to content

Commit

Permalink
Bug 1950458 [Wayland] Don't map NativeLayerWayland if it's waiting to…
Browse files Browse the repository at this point in the history
… be cleaned up at main thread r=lsalzman

Differential Revision: https://phabricator.services.mozilla.com/D239882
  • Loading branch information
stransky committed Feb 28, 2025
1 parent 2fd549d commit c19cc1a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gfx/layers/NativeLayerWayland.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -670,10 +670,17 @@ void NativeLayerWayland::RemoveAttachedBufferLocked(

bool NativeLayerWayland::Map(WaylandSurfaceLock* aParentWaylandSurfaceLock) {
MutexAutoLock lock(mMutex);

if (mNeedsMainThreadUpdate == MainThreadUpdate::Unmap) {
LOG("NativeLayerWayland::Map() waiting to MainThreadUpdate::Unmap");
return false;
}

LOG("NativeLayerWayland::Map() parent %p", mRootLayer.get());

WaylandSurfaceLock surfaceLock(mSurface);
MOZ_DIAGNOSTIC_ASSERT(!mSurface->IsMapped());
MOZ_DIAGNOSTIC_ASSERT(mNeedsMainThreadUpdate != MainThreadUpdate::Map);

if (!mSurface->MapLocked(surfaceLock, aParentWaylandSurfaceLock,
gfx::IntPoint(0, 0))) {
Expand Down

0 comments on commit c19cc1a

Please sign in to comment.