From 807e6b3367c4fde93c77dbb7c784064a28a7590f Mon Sep 17 00:00:00 2001 From: Jamie Madill Date: Mon, 2 Nov 2020 17:15:03 +0000 Subject: [PATCH] Revert "Add support for Linux vulkan backend with VK_KHR_display" This reverts commit a7bb6a9b15ddeb8497523f8871deb25de2676d9f. Reason for revert: Failing on Ozone builder, see bug. Bug: angleproject:5289 Original change's description: > Add support for Linux vulkan backend with VK_KHR_display > > Implement Linux simple display mode with vulkan backend > through VK_KHR_display. > > Added value 'EGL_PLATFORM_VULKAN_DISPLAY_MODE_SIMPLE_ANGLE' for > attribute EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE to identify > the new simple display mode. Also reserved > EGL_PLATFORM_VULKAN_DISPLAY_MODE_HEADLESS_ANGLE for headless mode. > > How to enable: > Add > > ``` > use_x11=false > angle_vulkan_display_mode="simple" # default value > ``` > > into args.gn, then compile with linux vulkan args. > > Bug: angleproject:5214 > Change-Id: I1247585b9de8b55df106aba99322281f1c183203 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2494320 > Commit-Queue: Jamie Madill > Reviewed-by: Jamie Madill > Reviewed-by: Shahbaz Youssefi TBR=syoussefi@chromium.org,sunny.sun@arm.com,jmadill@chromium.org,xiaoxuan.liu@arm.com Change-Id: I3e2a2a044c220ed8d25be0d82184e5fba7b9c06a No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:5214 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2514637 Reviewed-by: Jamie Madill Commit-Queue: Jamie Madill --- BUILD.gn | 9 -- extensions/EGL_ANGLE_platform_angle.txt | 1 - extensions/EGL_ANGLE_vulkan_display.txt | 95 ------------------- gni/angle.gni | 14 +-- include/EGL/eglext_angle.h | 2 - src/common/vulkan/vulkan_icd.h | 6 -- src/libANGLE/Display.cpp | 28 +----- src/libANGLE/renderer/vulkan/BUILD.gn | 9 -- src/libANGLE/renderer/vulkan/DisplayVk_api.h | 3 - .../vulkan/display/DisplayVkSimple.cpp | 64 ------------- .../renderer/vulkan/display/DisplayVkSimple.h | 41 -------- .../vulkan/display/WindowSurfaceVkSimple.cpp | 82 ---------------- .../vulkan/display/WindowSurfaceVkSimple.h | 31 ------ .../test_utils/angle_test_instantiate.cpp | 2 +- util/BUILD.gn | 10 +- util/display/DisplayPixmap.cpp | 16 ---- util/display/DisplayWindow.cpp | 87 ----------------- util/display/DisplayWindow.h | 51 ---------- 18 files changed, 8 insertions(+), 543 deletions(-) delete mode 100644 extensions/EGL_ANGLE_vulkan_display.txt delete mode 100644 src/libANGLE/renderer/vulkan/display/DisplayVkSimple.cpp delete mode 100644 src/libANGLE/renderer/vulkan/display/DisplayVkSimple.h delete mode 100644 src/libANGLE/renderer/vulkan/display/WindowSurfaceVkSimple.cpp delete mode 100644 src/libANGLE/renderer/vulkan/display/WindowSurfaceVkSimple.h delete mode 100644 util/display/DisplayPixmap.cpp delete mode 100644 util/display/DisplayWindow.cpp delete mode 100644 util/display/DisplayWindow.h diff --git a/BUILD.gn b/BUILD.gn index 8e35dc527..f65500307 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -114,15 +114,6 @@ config("internal_config") { if (is_ggp) { defines += [ "__ggp__" ] } - - if (angle_use_vulkan_display) { - defines += [ "ANGLE_USE_VULKAN_DISPLAY" ] - if (angle_vulkan_display_mode == "simple") { - defines += [ "ANGLE_VULKAN_DISPLAY_MODE_SIMPLE" ] - } else if (angle_vulkan_display_mode == "headless") { - defines += [ "ANGLE_VULKAN_DISPLAY_MODE_HEADLESS" ] - } - } } config("constructor_and_destructor_warnings") { diff --git a/extensions/EGL_ANGLE_platform_angle.txt b/extensions/EGL_ANGLE_platform_angle.txt index 9689e1d7a..c9f8a5062 100644 --- a/extensions/EGL_ANGLE_platform_angle.txt +++ b/extensions/EGL_ANGLE_platform_angle.txt @@ -71,7 +71,6 @@ New Tokens EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE 0x3204 EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE 0x3205 EGL_PLATFORM_ANGLE_DEBUG_LAYERS_ENABLED 0x3451 - EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE 0x348F Accepted as values for the EGL_PLATFORM_ANGLE_TYPE_ANGLE attribute: diff --git a/extensions/EGL_ANGLE_vulkan_display.txt b/extensions/EGL_ANGLE_vulkan_display.txt deleted file mode 100644 index 7f750a780..000000000 --- a/extensions/EGL_ANGLE_vulkan_display.txt +++ /dev/null @@ -1,95 +0,0 @@ -Name - - ANGLE_vulkan_display - -Name Strings - - EGL_ANGLE_vulkan_display - -Contributors - - Xiaoxuan Liu, Arm Ltd. - Sunny Sun, Arm Ltd. - -Contacts - - Xiaoxuan Liu, Arm Ltd. (xiaoxuan 'dot' liu 'at' arm 'dot' com) - -Status - - Draft - -Version - - Version 1, 2020-10-29 - -Number - - EGL Extension XXX - -Extension Type - - EGL client extension - -Dependencies - - Requires EGL_EXT_platform_angle_vulkan. - -Overview - - This extension allows ANGLE to use simple display mode through - VK_KHR_display without native platform support (e.g. X11, GBM). - The EGLSurfaces to be created from native types only contain the - basic width and height info. - -New Types - - The basic structure to represent a display window, used by vulkan - backend to create valid display with VK_KHR_display. - - typedef struct displayWindow - { - khronos_uint16_t width; - khronos_uint16_t height; - } DisplayWindow; - -New Procedures and Functions - - None - -New Tokens - - Accepted as values for the EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE - attribute: - - EGL_PLATFORM_VULKAN_DISPLAY_MODE_SIMPLE_ANGLE 0x34A4 - EGL_PLATFORM_VULKAN_DISPLAY_MODE_HEADLESS_ANGLE 0x34A5 - -Additions to the EGL Specification - - None - -New Behavior - - To obtain an simple EGLDisplay backed by a ANGLE vulkan with - VK_KHR_display, request a display that is backed by a Vulkan driver - through EGL_ANGLE_platform_angle_vulkan. And the value of attribute - EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE should be - EGL_PLATFORM_VULKAN_DISPLAY_MODE_SIMPLE_ANGLE or - EGL_PLATFORM_VULKAN_DISPLAY_MODE_HEADLESS_ANGLE. - - If an EGLDisplay is backed by ANGLE vulkan VK_KHR_display and the - value of attribute EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE is - set but neither EGL_PLATFORM_VULKAN_DISPLAY_MODE_SIMPLE_ANGLE or - EGL_PLATFORM_VULKAN_DISPLAY_MODE_HEADLESS_ANGLE, then EGL_NO_DISPLAY - should be returned. - -Issues - - None - -Revision History - - Version 1, 2020-10-29 (Xiaoxuan Liu) - - Initial draft - diff --git a/gni/angle.gni b/gni/angle.gni index 7558b9bf9..289d8bafe 100644 --- a/gni/angle.gni +++ b/gni/angle.gni @@ -9,9 +9,6 @@ declare_args() { # Extract native libs in ANGLE apk. Useful for flamegraph generation. angle_extract_native_libs = false - - # Display mode for ANGLE vulkan display, could be 'simple' or 'headless', default is 'simple'. - angle_vulkan_display_mode = "simple" } if (angle_has_build) { @@ -30,7 +27,6 @@ if (angle_has_build) { } angle_use_x11 = use_x11 && !is_ggp - angle_use_vulkan_display = is_linux && !use_x11 && !is_ggp } else { declare_args() { is_ubsan = false @@ -39,7 +35,6 @@ if (angle_has_build) { build_with_chromium = false dcheck_always_on = false angle_use_x11 = (is_linux || is_chromeos) && !is_ggp - angle_use_vulkan_display = is_linux && !angle_use_x11 && !is_ggp use_ozone = false ozone_platform_gbm = false use_fuzzing_engine = false @@ -106,11 +101,10 @@ declare_args() { # Vulkan Validation Layers compatibility issues, see http://crrev/c/1405714. # Otherwise, API level 24 would have been enough. angle_enable_vulkan = - angle_has_build && - ((is_win && !angle_is_winuwp) || - (is_linux && (angle_use_x11 || angle_use_vulkan_display) && - !is_chromeos) || (is_android && ndk_api_level_at_least_26) || - is_fuchsia || is_ggp || is_mac) + angle_has_build && ((is_win && !angle_is_winuwp) || + (is_linux && angle_use_x11 && !is_chromeos) || + (is_android && ndk_api_level_at_least_26) || + is_fuchsia || is_ggp || is_mac) angle_enable_null = true angle_enable_essl = true angle_enable_glsl = true diff --git a/include/EGL/eglext_angle.h b/include/EGL/eglext_angle.h index 5b237388a..b5b669521 100644 --- a/include/EGL/eglext_angle.h +++ b/include/EGL/eglext_angle.h @@ -94,8 +94,6 @@ #ifndef EGL_ANGLE_platform_angle_vulkan #define EGL_ANGLE_platform_angle_vulkan 1 #define EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE 0x3450 -#define EGL_PLATFORM_VULKAN_DISPLAY_MODE_SIMPLE_ANGLE 0x34A4 -#define EGL_PLATFORM_VULKAN_DISPLAY_MODE_HEADLESS_ANGLE 0x34A5 #endif /* EGL_ANGLE_platform_angle_vulkan */ #ifndef EGL_ANGLE_platform_angle_metal diff --git a/src/common/vulkan/vulkan_icd.h b/src/common/vulkan/vulkan_icd.h index 8479fbd14..c612c15c6 100644 --- a/src/common/vulkan/vulkan_icd.h +++ b/src/common/vulkan/vulkan_icd.h @@ -27,12 +27,6 @@ enum class ICD SwiftShader, }; -struct SimpleDisplayWindow -{ - uint16_t width; - uint16_t height; -}; - class ScopedVkLoaderEnvironment : angle::NonCopyable { public: diff --git a/src/libANGLE/Display.cpp b/src/libANGLE/Display.cpp index 4587da7e3..ccf24a57b 100644 --- a/src/libANGLE/Display.cpp +++ b/src/libANGLE/Display.cpp @@ -226,17 +226,11 @@ EGLAttrib GetDeviceTypeFromEnvironment() EGLAttrib GetPlatformTypeFromEnvironment() { -#if defined(ANGLE_USE_OZONE) - return 0; -#elif defined(ANGLE_USE_X11) +#if defined(ANGLE_USE_X11) && !defined(ANGLE_USE_OZONE) return EGL_PLATFORM_X11_EXT; -#elif defined(ANGLE_USE_VULKAN_DISPLAY) && defined(ANGLE_VULKAN_DISPLAY_MODE_SIMPLE) - return EGL_PLATFORM_VULKAN_DISPLAY_MODE_SIMPLE_ANGLE; -#elif defined(ANGLE_USE_VULKAN_DISPLAY) && defined(ANGLE_VULKAN_DISPLAY_MODE_HEADLESS) - return EGL_PLATFORM_VULKAN_DISPLAY_MODE_HEADLESS_ANGLE; #else return 0; -#endif // defined(ANGLE_USE_OZONE) +#endif } rx::DisplayImpl *CreateDisplayFromAttribs(EGLAttrib displayType, @@ -360,24 +354,6 @@ rx::DisplayImpl *CreateDisplayFromAttribs(EGLAttrib displayType, impl = rx::CreateVulkanXcbDisplay(state); break; } -# elif defined(ANGLE_USE_VULKAN_DISPLAY) - if (platformType == EGL_PLATFORM_VULKAN_DISPLAY_MODE_SIMPLE_ANGLE && - rx::IsVulkanSimpleDisplayAvailable()) - { - impl = rx::CreateVulkanSimpleDisplay(state); - } - else if (platformType == EGL_PLATFORM_VULKAN_DISPLAY_MODE_HEADLESS_ANGLE) - { - // TODO: anglebug.com/5260 - // Add support for headless rendering - UNIMPLEMENTED(); - } - else - { - // Not supported creation type on vulkan display, fail display creation. - impl = nullptr; - } - break; # endif # elif defined(ANGLE_PLATFORM_ANDROID) if (rx::IsVulkanAndroidDisplayAvailable()) diff --git a/src/libANGLE/renderer/vulkan/BUILD.gn b/src/libANGLE/renderer/vulkan/BUILD.gn index 54c461481..34591a4a4 100644 --- a/src/libANGLE/renderer/vulkan/BUILD.gn +++ b/src/libANGLE/renderer/vulkan/BUILD.gn @@ -101,15 +101,6 @@ _vulkan_backend_sources = [ "vk_wrapper.h", ] -if (is_linux) { - _vulkan_backend_sources += [ - "display/DisplayVkSimple.cpp", - "display/DisplayVkSimple.h", - "display/WindowSurfaceVkSimple.cpp", - "display/WindowSurfaceVkSimple.h", - ] -} - if (is_android) { _vulkan_backend_sources += [ "android/DisplayVkAndroid.cpp", diff --git a/src/libANGLE/renderer/vulkan/DisplayVk_api.h b/src/libANGLE/renderer/vulkan/DisplayVk_api.h index 03a627f9f..21e36a76b 100644 --- a/src/libANGLE/renderer/vulkan/DisplayVk_api.h +++ b/src/libANGLE/renderer/vulkan/DisplayVk_api.h @@ -22,9 +22,6 @@ DisplayImpl *CreateVulkanWin32Display(const egl::DisplayState &state); #if defined(ANGLE_PLATFORM_LINUX) bool IsVulkanXcbDisplayAvailable(); DisplayImpl *CreateVulkanXcbDisplay(const egl::DisplayState &state); - -bool IsVulkanSimpleDisplayAvailable(); -DisplayImpl *CreateVulkanSimpleDisplay(const egl::DisplayState &state); #endif // defined(ANGLE_PLATFORM_LINUX) #if defined(ANGLE_PLATFORM_ANDROID) diff --git a/src/libANGLE/renderer/vulkan/display/DisplayVkSimple.cpp b/src/libANGLE/renderer/vulkan/display/DisplayVkSimple.cpp deleted file mode 100644 index 5cdb63d68..000000000 --- a/src/libANGLE/renderer/vulkan/display/DisplayVkSimple.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// -// Copyright 2020 The ANGLE Project Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// -// DisplayVkSimple.cpp: -// Implements the class methods for DisplayVkSimple. -// - -#include "DisplayVkSimple.h" -#include "WindowSurfaceVkSimple.h" - -#include "libANGLE/Display.h" -#include "libANGLE/renderer/vulkan/RendererVk.h" -#include "libANGLE/renderer/vulkan/vk_caps_utils.h" - -namespace rx -{ - -DisplayVkSimple::DisplayVkSimple(const egl::DisplayState &state) : DisplayVk(state) {} - -void DisplayVkSimple::terminate() -{ - DisplayVk::terminate(); -} - -bool DisplayVkSimple::isValidNativeWindow(EGLNativeWindowType window) const -{ - return true; -} - -SurfaceImpl *DisplayVkSimple::createWindowSurfaceVk(const egl::SurfaceState &state, - EGLNativeWindowType window) -{ - return new WindowSurfaceVkSimple(state, window); -} - -egl::ConfigSet DisplayVkSimple::generateConfigs() -{ - constexpr GLenum kColorFormats[] = {GL_RGBA8, GL_BGRA8_EXT, GL_RGB565, GL_RGB8}; - - return egl_vk::GenerateConfigs(kColorFormats, egl_vk::kConfigDepthStencilFormats, this); -} - -// TODO: anglebug.com/5214 -// Detemine if check is needed. -void DisplayVkSimple::checkConfigSupport(egl::Config *config) {} - -const char *DisplayVkSimple::getWSIExtension() const -{ - return VK_KHR_DISPLAY_EXTENSION_NAME; -} - -bool IsVulkanSimpleDisplayAvailable() -{ - return true; -} - -DisplayImpl *CreateVulkanSimpleDisplay(const egl::DisplayState &state) -{ - return new DisplayVkSimple(state); -} - -} // namespace rx diff --git a/src/libANGLE/renderer/vulkan/display/DisplayVkSimple.h b/src/libANGLE/renderer/vulkan/display/DisplayVkSimple.h deleted file mode 100644 index 2ac304201..000000000 --- a/src/libANGLE/renderer/vulkan/display/DisplayVkSimple.h +++ /dev/null @@ -1,41 +0,0 @@ -// -// Copyright 2020 The ANGLE Project Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// -// DisplayVkSimple.h: -// Defines the class interface for DisplayVkSimple, implementing -// DisplayVk for Linux via VK_KHR_display. -// - -#ifndef LIBANGLE_RENDERER_VULKAN_DISPLAY_DISPLAYVKSIMPLE_H_ -#define LIBANGLE_RENDERER_VULKAN_DISPLAY_DISPLAYVKSIMPLE_H_ - -#include "libANGLE/renderer/vulkan/DisplayVk.h" - -namespace rx -{ - -class DisplayVkSimple : public DisplayVk -{ - public: - DisplayVkSimple(const egl::DisplayState &state); - void terminate() override; - - bool isValidNativeWindow(EGLNativeWindowType window) const override; - - SurfaceImpl *createWindowSurfaceVk(const egl::SurfaceState &state, - EGLNativeWindowType window) override; - - egl::ConfigSet generateConfigs() override; - void checkConfigSupport(egl::Config *config) override; - - const char *getWSIExtension() const override; - - private: - std::vector mSurfaceFormats; -}; - -} // namespace rx - -#endif // LIBANGLE_RENDERER_VULKAN_DISPLAY_DISPLAYVKSIMPLE_H_ diff --git a/src/libANGLE/renderer/vulkan/display/WindowSurfaceVkSimple.cpp b/src/libANGLE/renderer/vulkan/display/WindowSurfaceVkSimple.cpp deleted file mode 100644 index d96bf530d..000000000 --- a/src/libANGLE/renderer/vulkan/display/WindowSurfaceVkSimple.cpp +++ /dev/null @@ -1,82 +0,0 @@ -// -// Copyright 2020 The ANGLE Project Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// -// WindowSurfaceVkSimple.cpp: -// Implements the class methods for WindowSurfaceVkSimple. -// - -#include "WindowSurfaceVkSimple.h" -#include "libANGLE/renderer/vulkan/RendererVk.h" - -namespace rx -{ - -WindowSurfaceVkSimple::WindowSurfaceVkSimple(const egl::SurfaceState &surfaceState, - EGLNativeWindowType window) - : WindowSurfaceVk(surfaceState, window) -{} - -WindowSurfaceVkSimple::~WindowSurfaceVkSimple() {} - -angle::Result WindowSurfaceVkSimple::createSurfaceVk(vk::Context *context, gl::Extents *extentsOut) -{ - RendererVk *renderer = context->getRenderer(); - ASSERT(renderer != nullptr); - VkInstance instance = renderer->getInstance(); - VkPhysicalDevice physicalDevice = renderer->getPhysicalDevice(); - - // Query if there is a valid display - uint32_t count = 1; - ANGLE_VK_TRY(context, vkGetPhysicalDeviceDisplayPropertiesKHR(physicalDevice, &count, nullptr)); - - // Get display properties - VkDisplayPropertiesKHR prop = {}; - count = 1; - ANGLE_VK_TRY(context, vkGetPhysicalDeviceDisplayPropertiesKHR(physicalDevice, &count, &prop)); - - // we should have a valid display now - ASSERT(prop.display != VK_NULL_HANDLE); - ANGLE_VK_TRY(context, - vkGetDisplayModePropertiesKHR(physicalDevice, prop.display, &count, nullptr)); - - ASSERT(count != 0); - std::vector modeProperties(count); - ANGLE_VK_TRY(context, vkGetDisplayModePropertiesKHR(physicalDevice, prop.display, &count, - modeProperties.data())); - - angle::vk::SimpleDisplayWindow *displayWindow = - reinterpret_cast(mNativeWindowType); - VkDisplaySurfaceCreateInfoKHR info = {}; - info.sType = VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR; - info.flags = 0; - info.displayMode = modeProperties[0].displayMode; - info.planeIndex = 0; - info.planeStackIndex = 0; - info.transform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR; - info.globalAlpha = 1.0f; - info.alphaMode = VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR; - info.imageExtent.width = displayWindow->width; - info.imageExtent.height = displayWindow->height; - - ANGLE_VK_TRY(context, vkCreateDisplayPlaneSurfaceKHR(instance, &info, nullptr, &mSurface)); - - return getCurrentWindowSize(context, extentsOut); -} - -angle::Result WindowSurfaceVkSimple::getCurrentWindowSize(vk::Context *context, - gl::Extents *extentsOut) -{ - RendererVk *renderer = context->getRenderer(); - const VkPhysicalDevice &physicalDevice = renderer->getPhysicalDevice(); - - ANGLE_VK_TRY(context, vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice, mSurface, - &mSurfaceCaps)); - - *extentsOut = - gl::Extents(mSurfaceCaps.currentExtent.width, mSurfaceCaps.currentExtent.height, 1); - return angle::Result::Continue; -} - -} // namespace rx diff --git a/src/libANGLE/renderer/vulkan/display/WindowSurfaceVkSimple.h b/src/libANGLE/renderer/vulkan/display/WindowSurfaceVkSimple.h deleted file mode 100644 index e5412add3..000000000 --- a/src/libANGLE/renderer/vulkan/display/WindowSurfaceVkSimple.h +++ /dev/null @@ -1,31 +0,0 @@ -// -// Copyright 2020 The ANGLE Project Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// -// WindowSurfaceVkSimple.h: -// Defines the class interface for WindowSurfaceVkSimple, implementing WindowSurfaceVk. -// - -#ifndef LIBANGLE_RENDERER_VULKAN_DISPLAY_WINDOWSURFACEVKSIMPLE_H_ -#define LIBANGLE_RENDERER_VULKAN_DISPLAY_WINDOWSURFACEVKSIMPLE_H_ - -#include "libANGLE/renderer/vulkan/SurfaceVk.h" - -namespace rx -{ - -class WindowSurfaceVkSimple : public WindowSurfaceVk -{ - public: - WindowSurfaceVkSimple(const egl::SurfaceState &surfaceState, EGLNativeWindowType window); - ~WindowSurfaceVkSimple() final; - - private: - angle::Result createSurfaceVk(vk::Context *context, gl::Extents *extentsOut) override; - angle::Result getCurrentWindowSize(vk::Context *context, gl::Extents *extentsOut) override; -}; - -} // namespace rx - -#endif // LIBANGLE_RENDERER_VULKAN_DISPLAY_WINDOWSURFACEVKSIMPLE_H_ diff --git a/src/tests/test_utils/angle_test_instantiate.cpp b/src/tests/test_utils/angle_test_instantiate.cpp index 1c4eb0731..3b8d92518 100644 --- a/src/tests/test_utils/angle_test_instantiate.cpp +++ b/src/tests/test_utils/angle_test_instantiate.cpp @@ -233,7 +233,7 @@ bool IsARM64() bool IsOzone() { -#if defined(USE_OZONE) && (defined(USE_X11) || defined(ANGLE_USE_VULKAN_DISPLAY)) +#if defined(USE_OZONE) && defined(USE_X11) // We do not have a proper support for Ozone/Linux yet. Still, we need to figure out how to // properly initialize tests and differentiate between X11 and Wayland. Probably, passing a // command line argument could be sufficient. At the moment, run tests only for X11 backend diff --git a/util/BUILD.gn b/util/BUILD.gn index a95218e94..c4d3ede53 100644 --- a/util/BUILD.gn +++ b/util/BUILD.gn @@ -40,14 +40,6 @@ if (is_win) { } } -if (is_linux) { - _util_sources += [ - "display/DisplayPixmap.cpp", - "display/DisplayWindow.cpp", - "display/DisplayWindow.h", - ] -} - if (angle_use_x11) { _util_sources += [ "x11/X11Pixmap.cpp", @@ -64,7 +56,7 @@ if (is_fuchsia) { "fuchsia/ScenicWindow.cpp", "fuchsia/ScenicWindow.h", ] -} else if (use_ozone && !angle_use_x11 && !angle_use_vulkan_display) { +} else if (use_ozone && !angle_use_x11) { # Use X11 impl by default otherwise switch to fake Ozone impl that does not # seem to do anything real. # TODO(msisov): probably, we need to have a proper support for different diff --git a/util/display/DisplayPixmap.cpp b/util/display/DisplayPixmap.cpp deleted file mode 100644 index 27d2734a3..000000000 --- a/util/display/DisplayPixmap.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// -// Copyright 2020 The ANGLE Project Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// - -// DisplayPixmap.cpp: Implementation of OSPixmap for Linux Display - -#include "util/OSPixmap.h" - -#if defined(ANGLE_USE_VULKAN_DISPLAY) -OSPixmap *CreateOSPixmap() -{ - return nullptr; -} -#endif diff --git a/util/display/DisplayWindow.cpp b/util/display/DisplayWindow.cpp deleted file mode 100644 index d11f52262..000000000 --- a/util/display/DisplayWindow.cpp +++ /dev/null @@ -1,87 +0,0 @@ -// -// Copyright 2020 The ANGLE Project Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// - -// DisplayWindow.cpp: Implementation of OSWindow for Linux Display - -#include "util/display/DisplayWindow.h" - -#include "common/debug.h" -#include "util/Timer.h" -#include "util/test_utils.h" - -DisplayWindow::DisplayWindow() -{ - mWindow.width = 0; - mWindow.height = 0; -} - -DisplayWindow::~DisplayWindow() {} - -bool DisplayWindow::initializeImpl(const std::string &name, int width, int height) -{ - return resize(width, height); -} - -void DisplayWindow::disableErrorMessageDialog() {} - -void DisplayWindow::destroy() {} - -void DisplayWindow::resetNativeWindow() {} - -EGLNativeWindowType DisplayWindow::getNativeWindow() const -{ - return (EGLNativeWindowType)&mWindow; -} - -EGLNativeDisplayType DisplayWindow::getNativeDisplay() const -{ - return NULL; -} - -void DisplayWindow::messageLoop() {} - -void DisplayWindow::setMousePosition(int x, int y) -{ - UNIMPLEMENTED(); -} - -bool DisplayWindow::setOrientation(int width, int height) -{ - UNIMPLEMENTED(); - return true; -} - -bool DisplayWindow::setPosition(int x, int y) -{ - UNIMPLEMENTED(); - return true; -} - -bool DisplayWindow::resize(int width, int height) -{ - mWindow.width = width; - mWindow.height = height; - return true; -} - -void DisplayWindow::setVisible(bool isVisible) {} - -void DisplayWindow::signalTestEvent() -{ - Event event; - event.Type = Event::EVENT_TEST; - event.Move.X = 0; - event.Move.Y = 0; - pushEvent(event); -} - -// static -#if defined(ANGLE_USE_VULKAN_DISPLAY) -OSWindow *OSWindow::New() -{ - return new DisplayWindow(); -} -#endif diff --git a/util/display/DisplayWindow.h b/util/display/DisplayWindow.h deleted file mode 100644 index 463fe4491..000000000 --- a/util/display/DisplayWindow.h +++ /dev/null @@ -1,51 +0,0 @@ -// -// Copyright 2020 The ANGLE Project Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// - -// DisplayWindow.h: Definition of the implementation of OSWindow for Linux Display - -#ifndef UTIL_DISPLAY_WINDOW_H_ -#define UTIL_DISPLAY_WINDOW_H_ - -#include -#include "util/OSWindow.h" -#include "util/util_export.h" - -struct SimpleDisplayWindow -{ - uint16_t width; - uint16_t height; -}; - -class ANGLE_UTIL_EXPORT DisplayWindow : public OSWindow -{ - public: - DisplayWindow(); - DisplayWindow(int visualId); - ~DisplayWindow() override; - - void disableErrorMessageDialog() override; - void destroy() override; - - void resetNativeWindow() override; - EGLNativeWindowType getNativeWindow() const override; - EGLNativeDisplayType getNativeDisplay() const override; - - void messageLoop() override; - - void setMousePosition(int x, int y) override; - bool setOrientation(int width, int height) override; - bool setPosition(int x, int y) override; - bool resize(int width, int height) override; - void setVisible(bool isVisible) override; - - void signalTestEvent() override; - - private: - bool initializeImpl(const std::string &name, int width, int height) override; - SimpleDisplayWindow mWindow; -}; - -#endif // UTIL_DISPLAY_WINDOW_H_