#include "dawn/native/Surface.h"
#include <memory>
#include <string>
#include <utility>
#include "dawn/common/Platform.h"
#include "dawn/native/ChainUtils.h"
#include "dawn/native/Device.h"
#include "dawn/native/Instance.h"
#include "dawn/native/SwapChain.h"
#include "dawn/native/ValidationUtils_autogen.h"
#include "dawn/native/utils/WGPUHelpers.h"
#if defined(DAWN_USE_WINDOWS_UI)
#include <windows.ui.core.h>
#include <windows.ui.xaml.controls.h>
#endif
#if defined(DAWN_USE_X11)
#include "dawn/common/xlib_with_undefs.h"
#include "dawn/native/X11Functions.h"
#endif
namespace dawn::native {
absl::FormatConvertResult<absl::FormatConversionCharSet::kString> AbslFormatConvert(
Surface::Type value,
const absl::FormatConversionSpec& spec,
absl::FormatSink* s) { … }
#if defined(DAWN_ENABLE_BACKEND_METAL)
bool InheritsFromCAMetalLayer(void* obj);
#endif
ResultOrError<UnpackedPtr<SurfaceDescriptor>> ValidateSurfaceDescriptor(
InstanceBase* instance,
const SurfaceDescriptor* rawDescriptor) { … }
MaybeError ValidateSurfaceConfiguration(DeviceBase* device,
const PhysicalDeviceSurfaceCapabilities& capabilities,
const SurfaceConfiguration* config,
const Surface* surface) { … }
class AdapterSurfaceCapCache { … };
Ref<Surface> Surface::MakeError(InstanceBase* instance) { … }
Surface::Surface(InstanceBase* instance, ErrorTag tag) : … { … }
Surface::Surface(InstanceBase* instance, const UnpackedPtr<SurfaceDescriptor>& descriptor)
: … { … }
Surface::~Surface() { … }
SwapChainBase* Surface::GetAttachedSwapChain() { … }
void Surface::SetAttachedSwapChain(SwapChainBase* swapChain) { … }
InstanceBase* Surface::GetInstance() const { … }
DeviceBase* Surface::GetCurrentDevice() const { … }
Surface::Type Surface::GetType() const { … }
void* Surface::GetAndroidNativeWindow() const { … }
void* Surface::GetMetalLayer() const { … }
void* Surface::GetWaylandDisplay() const { … }
void* Surface::GetWaylandSurface() const { … }
void* Surface::GetHInstance() const { … }
void* Surface::GetHWND() const { … }
IUnknown* Surface::GetCoreWindow() const { … }
IUnknown* Surface::GetSwapChainPanel() const { … }
void* Surface::GetXDisplay() const { … }
uint32_t Surface::GetXWindow() const { … }
MaybeError Surface::Configure(const SurfaceConfiguration* configIn) { … }
MaybeError Surface::Unconfigure() { … }
MaybeError Surface::GetCapabilities(AdapterBase* adapter, SurfaceCapabilities* capabilities) const { … }
void APISurfaceCapabilitiesFreeMembers(WGPUSurfaceCapabilities capabilities) { … }
MaybeError Surface::GetCurrentTexture(SurfaceTexture* surfaceTexture) const { … }
ResultOrError<wgpu::TextureFormat> Surface::GetPreferredFormat(AdapterBase* adapter) const { … }
MaybeError Surface::Present() { … }
const std::string& Surface::GetLabel() const { … }
void Surface::APIConfigure(const SurfaceConfiguration* config) { … }
wgpu::Status Surface::APIGetCapabilities(AdapterBase* adapter,
SurfaceCapabilities* capabilities) const { … }
void Surface::APIGetCurrentTexture(SurfaceTexture* surfaceTexture) const { … }
wgpu::TextureFormat Surface::APIGetPreferredFormat(AdapterBase* adapter) const { … }
void Surface::APIPresent() { … }
void Surface::APIUnconfigure() { … }
void Surface::APISetLabel(const char* label) { … }
void Surface::APISetLabel2(std::optional<std::string_view> label) { … }
}