From a521c962b1e7d3c23efd5d78d0c0c01d1f5084e6 Mon Sep 17 00:00:00 2001 From: Stephen White Date: Wed, 4 Dec 2019 09:57:48 -0500 Subject: [PATCH] Update dawn.h -> webgpu.h, dawn_cpp.h -> webgpu_cpp.h. Also fix some compile breakages from recent Skia changes. No changes to Skia API. Change-Id: Ifd0b1d89fb4ea3cf1f6a7170f2f74614276364ae Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257877 Commit-Queue: Stephen White Commit-Queue: Mike Klein Reviewed-by: Mike Reed Reviewed-by: Greg Daniel --- include/gpu/GrBackendSurface.h | 2 +- include/gpu/dawn/GrDawnTypes.h | 2 +- src/gpu/GrLegacyDirectContext.cpp | 4 ++-- src/gpu/dawn/GrDawnBuffer.h | 2 +- src/gpu/dawn/GrDawnGpu.cpp | 2 +- src/gpu/dawn/GrDawnGpu.h | 2 +- src/gpu/dawn/GrDawnOpsRenderPass.h | 2 +- src/gpu/dawn/GrDawnProgramBuilder.cpp | 2 +- src/gpu/dawn/GrDawnProgramBuilder.h | 2 +- src/gpu/dawn/GrDawnProgramDataManager.h | 2 +- src/gpu/dawn/GrDawnRingBuffer.h | 2 +- src/gpu/dawn/GrDawnStagingManager.cpp | 2 +- src/gpu/dawn/GrDawnStagingManager.h | 2 +- src/gpu/dawn/GrDawnStencilAttachment.h | 2 +- src/gpu/dawn/GrDawnTexture.h | 2 +- src/gpu/dawn/GrDawnUtil.h | 2 +- tools/gpu/dawn/DawnTestContext.cpp | 6 +++--- tools/sk_app/DawnWindowContext.cpp | 2 +- tools/sk_app/DawnWindowContext.h | 2 +- tools/sk_app/mac/DawnMTLWindowContext_mac.mm | 2 +- tools/sk_app/unix/WindowContextFactory_unix.h | 4 ++-- tools/sk_app/win/DawnD3D12WindowContext_win.cpp | 2 +- 22 files changed, 26 insertions(+), 26 deletions(-) diff --git a/include/gpu/GrBackendSurface.h b/include/gpu/GrBackendSurface.h index 4983eb8495..e47625e767 100644 --- a/include/gpu/GrBackendSurface.h +++ b/include/gpu/GrBackendSurface.h @@ -23,7 +23,7 @@ class GrVkImageLayout; class GrGLTextureParameters; #ifdef SK_DAWN -#include "dawn/dawncpp.h" +#include "dawn/webgpu_cpp.h" #endif #ifdef SK_METAL diff --git a/include/gpu/dawn/GrDawnTypes.h b/include/gpu/dawn/GrDawnTypes.h index 7ec9b3d086..1b7bfe5c67 100644 --- a/include/gpu/dawn/GrDawnTypes.h +++ b/include/gpu/dawn/GrDawnTypes.h @@ -20,7 +20,7 @@ static constexpr int Success = 0; #undef None static constexpr int None = 0L; #endif -#include "dawn/dawncpp.h" +#include "dawn/webgpu_cpp.h" struct GrDawnImageInfo { wgpu::Texture fTexture; diff --git a/src/gpu/GrLegacyDirectContext.cpp b/src/gpu/GrLegacyDirectContext.cpp index 13530014da..34002a88fa 100644 --- a/src/gpu/GrLegacyDirectContext.cpp +++ b/src/gpu/GrLegacyDirectContext.cpp @@ -224,12 +224,12 @@ sk_sp GrContext::MakeMetal(void* device, void* queue, const GrContext #endif #ifdef SK_DAWN -sk_sp GrContext::MakeDawn(const dawn::Device& device) { +sk_sp GrContext::MakeDawn(const wgpu::Device& device) { GrContextOptions defaultOptions; return MakeDawn(device, defaultOptions); } -sk_sp GrContext::MakeDawn(const dawn::Device& device, const GrContextOptions& options) { +sk_sp GrContext::MakeDawn(const wgpu::Device& device, const GrContextOptions& options) { sk_sp context(new GrLegacyDirectContext(GrBackendApi::kDawn, options)); context->fGpu = GrDawnGpu::Make(device, options, context.get()); diff --git a/src/gpu/dawn/GrDawnBuffer.h b/src/gpu/dawn/GrDawnBuffer.h index 1d762e5630..52a03a84db 100644 --- a/src/gpu/dawn/GrDawnBuffer.h +++ b/src/gpu/dawn/GrDawnBuffer.h @@ -9,7 +9,7 @@ #define GrDawnBuffer_DEFINED #include "src/gpu/GrGpuBuffer.h" -#include "dawn/dawncpp.h" +#include "dawn/webgpu_cpp.h" class GrDawnGpu; struct GrDawnStagingBuffer; diff --git a/src/gpu/dawn/GrDawnGpu.cpp b/src/gpu/dawn/GrDawnGpu.cpp index 18aa4ebaeb..1fbbb9ab13 100644 --- a/src/gpu/dawn/GrDawnGpu.cpp +++ b/src/gpu/dawn/GrDawnGpu.cpp @@ -463,7 +463,7 @@ bool GrDawnGpu::onCopySurface(GrSurface* dst, return true; } -static void callback(DawnBufferMapAsyncStatus status, const void* data, uint64_t dataLength, +static void callback(WGPUBufferMapAsyncStatus status, const void* data, uint64_t dataLength, void* userdata) { (*reinterpret_cast(userdata)) = data; } diff --git a/src/gpu/dawn/GrDawnGpu.h b/src/gpu/dawn/GrDawnGpu.h index c909630ebe..b8819a9c24 100644 --- a/src/gpu/dawn/GrDawnGpu.h +++ b/src/gpu/dawn/GrDawnGpu.h @@ -10,7 +10,7 @@ #include "src/gpu/GrGpu.h" #include "src/gpu/GrProgramDesc.h" -#include "dawn/dawncpp.h" +#include "dawn/webgpu_cpp.h" #include "src/core/SkLRUCache.h" #include "src/gpu/dawn/GrDawnRingBuffer.h" #include "src/gpu/dawn/GrDawnStagingManager.h" diff --git a/src/gpu/dawn/GrDawnOpsRenderPass.h b/src/gpu/dawn/GrDawnOpsRenderPass.h index 0e612a4a6a..5119508f12 100644 --- a/src/gpu/dawn/GrDawnOpsRenderPass.h +++ b/src/gpu/dawn/GrDawnOpsRenderPass.h @@ -13,7 +13,7 @@ #include "include/gpu/GrTypes.h" #include "src/gpu/GrColor.h" #include "src/gpu/GrMesh.h" -#include "dawn/dawncpp.h" +#include "dawn/webgpu_cpp.h" class GrDawnGpu; class GrDawnRenderTarget; diff --git a/src/gpu/dawn/GrDawnProgramBuilder.cpp b/src/gpu/dawn/GrDawnProgramBuilder.cpp index d7bf8302f3..d63e852c92 100644 --- a/src/gpu/dawn/GrDawnProgramBuilder.cpp +++ b/src/gpu/dawn/GrDawnProgramBuilder.cpp @@ -550,7 +550,7 @@ wgpu::BindGroup GrDawnProgram::setTextures(GrDawnGpu* gpu, &binding); } } - GrFragmentProcessor::Iter fpIter(pipeline); + GrFragmentProcessor::CIter fpIter(pipeline); GrGLSLFragmentProcessor::Iter glslIter(fFragmentProcessors.get(), fFragmentProcessorCnt); for (; fpIter && glslIter; ++fpIter, ++glslIter) { for (int i = 0; i < fpIter->numTextureSamplers(); ++i) { diff --git a/src/gpu/dawn/GrDawnProgramBuilder.h b/src/gpu/dawn/GrDawnProgramBuilder.h index b0758a3e0b..004ab1fa7d 100644 --- a/src/gpu/dawn/GrDawnProgramBuilder.h +++ b/src/gpu/dawn/GrDawnProgramBuilder.h @@ -12,7 +12,7 @@ #include "src/gpu/dawn/GrDawnUniformHandler.h" #include "src/gpu/dawn/GrDawnVaryingHandler.h" #include "src/sksl/SkSLCompiler.h" -#include "dawn/dawncpp.h" +#include "dawn/webgpu_cpp.h" #include "src/gpu/glsl/GrGLSLProgramBuilder.h" class GrPipeline; diff --git a/src/gpu/dawn/GrDawnProgramDataManager.h b/src/gpu/dawn/GrDawnProgramDataManager.h index 438936093b..cc7cb8c084 100644 --- a/src/gpu/dawn/GrDawnProgramDataManager.h +++ b/src/gpu/dawn/GrDawnProgramDataManager.h @@ -11,7 +11,7 @@ #include "src/gpu/dawn/GrDawnRingBuffer.h" #include "src/gpu/dawn/GrDawnUniformHandler.h" #include "src/gpu/glsl/GrGLSLProgramDataManager.h" -#include "dawn/dawncpp.h" +#include "dawn/webgpu_cpp.h" #include "src/core/SkAutoMalloc.h" diff --git a/src/gpu/dawn/GrDawnRingBuffer.h b/src/gpu/dawn/GrDawnRingBuffer.h index 9b66f6f10a..d44c25d9fe 100644 --- a/src/gpu/dawn/GrDawnRingBuffer.h +++ b/src/gpu/dawn/GrDawnRingBuffer.h @@ -10,7 +10,7 @@ #include "src/gpu/GrBuffer.h" #include "src/gpu/dawn/GrDawnBuffer.h" -#include "dawn/dawncpp.h" +#include "dawn/webgpu_cpp.h" class GrDawnGpu; diff --git a/src/gpu/dawn/GrDawnStagingManager.cpp b/src/gpu/dawn/GrDawnStagingManager.cpp index 51e11a42d5..e655722a3a 100644 --- a/src/gpu/dawn/GrDawnStagingManager.cpp +++ b/src/gpu/dawn/GrDawnStagingManager.cpp @@ -40,7 +40,7 @@ GrDawnStagingBuffer* GrDawnStagingManager::findOrCreateStagingBuffer(size_t size return stagingBuffer; } -static void callback(DawnBufferMapAsyncStatus status, void* data, uint64_t dataLength, +static void callback(WGPUBufferMapAsyncStatus status, void* data, uint64_t dataLength, void* userData) { GrDawnStagingBuffer* buffer = static_cast(userData); buffer->fData = data; diff --git a/src/gpu/dawn/GrDawnStagingManager.h b/src/gpu/dawn/GrDawnStagingManager.h index 32a108107b..1bcc339ec3 100644 --- a/src/gpu/dawn/GrDawnStagingManager.h +++ b/src/gpu/dawn/GrDawnStagingManager.h @@ -12,7 +12,7 @@ #include #include -#include "dawn/dawncpp.h" +#include "dawn/webgpu_cpp.h" struct GrDawnStagingBuffer; diff --git a/src/gpu/dawn/GrDawnStencilAttachment.h b/src/gpu/dawn/GrDawnStencilAttachment.h index 0e4a89102d..110af1f08a 100644 --- a/src/gpu/dawn/GrDawnStencilAttachment.h +++ b/src/gpu/dawn/GrDawnStencilAttachment.h @@ -10,7 +10,7 @@ #include "src/gpu/GrStencilAttachment.h" -#include "dawn/dawncpp.h" +#include "dawn/webgpu_cpp.h" class GrDawnGpu; diff --git a/src/gpu/dawn/GrDawnTexture.h b/src/gpu/dawn/GrDawnTexture.h index 5d25d8b967..0a7d64a259 100644 --- a/src/gpu/dawn/GrDawnTexture.h +++ b/src/gpu/dawn/GrDawnTexture.h @@ -9,7 +9,7 @@ #define GrDawnTexture_DEFINED #include "include/gpu/GrTexture.h" -#include "dawn/dawncpp.h" +#include "dawn/webgpu_cpp.h" class GrDawnGpu; struct GrDawnImageInfo; diff --git a/src/gpu/dawn/GrDawnUtil.h b/src/gpu/dawn/GrDawnUtil.h index 4592073757..7b14fff9a9 100644 --- a/src/gpu/dawn/GrDawnUtil.h +++ b/src/gpu/dawn/GrDawnUtil.h @@ -9,7 +9,7 @@ #define GrDawnUtil_DEFINED #include "include/private/GrTypesPriv.h" -#include "dawn/dawncpp.h" +#include "dawn/webgpu_cpp.h" size_t GrDawnBytesPerPixel(wgpu::TextureFormat format); bool GrDawnFormatIsRenderable(wgpu::TextureFormat format); diff --git a/tools/gpu/dawn/DawnTestContext.cpp b/tools/gpu/dawn/DawnTestContext.cpp index 5ab7af970d..37c63cec51 100644 --- a/tools/gpu/dawn/DawnTestContext.cpp +++ b/tools/gpu/dawn/DawnTestContext.cpp @@ -5,7 +5,7 @@ * found in the LICENSE file. */ -#include "dawn/dawncpp.h" +#include "dawn/webgpu_cpp.h" #include "dawn_native/DawnNative.h" #include "tools/gpu/dawn/DawnTestContext.h" @@ -20,7 +20,7 @@ #define USE_OPENGL_BACKEND 0 #ifdef SK_DAWN -#include "dawn/dawn.h" +#include "dawn/webgpu.h" #include "dawn/dawn_proc.h" #include "include/gpu/GrContext.h" #include "tools/AutoreleasePool.h" @@ -95,7 +95,7 @@ public: ~DawnFence() { } - static void callback(DawnBufferMapAsyncStatus status, const void* data, uint64_t dataLength, + static void callback(WGPUBufferMapAsyncStatus status, const void* data, uint64_t dataLength, void* userData) { DawnFence* fence = static_cast(userData); fence->fCalled = true; diff --git a/tools/sk_app/DawnWindowContext.cpp b/tools/sk_app/DawnWindowContext.cpp index 9bc9de0156..4b66ce42a3 100644 --- a/tools/sk_app/DawnWindowContext.cpp +++ b/tools/sk_app/DawnWindowContext.cpp @@ -16,7 +16,7 @@ static wgpu::TextureUsage kUsage = wgpu::TextureUsage::OutputAttachment | wgpu::TextureUsage::CopySrc; -static void PrintDeviceError(DawnErrorType, const char* message, void*) { +static void PrintDeviceError(WGPUErrorType, const char* message, void*) { printf("Device error: %s\n", message); SkASSERT(false); } diff --git a/tools/sk_app/DawnWindowContext.h b/tools/sk_app/DawnWindowContext.h index e762c18e72..bd3bb9adf3 100644 --- a/tools/sk_app/DawnWindowContext.h +++ b/tools/sk_app/DawnWindowContext.h @@ -11,7 +11,7 @@ #include "include/core/SkSurface.h" #include "tools/sk_app/WindowContext.h" -#include "dawn/dawncpp.h" +#include "dawn/webgpu_cpp.h" #include "dawn_native/DawnNative.h" #include "dawn/dawn_wsi.h" diff --git a/tools/sk_app/mac/DawnMTLWindowContext_mac.mm b/tools/sk_app/mac/DawnMTLWindowContext_mac.mm index 651b04426d..61c7f991a0 100644 --- a/tools/sk_app/mac/DawnMTLWindowContext_mac.mm +++ b/tools/sk_app/mac/DawnMTLWindowContext_mac.mm @@ -8,7 +8,7 @@ #include "tools/sk_app/DawnWindowContext.h" #include "tools/sk_app/mac/WindowContextFactory_mac.h" #include "common/SwapChainUtils.h" -#include "dawn/dawncpp.h" +#include "dawn/webgpu_cpp.h" #include "dawn/dawn_wsi.h" #include "dawn_native/DawnNative.h" #include "dawn_native/MetalBackend.h" diff --git a/tools/sk_app/unix/WindowContextFactory_unix.h b/tools/sk_app/unix/WindowContextFactory_unix.h index 47310970d5..11bd2d2ac2 100644 --- a/tools/sk_app/unix/WindowContextFactory_unix.h +++ b/tools/sk_app/unix/WindowContextFactory_unix.h @@ -9,9 +9,9 @@ #ifndef WindowContextFactory_unix_DEFINED #define WindowContextFactory_unix_DEFINED -// dawncpp.h and X.h don't get along. Include this first, before X11 defines None, Success etc. +// webgpu_cpp.h and X.h don't get along. Include this first, before X11 defines None, Success etc. #ifdef SK_DAWN -#include "dawn/dawncpp.h" +#include "dawn/webgpu_cpp.h" #endif #include #include diff --git a/tools/sk_app/win/DawnD3D12WindowContext_win.cpp b/tools/sk_app/win/DawnD3D12WindowContext_win.cpp index ee39d1f5e6..b996672444 100644 --- a/tools/sk_app/win/DawnD3D12WindowContext_win.cpp +++ b/tools/sk_app/win/DawnD3D12WindowContext_win.cpp @@ -7,7 +7,7 @@ #include "tools/sk_app/DawnWindowContext.h" #include "tools/sk_app/win/WindowContextFactory_win.h" -#include "dawn/dawncpp.h" +#include "dawn/webgpu_cpp.h" #include "dawn/dawn_wsi.h" #include "dawn_native/DawnNative.h" #include "dawn_native/D3D12Backend.h"