Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
src
gpu
graphite
dawn
DawnTypesPriv.cpp
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
#include "
include/private/gpu/graphite/DawnTypesPriv.h
"
9
10
namespace
skgpu::graphite
{
11
12
SkString
DawnTextureSpec::toString
()
const
{
13
return
SkStringPrintf
(
"format=0x%08X,viewFormat=0x%08X,usage=0x%08X,aspect=0x%08X,slice=%u"
,
14
static_cast<
unsigned
int
>
(
fFormat
),
15
static_cast<
unsigned
int
>
(
fViewFormat
),
16
static_cast<
unsigned
int
>
(
fUsage
),
17
static_cast<
unsigned
int
>
(
fAspect
),
18
fSlice
);
19
}
20
21
DawnTextureInfo
DawnTextureInfoFromWGPUTexture
(WGPUTexture
texture
) {
22
SkASSERT
(
texture
);
23
return
DawnTextureInfo
(
24
wgpuTextureGetSampleCount(
texture
),
25
wgpuTextureGetMipLevelCount(
texture
) > 1 ? Mipmapped::kYes : Mipmapped::kNo,
26
/*format=*/
static_cast<
wgpu::TextureFormat
>
(wgpuTextureGetFormat(
texture
)),
27
/*viewFormat=*/
static_cast<
wgpu::TextureFormat
>
(wgpuTextureGetFormat(
texture
)),
28
static_cast<
wgpu::TextureUsage
>
(wgpuTextureGetUsage(
texture
)),
29
wgpu::TextureAspect::All,
/*slice=*/
0);
30
}
31
32
DawnTextureInfo
DawnTextureSpecToTextureInfo
(
const
DawnTextureSpec
& dawnSpec,
33
uint32_t sampleCount,
34
Mipmapped
mipmapped) {
35
DawnTextureInfo
info
;
36
// Shared info
37
info
.
fSampleCount
= sampleCount;
38
info
.fMipmapped = mipmapped;
39
40
// Dawn info
41
info
.fFormat = dawnSpec.
fFormat
;
42
info
.fViewFormat = dawnSpec.
fViewFormat
;
43
info
.fUsage = dawnSpec.
fUsage
;
44
info
.fAspect = dawnSpec.
fAspect
;
45
46
return
info
;
47
}
48
49
}
// namespace skgpu::graphite
info
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition
DM.cpp:213
DawnTypesPriv.h
SkASSERT
#define SkASSERT(cond)
Definition
SkAssert.h:116
SkStringPrintf
SK_API SkString static SkString SkStringPrintf()
Definition
SkString.h:287
SkString
Definition
SkString.h:118
texture
FlTexture * texture
Definition
mock_texture_registrar.cc:24
skgpu::graphite
Definition
BoundsManagerBench.cpp:27
skgpu::graphite::DawnTextureInfoFromWGPUTexture
DawnTextureInfo DawnTextureInfoFromWGPUTexture(WGPUTexture texture)
Definition
DawnTypesPriv.cpp:21
skgpu::graphite::DawnTextureSpecToTextureInfo
DawnTextureInfo DawnTextureSpecToTextureInfo(const DawnTextureSpec &dawnSpec, uint32_t sampleCount, Mipmapped mipmapped)
Definition
DawnTypesPriv.cpp:32
skgpu::Mipmapped
Mipmapped
Definition
GpuTypes.h:53
skgpu::graphite::DawnTextureInfo
Definition
DawnTypes.h:16
skgpu::graphite::DawnTextureInfo::fSampleCount
uint32_t fSampleCount
Definition
DawnTypes.h:17
skgpu::graphite::DawnTextureSpec
Definition
DawnTypesPriv.h:16
skgpu::graphite::DawnTextureSpec::fUsage
wgpu::TextureUsage fUsage
Definition
DawnTypesPriv.h:48
skgpu::graphite::DawnTextureSpec::fAspect
wgpu::TextureAspect fAspect
Definition
DawnTypesPriv.h:49
skgpu::graphite::DawnTextureSpec::fFormat
wgpu::TextureFormat fFormat
Definition
DawnTypesPriv.h:44
skgpu::graphite::DawnTextureSpec::fSlice
uint32_t fSlice
Definition
DawnTypesPriv.h:50
skgpu::graphite::DawnTextureSpec::toString
SkString toString() const
Definition
DawnTypesPriv.cpp:12
skgpu::graphite::DawnTextureSpec::fViewFormat
wgpu::TextureFormat fViewFormat
Definition
DawnTypesPriv.h:47
Generated on Fri Apr 26 2024 06:17:17 for Flutter Engine by
1.9.8