зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1763727 [Wayland] Paint to Gtk owned wl_surface in main thread r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D143266
This commit is contained in:
Родитель
6bf955b1fb
Коммит
3b94e78ae2
|
@ -161,6 +161,23 @@ WindowSurfaceProvider::StartRemoteDrawingInRegion(
|
|||
|
||||
void WindowSurfaceProvider::EndRemoteDrawingInRegion(
|
||||
gfx::DrawTarget* aDrawTarget, const LayoutDeviceIntRegion& aInvalidRegion) {
|
||||
#if defined(MOZ_WAYLAND)
|
||||
if (GdkIsWaylandDisplay() && moz_container_wayland_is_commiting_to_parent(
|
||||
mWidget->GetMozContainer())) {
|
||||
// If we're drawing directly to wl_surface owned by Gtk we need to use it
|
||||
// in main thread to sync with Gtk access to it.
|
||||
NS_DispatchToMainThread(NS_NewRunnableFunction(
|
||||
"WindowSurfaceProvider::EndRemoteDrawingInRegion",
|
||||
[RefPtr{mWidget}, this, aInvalidRegion]() {
|
||||
MutexAutoLock lock(mMutex);
|
||||
// Commit to mWindowSurface only when we have a valid one.
|
||||
if (mWindowSurface && mWindowSurfaceValid) {
|
||||
mWindowSurface->Commit(aInvalidRegion);
|
||||
}
|
||||
}));
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
MutexAutoLock lock(mMutex);
|
||||
// Commit to mWindowSurface only when we have a valid one.
|
||||
if (mWindowSurface && mWindowSurfaceValid) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче