Commit 5669effd authored by Maksim Sisov's avatar Maksim Sisov Committed by Commit Bot

[ozone/wayland] Use only announced buffer formats.

It turned out that it was not a good idea to try to guess buffer
formats if a Wayland compositor had not announced supported buffer
formats.

If such a case happened (the Wayland compositor did not announce the
formats), guessing them resulted in crashes in YouTube videos
for example.

Thus, it's better to fallback to software GpuMemoryBuffers rather
than crashing.

What is more, the Wayland spec says it must announce the supported
formats once zwp_linux_dmabuf interface is bound, but in some versions
of the compositors it does not happen. It looks more like a bug, which
must be reported.

Bug: 890284
Change-Id: I9bd20019709b0cbd82fa9654627b825adceb479b
Reviewed-on: https://chromium-review.googlesource.com/1253641Reviewed-by: default avatarRobert Kroeger <rjkroege@chromium.org>
Commit-Queue: Maksim Sisov <msisov@igalia.com>
Cr-Commit-Position: refs/heads/master@{#595436}
parent d609030c
...@@ -25,12 +25,6 @@ class ClientNativePixmapFactoryWayland : public gfx::ClientNativePixmapFactory { ...@@ -25,12 +25,6 @@ class ClientNativePixmapFactoryWayland : public gfx::ClientNativePixmapFactory {
gfx::BufferUsage usage) const override { gfx::BufferUsage usage) const override {
OzonePlatform::PlatformProperties properties = OzonePlatform::PlatformProperties properties =
OzonePlatform::GetInstance()->GetPlatformProperties(); OzonePlatform::GetInstance()->GetPlatformProperties();
if (properties.supported_buffer_formats.empty()) {
// If the compositor did not announce supported buffer formats, do our
// best and assume those are supported.
return dmabuf_factory_->IsConfigurationSupported(format, usage);
}
for (auto buffer_format : properties.supported_buffer_formats) { for (auto buffer_format : properties.supported_buffer_formats) {
if (buffer_format == format) if (buffer_format == format)
return dmabuf_factory_->IsConfigurationSupported(format, usage); return dmabuf_factory_->IsConfigurationSupported(format, usage);
......
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