Flutter Engine
The Flutter Engine
third_party
skia
src
gpu
graphite
mtl
MtlGraphiteTypes.mm
Go to the documentation of this file.
1
/*
2
* Copyright 2021 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/MtlGraphiteTypesPriv.h
"
9
10
#import <Metal/Metal.h>
11
12
namespace
skgpu::graphite
{
13
14
MtlTextureInfo::MtlTextureInfo
(CFTypeRef
texture
) {
15
SkASSERT
(
texture
);
16
id<MTLTexture> mtlTex = (id<MTLTexture>)
texture
;
17
18
fSampleCount
= mtlTex.sampleCount;
19
fMipmapped
= mtlTex.mipmapLevelCount > 1 ?
Mipmapped::kYes
:
Mipmapped::kNo
;
20
21
fFormat
= mtlTex.pixelFormat;
22
fUsage
= mtlTex.usage;
23
fStorageMode
= mtlTex.storageMode;
24
fFramebufferOnly
= mtlTex.framebufferOnly;
25
}
26
27
MtlTextureInfo
MtlTextureSpecToTextureInfo
(
const
MtlTextureSpec
& mtlSpec,
28
uint32_t sampleCount,
29
Mipmapped
mipmapped) {
30
MtlTextureInfo
info
;
31
// Shared info
32
info
.fSampleCount = sampleCount;
33
info
.fMipmapped = mipmapped;
34
35
// Mtl info
36
info
.fFormat = mtlSpec.
fFormat
;
37
info
.fUsage = mtlSpec.
fUsage
;
38
info
.fStorageMode = mtlSpec.
fStorageMode
;
39
info
.fFramebufferOnly = mtlSpec.
fFramebufferOnly
;
40
41
return
info
;
42
}
43
44
}
// namespace skgpu::graphite
info
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition:
DM.cpp:213
MtlGraphiteTypesPriv.h
SkASSERT
#define SkASSERT(cond)
Definition:
SkAssert.h:116
texture
FlTexture * texture
Definition:
mock_texture_registrar.cc:24
skgpu::graphite
Definition:
BoundsManagerBench.cpp:27
skgpu::graphite::MtlTextureSpecToTextureInfo
MtlTextureInfo MtlTextureSpecToTextureInfo(const MtlTextureSpec &mtlSpec, uint32_t sampleCount, Mipmapped mipmapped)
Definition:
MtlGraphiteTypes.mm:27
skgpu::Mipmapped
Mipmapped
Definition:
GpuTypes.h:53
skgpu::Mipmapped::kYes
@ kYes
skgpu::Mipmapped::kNo
@ kNo
skgpu::graphite::MtlTextureInfo
Definition:
MtlGraphiteTypes.h:39
skgpu::graphite::MtlTextureInfo::fFramebufferOnly
bool fFramebufferOnly
Definition:
MtlGraphiteTypes.h:48
skgpu::graphite::MtlTextureInfo::fSampleCount
uint32_t fSampleCount
Definition:
MtlGraphiteTypes.h:40
skgpu::graphite::MtlTextureInfo::fFormat
MtlPixelFormat fFormat
Definition:
MtlGraphiteTypes.h:45
skgpu::graphite::MtlTextureInfo::MtlTextureInfo
MtlTextureInfo()=default
skgpu::graphite::MtlTextureInfo::fStorageMode
MtlStorageMode fStorageMode
Definition:
MtlGraphiteTypes.h:47
skgpu::graphite::MtlTextureInfo::fMipmapped
skgpu::Mipmapped fMipmapped
Definition:
MtlGraphiteTypes.h:41
skgpu::graphite::MtlTextureInfo::fUsage
MtlTextureUsage fUsage
Definition:
MtlGraphiteTypes.h:46
skgpu::graphite::MtlTextureSpec
Definition:
MtlGraphiteTypesPriv.h:48
skgpu::graphite::MtlTextureSpec::fFormat
MtlPixelFormat fFormat
Definition:
MtlGraphiteTypesPriv.h:83
skgpu::graphite::MtlTextureSpec::fFramebufferOnly
bool fFramebufferOnly
Definition:
MtlGraphiteTypesPriv.h:86
skgpu::graphite::MtlTextureSpec::fUsage
MtlTextureUsage fUsage
Definition:
MtlGraphiteTypesPriv.h:84
skgpu::graphite::MtlTextureSpec::fStorageMode
MtlStorageMode fStorageMode
Definition:
MtlGraphiteTypesPriv.h:85
Generated on Sun Jun 23 2024 21:56:27 for Flutter Engine by
1.9.4