Hash :
69841d3c
Author :
Date :
2025-04-30T23:55:16
WebGPU: Use WebGPU C API for Textures and Framebuffers Bug: angleproject:414831373 Change-Id: I6b547a726b22e8eb5d407e2d6340b1d18bf39033 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6503024 Reviewed-by: Liza Burakova <liza@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
//
// Copyright 2024 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.
//
// WindowSurfaceWgpuMetalLayer.h:
// Defines the class interface for WindowSurfaceWgpuMetalLayer, implementing WindowSurfaceWgpu.
//
#ifndef LIBANGLE_RENDERER_WGPU_MAC_WINDOWSURFACEWGPUMETALLAYER_H_
#define LIBANGLE_RENDERER_WGPU_MAC_WINDOWSURFACEWGPUMETALLAYER_H_
#include "libANGLE/renderer/wgpu/SurfaceWgpu.h"
#import <Metal/Metal.h>
#import <QuartzCore/CAMetalLayer.h>
namespace rx
{
class WindowSurfaceWgpuMetalLayer : public WindowSurfaceWgpu
{
public:
WindowSurfaceWgpuMetalLayer(const egl::SurfaceState &surfaceState, EGLNativeWindowType window);
egl::Error initialize(const egl::Display *display) override;
void destroy(const egl::Display *display) override;
private:
angle::Result createWgpuSurface(const egl::Display *display,
webgpu::SurfaceHandle *outSurface) override;
angle::Result getCurrentWindowSize(const egl::Display *display, gl::Extents *outSize) override;
id<MTLDevice> mMetalDevice;
CAMetalLayer *mMetalLayer;
};
} // namespace rx
#endif // LIBANGLE_RENDERER_WGPU_MAC_WINDOWSURFACEWGPUMETALLAYER_H_