Flutter Engine
The Flutter Engine
Functions
UniqueKeyUtils Namespace Reference

Functions

void FetchUniqueKeys (GlobalCache *globalCache, std::vector< UniqueKey > *keys)
 
bool ExtractKeyDescs (Context *context, const UniqueKey &origKey, GraphicsPipelineDesc *pipelineDesc, RenderPassDesc *renderPassDesc)
 

Function Documentation

◆ ExtractKeyDescs()

bool UniqueKeyUtils::ExtractKeyDescs ( Context context,
const UniqueKey origKey,
GraphicsPipelineDesc pipelineDesc,
RenderPassDesc renderPassDesc 
)

Definition at line 60 of file UniqueKeyUtils.cpp.

63 {
64 const Caps* caps = context->priv().caps();
65 const RendererProvider* rendererProvider = context->priv().rendererProvider();
66
67 bool extracted = caps->extractGraphicsDescs(origKey, pipelineDesc, renderPassDesc,
68 rendererProvider);
69 if (!extracted) {
70 SkASSERT(0);
71 return false;
72 }
73
74#ifdef SK_DEBUG
75 const ShaderCodeDictionary* dict = context->priv().shaderCodeDictionary();
76
77 UniqueKey newKey = caps->makeGraphicsPipelineKey(*pipelineDesc, *renderPassDesc);
78 if (origKey != newKey) {
79 SkDebugf("------- The UniqueKey didn't round trip!\n");
80 origKey.dump("original key:");
81 newKey.dump("reassembled key:");
82 DumpDescs(rendererProvider, dict, *pipelineDesc, *renderPassDesc);
83 SkDebugf("------------------------\n");
84 }
85 SkASSERT(origKey == newKey);
86#endif
87
88 return true;
89}
#define SkASSERT(cond)
Definition: SkAssert.h:116
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
virtual bool extractGraphicsDescs(const UniqueKey &, GraphicsPipelineDesc *, RenderPassDesc *, const RendererProvider *) const
Definition: Caps.h:129
virtual UniqueKey makeGraphicsPipelineKey(const GraphicsPipelineDesc &, const RenderPassDesc &) const =0
const RendererProvider * rendererProvider() const
Definition: ContextPriv.h:46
const Caps * caps() const
Definition: ContextPriv.h:32
const ShaderCodeDictionary * shaderCodeDictionary() const
Definition: ContextPriv.h:34

◆ FetchUniqueKeys()

void UniqueKeyUtils::FetchUniqueKeys ( GlobalCache globalCache,
std::vector< UniqueKey > *  keys 
)

Definition at line 23 of file UniqueKeyUtils.cpp.

24 {
25 keys->reserve(globalCache->numGraphicsPipelines());
26 globalCache->forEachGraphicsPipeline([keys](const UniqueKey& key,
27 const GraphicsPipeline* pipeline) {
28 keys->push_back(key);
29 });
30}