Flutter Engine
The Flutter Engine
DawnTexture.h
Go to the documentation of this file.
1/*
2 * Copyright 2022 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef skgpu_graphite_DawnTexture_DEFINED
9#define skgpu_graphite_DawnTexture_DEFINED
10
13
14#include "webgpu/webgpu_cpp.h" // NO_G3_REWRITE
15
16namespace skgpu::graphite {
17class DawnSharedContext;
18
19class DawnTexture : public Texture {
20public:
21 static wgpu::Texture MakeDawnTexture(const DawnSharedContext*,
23 const TextureInfo&);
24
27 const TextureInfo&,
29
32 const TextureInfo&,
33 wgpu::Texture);
34
37 const TextureInfo&,
38 const wgpu::TextureView&);
39
40 ~DawnTexture() override {}
41
42 const wgpu::Texture& dawnTexture() const { return fTexture; }
43 const wgpu::TextureView& sampleTextureView() const { return fSampleTextureView; }
44 const wgpu::TextureView& renderTextureView() const { return fRenderTextureView; }
45
46private:
49 const TextureInfo&,
50 wgpu::Texture,
51 wgpu::TextureView sampleTextureView,
52 wgpu::TextureView renderTextureView,
55
56 void freeGpuData() override;
57
58 static std::pair<wgpu::TextureView, wgpu::TextureView> CreateTextureViews(
59 const wgpu::Texture& texture, const TextureInfo& info);
60
61 void setBackendLabel(char const* label) override;
62
63 wgpu::Texture fTexture;
64 wgpu::TextureView fSampleTextureView;
65 wgpu::TextureView fRenderTextureView;
66};
67
68} // namespace skgpu::graphite
69
70#endif // skgpu_graphite_DawnTexture_DEFINED
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
static sk_sp< Texture > MakeWrapped(const DawnSharedContext *, SkISize dimensions, const TextureInfo &, wgpu::Texture)
static wgpu::Texture MakeDawnTexture(const DawnSharedContext *, SkISize dimensions, const TextureInfo &)
Definition: DawnTexture.cpp:22
const wgpu::Texture & dawnTexture() const
Definition: DawnTexture.h:42
const wgpu::TextureView & renderTextureView() const
Definition: DawnTexture.h:44
const wgpu::TextureView & sampleTextureView() const
Definition: DawnTexture.h:43
static sk_sp< Texture > Make(const DawnSharedContext *, SkISize dimensions, const TextureInfo &, skgpu::Budgeted)
SkISize dimensions() const
Definition: Texture.h:31
FlTexture * texture
Budgeted
Definition: GpuTypes.h:35
Definition: SkSize.h:16