From 5b9b9867cde3fe452ab97d8afcc728f4f564b5d8 Mon Sep 17 00:00:00 2001 From: Shrek Shao Date: Wed, 9 Mar 2022 19:04:21 +0000 Subject: [PATCH] Rename SurfaceDescriptorFromXlib -> SurfaceDescriptorFromXlibWindow As suggested by https://github.com/webgpu-native/webgpu-headers/pull/150#discussion_r822311773 Bug: none Change-Id: I4f611a1c345eb644168cf923c6c0c1672114b9d9 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83201 Reviewed-by: Austin Eng Commit-Queue: Shrek Shao --- dawn.json | 4 ++-- dawn_wire.json | 2 +- src/dawn/native/Surface.cpp | 6 +++--- src/dawn/tests/end2end/WindowSurfaceTests.cpp | 6 +++--- src/dawn/utils/GLFWUtils.cpp | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dawn.json b/dawn.json index 812093f04f..073a17a9bf 100644 --- a/dawn.json +++ b/dawn.json @@ -2335,7 +2335,7 @@ {"name": "hwnd", "type": "void", "annotation": "*"} ] }, - "surface descriptor from xlib": { + "surface descriptor from xlib window": { "category": "structure", "chained": "in", "tags": ["native"], @@ -2406,7 +2406,7 @@ {"value": 0, "name": "invalid", "valid": false}, {"value": 1, "name": "surface descriptor from metal layer", "tags": ["native"]}, {"value": 2, "name": "surface descriptor from windows HWND", "tags": ["native"]}, - {"value": 3, "name": "surface descriptor from xlib", "tags": ["native"]}, + {"value": 3, "name": "surface descriptor from xlib window", "tags": ["native"]}, {"value": 4, "name": "surface descriptor from canvas HTML selector"}, {"value": 5, "name": "shader module SPIRV descriptor"}, {"value": 6, "name": "shader module WGSL descriptor"}, diff --git a/dawn_wire.json b/dawn_wire.json index 226321e701..5c66ed6aa4 100644 --- a/dawn_wire.json +++ b/dawn_wire.json @@ -174,7 +174,7 @@ "client_side_structures": [ "SurfaceDescriptorFromMetalLayer", "SurfaceDescriptorFromWindowsHWND", - "SurfaceDescriptorFromXlib", + "SurfaceDescriptorFromXlibWindow", "SurfaceDescriptorFromWindowsCoreWindow", "SurfaceDescriptorFromWindowsSwapChainPanel" ], diff --git a/src/dawn/native/Surface.cpp b/src/dawn/native/Surface.cpp index 564ebd7c05..bede05f09e 100644 --- a/src/dawn/native/Surface.cpp +++ b/src/dawn/native/Surface.cpp @@ -69,7 +69,7 @@ namespace dawn::native { wgpu::SType::SurfaceDescriptorFromWindowsHWND, wgpu::SType::SurfaceDescriptorFromWindowsCoreWindow, wgpu::SType::SurfaceDescriptorFromWindowsSwapChainPanel, - wgpu::SType::SurfaceDescriptorFromXlib)); + wgpu::SType::SurfaceDescriptorFromXlibWindow)); #if defined(DAWN_ENABLE_BACKEND_METAL) const SurfaceDescriptorFromMetalLayer* metalDesc = nullptr; @@ -116,7 +116,7 @@ namespace dawn::native { #endif // defined(DAWN_PLATFORM_WINDOWS) #if defined(DAWN_USE_X11) - const SurfaceDescriptorFromXlib* xDesc = nullptr; + const SurfaceDescriptorFromXlibWindow* xDesc = nullptr; FindInChain(descriptor->nextInChain, &xDesc); if (xDesc) { // Check the validity of the window by calling a getter function on the window that @@ -146,7 +146,7 @@ namespace dawn::native { const SurfaceDescriptorFromWindowsHWND* hwndDesc = nullptr; const SurfaceDescriptorFromWindowsCoreWindow* coreWindowDesc = nullptr; const SurfaceDescriptorFromWindowsSwapChainPanel* swapChainPanelDesc = nullptr; - const SurfaceDescriptorFromXlib* xDesc = nullptr; + const SurfaceDescriptorFromXlibWindow* xDesc = nullptr; FindInChain(descriptor->nextInChain, &metalDesc); FindInChain(descriptor->nextInChain, &hwndDesc); FindInChain(descriptor->nextInChain, &coreWindowDesc); diff --git a/src/dawn/tests/end2end/WindowSurfaceTests.cpp b/src/dawn/tests/end2end/WindowSurfaceTests.cpp index 0b91f7f56e..1974f3c750 100644 --- a/src/dawn/tests/end2end/WindowSurfaceTests.cpp +++ b/src/dawn/tests/end2end/WindowSurfaceTests.cpp @@ -181,12 +181,12 @@ TEST_F(WindowSurfaceInstanceTests, CorrectSTypeXlib) { GLFWwindow* window = CreateWindow(); std::unique_ptr chainedDescriptor = utils::SetupWindowAndGetSurfaceDescriptorForTesting(window); - ASSERT_EQ(chainedDescriptor->sType, wgpu::SType::SurfaceDescriptorFromXlib); + ASSERT_EQ(chainedDescriptor->sType, wgpu::SType::SurfaceDescriptorFromXlibWindow); } // Test with setting an invalid window TEST_F(WindowSurfaceInstanceTests, InvalidXWindow) { - wgpu::SurfaceDescriptorFromXlib chainedDescriptor; + wgpu::SurfaceDescriptorFromXlibWindow chainedDescriptor; chainedDescriptor.display = XOpenDisplay(nullptr); // From the "X Window System Protocol" "X Version 11, Release 6.8" page 2 at // https://www.x.org/releases/X11R7.5/doc/x11proto/proto.pdf @@ -203,7 +203,7 @@ TEST_F(WindowSurfaceInstanceTests, InvalidXWindow) { // Test using Xlib when it is not supported TEST_F(WindowSurfaceInstanceTests, XlibSurfacesAreInvalid) { - wgpu::SurfaceDescriptorFromXlib chainedDescriptor; + wgpu::SurfaceDescriptorFromXlibWindow chainedDescriptor; chainedDescriptor.display = nullptr; chainedDescriptor.window = 0; diff --git a/src/dawn/utils/GLFWUtils.cpp b/src/dawn/utils/GLFWUtils.cpp index 464d3cba25..de77ccd462 100644 --- a/src/dawn/utils/GLFWUtils.cpp +++ b/src/dawn/utils/GLFWUtils.cpp @@ -71,8 +71,8 @@ namespace utils { #elif defined(DAWN_USE_X11) std::unique_ptr SetupWindowAndGetSurfaceDescriptorForTesting( GLFWwindow* window) { - std::unique_ptr desc = - std::make_unique(); + std::unique_ptr desc = + std::make_unique(); desc->display = glfwGetX11Display(); desc->window = glfwGetX11Window(window); return std::move(desc);