Rename more mentions of "swapchain" to talk about "surface".
Bug: 42241264
Change-Id: I472e5cc707f55f799362622967705838b8d97d13
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/209095
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/docs/dawn/overview.md b/docs/dawn/overview.md
index 83269f1..0011587 100644
--- a/docs/dawn/overview.md
+++ b/docs/dawn/overview.md
@@ -19,7 +19,7 @@
- [`fuzzers`](../../src/dawn/fuzzers): various fuzzers for Dawn that are running in [Clusterfuzz](https://google.github.io/clusterfuzz/).
- [`native`](../../src/dawn/native): code for the implementation of WebGPU on top of graphics APIs. Files in this folder are the "frontend" while subdirectories are "backends".
- `<backend>`: code for the implementation of the backend on a specific graphics API, for example `d3d12`, `metal` or `vulkan`.
- - [`samples`](../../src/dawn/samples): a small collection of samples using the native WebGPU API. They were mostly used when bringing up Dawn for the first time, and to test the `WGPUSwapChain` object.
+ - [`samples`](../../src/dawn/samples): a small collection of samples using the native WebGPU API. They were mostly used when bringing up Dawn for the first time, and to test the `WGPUSurface` object.
- [`tests`](../../src/dawn/tests):
- [`end2end`](../../src/dawn/tests/end2end): tests for the execution of the WebGPU API and require a GPU to run.
- [`perf_tests`](../../src/dawn/tests/perf_tests): benchmarks for various aspects of Dawn.
diff --git a/src/dawn/samples/ManualSurfaceTest.cpp b/src/dawn/samples/ManualSurfaceTest.cpp
index cd4c147..ec71351 100644
--- a/src/dawn/samples/ManualSurfaceTest.cpp
+++ b/src/dawn/samples/ManualSurfaceTest.cpp
@@ -28,11 +28,11 @@
// This is an example to manually test surface code. Controls are the following, scoped to the
// currently focused window:
// - W: creates a new window.
-// - L: Latches the current swapchain, to check what happens when the window changes but not the
-// swapchain.
+// - L: Latches the current surface, to check what happens when the window changes but not the
+// surface.
// - R: switches the rendering mode, between "The Red Triangle" and color-cycling clears that's
// (WARNING) likely seizure inducing.
-// - D: cycles the divisor for the swapchain size.
+// - D: cycles the divisor for the surface size.
// - P: switches present modes.
// - A: switches alpha modes.
// - F: switches formats.
@@ -58,7 +58,7 @@
//
// - Resizing tests (with the triangle render mode):
// - Check that cycling divisors on the triangle produces lower and lower resolution triangles.
-// - Check latching the swapchain config and resizing the window a bunch (smaller, bigger, and
+// - Check latching the surface config and resizing the window a bunch (smaller, bigger, and
// diagonal aspect ratio).
//
// - Config change tests:
diff --git a/src/dawn/tests/end2end/DeviceLostTests.cpp b/src/dawn/tests/end2end/DeviceLostTests.cpp
index 8ff9d0f..5c58e37 100644
--- a/src/dawn/tests/end2end/DeviceLostTests.cpp
+++ b/src/dawn/tests/end2end/DeviceLostTests.cpp
@@ -201,9 +201,8 @@
})"));
}
-// Note that no device lost tests are done for swapchain because it is awkward to create a
-// wgpu::Surface in this file. SwapChainValidationTests.CreateSwapChainFailsAfterDevLost covers
-// this validation.
+// Note that no device lost tests are done for surface because it is awkward to create a
+// wgpu::Surface in this file. SurfaceTests.GetAfterDeviceLoss covers this validation.
// Tests that CreateTexture fails when device is lost
TEST_P(DeviceLostTest, CreateTextureFails) {
diff --git a/src/dawn/tests/end2end/SurfaceConfigurationValidationTests.cpp b/src/dawn/tests/end2end/SurfaceConfigurationValidationTests.cpp
index 10b4ae7..17c634b 100644
--- a/src/dawn/tests/end2end/SurfaceConfigurationValidationTests.cpp
+++ b/src/dawn/tests/end2end/SurfaceConfigurationValidationTests.cpp
@@ -71,7 +71,7 @@
ErrorLog() << "GLFW error " << code << " " << message;
});
- // GLFW can fail to start in headless environments, in which SwapChainTests are
+ // GLFW can fail to start in headless environments, in which SurfaceTests are
// inapplicable. Skip this cases without producing a test failure.
if (glfwInit() == GLFW_FALSE) {
GTEST_SKIP();
@@ -188,7 +188,7 @@
// Using any combination of the reported capability is ok for configuring the surface.
TEST_P(SurfaceConfigurationValidationTests, AnyCombinationOfCapabilities) {
// TODO(dawn:2320): Fails with "internal drawable creation failed" on the Windows NVIDIA CQ
- // builders but not locally. This is a similar limitation to SwapChainTests.SwitchPresentMode.
+ // builders but not locally. This is a similar limitation to SurfaceTests.SwitchPresentMode.
DAWN_SUPPRESS_TEST_IF(IsWindows() && IsVulkan() && IsNvidia());
wgpu::Surface surface = CreateTestSurface();
diff --git a/src/dawn/tests/end2end/SurfaceTests.cpp b/src/dawn/tests/end2end/SurfaceTests.cpp
index e675ad4..db61806 100644
--- a/src/dawn/tests/end2end/SurfaceTests.cpp
+++ b/src/dawn/tests/end2end/SurfaceTests.cpp
@@ -203,7 +203,7 @@
wgpu::SurfaceConfiguration baseConfig;
};
-// Basic test for creating a swapchain and presenting one frame.
+// Basic test for creating a surface and presenting one frame.
TEST_P(SurfaceTests, Basic) {
wgpu::Surface surface = CreateTestSurface();
@@ -231,7 +231,7 @@
surface.Configure(&config);
}
-// Test replacing the swapchain after GetCurrentTexture
+// Test reconfiguring the surface after GetCurrentTexture
TEST_P(SurfaceTests, ReconfigureAfterGetCurrentTexture) {
wgpu::Surface surface = CreateTestSurface();
wgpu::SurfaceConfiguration config = GetPreferredConfiguration(surface);
diff --git a/src/dawn/wire/client/Surface.cpp b/src/dawn/wire/client/Surface.cpp
index bae80db..3216bc5 100644
--- a/src/dawn/wire/client/Surface.cpp
+++ b/src/dawn/wire/client/Surface.cpp
@@ -93,7 +93,7 @@
WGPUStatus Surface::GetCapabilities(WGPUAdapter adapter,
WGPUSurfaceCapabilities* capabilities) const {
- // Return the capabilities that were provided when injecting the swapchain.
+ // Return the capabilities that were provided when injecting the surface.
capabilities->nextInChain = nullptr;
capabilities->usages = mSupportedUsages;