Commit e8811840 authored by Maksim Sisov's avatar Maksim Sisov Committed by Commit Bot

Ozone/X11/Linux/Cros: Do not use sync extension.

1) It is possible to use ChromeOS Chromium builds and run them
on Linux machines for development. However, we have made
a lot of changes to Ozone/X11 recently, and it started to
rely on XSync protocol that ChromeOS has never used (that is,
DesktopWindowTreeHostLinux (not used on ChromeOS) listens
to swap completions using CompositorObserver (previously,
it was DesktopWindowTreeHostX11 doing it) and notifies
X11 about swap completions with new sizes during interactive
resizes). Previously, X11WindowOzone implementation did not
use that extension and ChromeOS/X11/Ozone builds could be
run fine on X11 and users could resize the native window
without any issues. Now, the resizing operation either stucks
or works with glitches.

Thus, to fix that, just disable that extension for ChromeOS.

2) Linux/Ozone/X11 builds suffer from the same problem. However,
they do listen for swap completions using CompositorObserver, but
EGL implementation for Ozone/X11 is quite limited and most of the
code is guarded with USE_X11 define. We need to fix that first and
only then start to use XSync protocol. Otherwise, the swap results
may be sent with delays of several hundreds of ms.

Thus, to fix that, explicitly disable the extension for ChromeOS
builds.

Bug: 1036070, 1036285
Change-Id: I9bc3f5d042c6e8046aaa13bcff42508e433fad28
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1978740
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#727231}
parent 010436c8
......@@ -1281,11 +1281,24 @@ gfx::ICCProfile GetICCProfileForMonitor(int monitor) {
}
bool IsSyncExtensionAvailable() {
// Chrome for ChromeOS can be run with X11 on a Linux desktop. In this case,
// NotifySwapAfterResize is never called as the compositor does not notify about
// swaps after resize. Thus, simply disable usage of XSyncCounter on ChromeOS
// builds.
//
// TODO(https://crbug.com/1036285): Also, disable sync extension for all ozone
// builds as long as our EGL impl for Ozone/X11 is not mature enough and we do
// not receive swap completions on time, which results in weird resize behaviour
// as X Server waits for the XSyncCounter changes.
#if defined(OS_CHROMEOS) || defined(USE_OZONE)
return false;
#else
auto* display = gfx::GetXDisplay();
int unused;
static bool result = XSyncQueryExtension(display, &unused, &unused) &&
XSyncInitialize(display, &unused, &unused);
return result;
#endif
}
SkColorType ColorTypeForVisual(void* visual) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment