Flutter Engine
The Flutter Engine
third_party
skia
src
gpu
ganesh
GrPersistentCacheUtils.h
Go to the documentation of this file.
1
/*
2
* Copyright 2019 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 GrPersistentCacheEntry_DEFINED
9
#define GrPersistentCacheEntry_DEFINED
10
11
#include "
include/core/SkData.h
"
12
#include "
include/private/base/SkTArray.h
"
13
#include "
include/private/gpu/ganesh/GrTypesPriv.h
"
14
#include "
src/sksl/ir/SkSLProgram.h
"
15
16
#include <string>
17
18
class
SkReadBuffer
;
19
namespace
SkSL
{
struct
ProgramSettings; }
20
21
// The GrPersistentCache stores opaque blobs, as far as clients are concerned. It's helpful to
22
// inspect certain kinds of cached data within our tools, so for those cases (GLSL, SPIR-V), we
23
// put the serialization logic here, to be shared by the backend code and the tool code.
24
namespace
GrPersistentCacheUtils
{
25
26
struct
ShaderMetadata
{
27
SkSL::ProgramSettings
*
fSettings
=
nullptr
;
28
skia_private::TArray<std::string>
fAttributeNames
;
29
bool
fHasSecondaryColorOutput
=
false
;
30
sk_sp<SkData>
fPlatformData
;
31
};
32
33
int
GetCurrentVersion
();
34
35
sk_sp<SkData>
PackCachedShaders
(
SkFourByteTag
shaderType,
36
const
std::string shaders[],
37
const
SkSL::Program::Interface
[],
38
int
numInterfaces,
39
const
ShaderMetadata
* meta =
nullptr
);
40
41
SkFourByteTag
GetType
(
SkReadBuffer
* reader);
42
43
bool
UnpackCachedShaders
(
SkReadBuffer
* reader,
44
std::string shaders[],
45
SkSL::Program::Interface
[],
46
int
numInterfaces,
47
ShaderMetadata
* meta =
nullptr
);
48
49
}
// namespace GrPersistentCacheUtils
50
51
#endif
GrTypesPriv.h
SkData.h
SkSLProgram.h
SkTArray.h
SkFourByteTag
uint32_t SkFourByteTag
Definition:
SkTypes.h:166
SkReadBuffer
Definition:
SkReadBuffer.h:52
sk_sp< SkData >
skia_private::TArray< std::string >
GrPersistentCacheUtils
Definition:
GrPersistentCacheUtils.cpp:15
GrPersistentCacheUtils::PackCachedShaders
sk_sp< SkData > PackCachedShaders(SkFourByteTag shaderType, const std::string shaders[], const SkSL::Program::Interface interfaces[], int numInterfaces, const ShaderMetadata *meta)
Definition:
GrPersistentCacheUtils.cpp:34
GrPersistentCacheUtils::UnpackCachedShaders
bool UnpackCachedShaders(SkReadBuffer *reader, std::string shaders[], SkSL::Program::Interface interfaces[], int numInterfaces, ShaderMetadata *meta)
Definition:
GrPersistentCacheUtils.cpp:82
GrPersistentCacheUtils::GetType
SkFourByteTag GetType(SkReadBuffer *reader)
Definition:
GrPersistentCacheUtils.cpp:75
GrPersistentCacheUtils::GetCurrentVersion
int GetCurrentVersion()
Definition:
GrPersistentCacheUtils.cpp:19
SkSL
Definition:
SkCapabilities.h:15
GrPersistentCacheUtils::ShaderMetadata
Definition:
GrPersistentCacheUtils.h:26
GrPersistentCacheUtils::ShaderMetadata::fPlatformData
sk_sp< SkData > fPlatformData
Definition:
GrPersistentCacheUtils.h:30
GrPersistentCacheUtils::ShaderMetadata::fSettings
SkSL::ProgramSettings * fSettings
Definition:
GrPersistentCacheUtils.h:27
GrPersistentCacheUtils::ShaderMetadata::fHasSecondaryColorOutput
bool fHasSecondaryColorOutput
Definition:
GrPersistentCacheUtils.h:29
GrPersistentCacheUtils::ShaderMetadata::fAttributeNames
skia_private::TArray< std::string > fAttributeNames
Definition:
GrPersistentCacheUtils.h:28
SkSL::ProgramInterface
Definition:
SkSLProgram.h:45
SkSL::ProgramSettings
Definition:
SkSLProgramSettings.h:22
Generated on Sun Jun 23 2024 21:56:21 for Flutter Engine by
1.9.4