Commit 21f77aaa authored by Maksim Sisov's avatar Maksim Sisov Committed by Commit Bot

X11 and Ozone: cleanup //components for use_x11 && use_ozone build.

Removes unnecessary case for surface handle (non-Ozone X11 and Ozone has
the same type of AcceleratedWidget now), chooses correct path based on
OzonePlatform feature usage.

-----

PS: Please note that this is a temp solution that will help to choose
between ozone and non-ozone X11 build. The switch that will be used
to choose the path is --enable-features=UseOzonePlatform. Once
non-Ozone X11 path is removed (hopefully by Q1 2021 depending on how
th finch trial goes), the wrapper will be removed.

Please also note that it's impossible to build use_x11 && use_ozone
without some hacks in PlatformCursor code. The changes to that are
on their way to upstream.

----

Bug: 1085700
Change-Id: I3f82aa08d02e8daa58ab39831b67ddb91d25913c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2315026Reviewed-by: default avatarRobert Kroeger <rjkroege@chromium.org>
Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Commit-Queue: Maksim Sisov (GMT+3) <msisov@igalia.com>
Cr-Commit-Position: refs/heads/master@{#791781}
parent 53df7567
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "ui/base/models/menu_model.h" #include "ui/base/models/menu_model.h"
#include "ui/base/models/menu_separator_types.h" #include "ui/base/models/menu_separator_types.h"
#include "ui/base/models/simple_menu_model.h" #include "ui/base/models/simple_menu_model.h"
#include "ui/base/ui_base_features.h"
#include "ui/gfx/image/image.h" #include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_skia.h" #include "ui/gfx/image/image_skia.h"
#include "ui/gfx/image/image_skia_rep_default.h" #include "ui/gfx/image/image_skia_rep_default.h"
...@@ -319,6 +320,8 @@ TEST(MenuPropertyListTest, ComputePropertiesIcon) { ...@@ -319,6 +320,8 @@ TEST(MenuPropertyListTest, ComputePropertiesIcon) {
#if defined(USE_X11) #if defined(USE_X11)
TEST(MenuPropertyListTest, ComputePropertiesAccelerator) { TEST(MenuPropertyListTest, ComputePropertiesAccelerator) {
if (features::IsUsingOzonePlatform())
return;
auto builder = TestMenuModelBuilder(); auto builder = TestMenuModelBuilder();
// No accelerator. // No accelerator.
......
...@@ -289,11 +289,7 @@ void HostGpuMemoryBufferManager::OnConnectionError() { ...@@ -289,11 +289,7 @@ void HostGpuMemoryBufferManager::OnConnectionError() {
<< ", format = " << gfx::BufferFormatToString(buffer.format) << ", format = " << gfx::BufferFormatToString(buffer.format)
<< ", usage = " << gfx::BufferUsageToString(buffer.usage) << ", usage = " << gfx::BufferUsageToString(buffer.usage)
<< ", surface_handle = " << ", surface_handle = "
#if defined(USE_X11)
<< static_cast<uint32_t>(buffer.surface_handle)
#else
<< buffer.surface_handle << buffer.surface_handle
#endif
<< " due to connection error"; << " due to connection error";
AllocateGpuMemoryBuffer( AllocateGpuMemoryBuffer(
buffer_pair.first, client_pair.first, buffer.size, buffer.format, buffer_pair.first, client_pair.first, buffer.size, buffer.format,
......
...@@ -110,9 +110,6 @@ class StubGpuMemoryBufferManager : public TestGpuMemoryBufferManager { ...@@ -110,9 +110,6 @@ class StubGpuMemoryBufferManager : public TestGpuMemoryBufferManager {
#if defined(OS_WIN) #if defined(OS_WIN)
const gpu::SurfaceHandle kFakeSurfaceHandle = const gpu::SurfaceHandle kFakeSurfaceHandle =
reinterpret_cast<gpu::SurfaceHandle>(1); reinterpret_cast<gpu::SurfaceHandle>(1);
#elif defined(USE_X11)
const gpu::SurfaceHandle kFakeSurfaceHandle =
static_cast<gpu::SurfaceHandle>(1);
#else #else
const gpu::SurfaceHandle kFakeSurfaceHandle = 1; const gpu::SurfaceHandle kFakeSurfaceHandle = 1;
#endif #endif
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "gpu/config/gpu_util.h" #include "gpu/config/gpu_util.h"
#include "gpu/ipc/service/gpu_watchdog_thread.h" #include "gpu/ipc/service/gpu_watchdog_thread.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/ui_base_features.h"
#include "ui/gl/init/gl_factory.h" #include "ui/gl/init/gl_factory.h"
#if BUILDFLAG(ENABLE_VULKAN) #if BUILDFLAG(ENABLE_VULKAN)
...@@ -34,7 +35,6 @@ ...@@ -34,7 +35,6 @@
#endif #endif
#if defined(USE_OZONE) #if defined(USE_OZONE)
#include "ui/base/ui_base_features.h"
#include "ui/ozone/public/ozone_platform.h" #include "ui/ozone/public/ozone_platform.h"
#endif #endif
...@@ -204,15 +204,20 @@ void TestGpuServiceHolder::InitializeOnGpuThread( ...@@ -204,15 +204,20 @@ void TestGpuServiceHolder::InitializeOnGpuThread(
#if BUILDFLAG(ENABLE_VULKAN) #if BUILDFLAG(ENABLE_VULKAN)
bool use_swiftshader = gpu_preferences.use_vulkan == bool use_swiftshader = gpu_preferences.use_vulkan ==
gpu::VulkanImplementationName::kSwiftshader; gpu::VulkanImplementationName::kSwiftshader;
bool is_non_ozone_x11 = false;
#if defined(USE_X11)
is_non_ozone_x11 = !features::IsUsingOzonePlatform();
#endif // defined(USE_X11)
if (!is_non_ozone_x11) {
// TODO(samans): Support Swiftshader on more platforms.
// https://crbug.com/963988
LOG_IF(ERROR, use_swiftshader) << "Unable to use Vulkan Swiftshader on "
"this platform. Falling back to "
"GPU.";
use_swiftshader = false;
}
#if !defined(USE_X11)
// TODO(samans): Support Swiftshader on more platforms.
// https://crbug.com/963988
LOG_IF(ERROR, use_swiftshader)
<< "Unable to use Vulkan Swiftshader on this platform. Falling back to "
"GPU.";
use_swiftshader = false;
#endif // !defined(USE_X11)
vulkan_implementation_ = gpu::CreateVulkanImplementation(use_swiftshader); vulkan_implementation_ = gpu::CreateVulkanImplementation(use_swiftshader);
if (!vulkan_implementation_ || if (!vulkan_implementation_ ||
!vulkan_implementation_->InitializeVulkanInstance( !vulkan_implementation_->InitializeVulkanInstance(
......
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