Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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 void onDumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump,
59 const char* dumpName) const override;
60
61 static std::pair<wgpu::TextureView, wgpu::TextureView> CreateTextureViews(
62 const wgpu::Texture& texture, const TextureInfo& info);
63
64 wgpu::Texture fTexture;
65 wgpu::TextureView fSampleTextureView;
66 wgpu::TextureView fRenderTextureView;
67};
68
69} // namespace skgpu::graphite
70
71#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 &)
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)
void onDumpMemoryStatistics(SkTraceMemoryDump *traceMemoryDump, const char *dumpName) const override
SkISize dimensions() const
Definition Texture.h:31
FlTexture * texture
Budgeted
Definition GpuTypes.h:35