From 1b74f55d52d24d7e70b7694712636555c918e7c2 Mon Sep 17 00:00:00 2001 From: William Candillon Date: Mon, 4 Nov 2024 07:41:05 +0100 Subject: [PATCH] Remove unused file --- .../rnwgpu/api/WebGPUCanvasContextFactory.h | 59 ------------------- 1 file changed, 59 deletions(-) delete mode 100644 packages/webgpu/cpp/rnwgpu/api/WebGPUCanvasContextFactory.h diff --git a/packages/webgpu/cpp/rnwgpu/api/WebGPUCanvasContextFactory.h b/packages/webgpu/cpp/rnwgpu/api/WebGPUCanvasContextFactory.h deleted file mode 100644 index 001bbdf9a..000000000 --- a/packages/webgpu/cpp/rnwgpu/api/WebGPUCanvasContextFactory.h +++ /dev/null @@ -1,59 +0,0 @@ -#pragma once - -#include -#include -#include - -#include "Unions.h" - -#include "webgpu/webgpu_cpp.h" - -#include "RNFHybridObject.h" - -#include "AsyncRunner.h" - -#include "GPUCanvasContext.h" - -#ifdef __APPLE__ -#include "WebGPUModule.h" -#endif - -namespace rnwgpu { - -namespace m = margelo; - -class WebGPUCanvasContextFactory : public m::HybridObject { -public: - GPUCanvasContextFactory() : HybridObject("GPUCanvasContextFactory") {} - -public: - std::shared_ptr Make(uint64_t surface, int width, - int height) { -#ifdef __APPLE__ - wgpu::SurfaceDescriptorFromMetalLayer metalSurfaceDesc; - metalSurfaceDesc.layer = reinterpret_cast(surface); - - wgpu::SurfaceDescriptor surfaceDescriptor; - surfaceDescriptor.nextInChain = &metalSurfaceDesc; - - auto surfaceGpu = std::make_unique( - WebGPUModule::getManager()->getGPU()->get().CreateSurface( - &surfaceDescriptor)); - const float scaleFactor = 1; - const float scaledWidth = width * scaleFactor; - const float scaledHeight = height * scaleFactor; - - rnwgpu::SurfaceData surfaceData{scaledWidth, scaledHeight, - std::move(surfaceGpu)}; -#elif __ANDROID__ - throw std::runtime_error("Not implemented"); -#endif - return std::make_shared(surfaceData); - } - - void loadHybridMethods() override { - registerHybridGetter("Make", &GPUCanvasContextFactory::Make, this); - } -}; - -} // namespace rnwgpu