16uint32_t create_unique_id() {
17 static std::atomic<uint32_t> nextID{1};
20 id = nextID.fetch_add(1, std::memory_order_relaxed);
30 bool commandBufferRefsAsUsageRefs)
31 : fSharedContext(sharedContext)
33 , fCommandBufferRefCnt(0)
35 , fCommandBufferRefsAsUsageRefs(commandBufferRefsAsUsageRefs)
36 , fOwnership(ownership)
37 , fGpuMemorySize(gpuMemorySize)
39 , fUniqueID(create_unique_id()) {
54 fReturnCache = std::move(returnCache);
68 fReturnCache->returnResource(mutableThis, removedRef)) {
72 if (!this->hasAnyRefs()) {
78void Resource::internalDispose() {
82 fSharedContext =
nullptr;
88bool Resource::isPurgeable()
const {
92 return !(this->hasUsageRef() || this->hasCommandBufferRef());
114 SkString resourceName(
"skia/gpu_resources/resource_");
120 if (this->isPurgeable()) {
static constexpr uint32_t SK_InvalidUniqueID
void appendU32(uint32_t value)
const char * c_str() const
virtual bool shouldDumpUnbudgetedObjects() const
virtual void dumpWrappedState(const char *, bool)
virtual void dumpStringValue(const char *, const char *, const char *)
virtual void dumpBudgetedState(const char *, bool)
virtual bool shouldDumpWrappedObjects() const
virtual void dumpNumericValue(const char *dumpName, const char *valueName, const char *units, uint64_t value)=0
bool wasDestroyed() const
skgpu::Budgeted budgeted() const
virtual void invokeReleaseProc()
Resource(const Resource &)=delete
virtual void onDumpMemoryStatistics(SkTraceMemoryDump *traceMemoryDump, const char *dumpName) const
size_t gpuMemorySize() const
UniqueID uniqueID() const
Ownership ownership() const
virtual void freeGpuData()=0
void dumpMemoryStatistics(SkTraceMemoryDump *traceMemoryDump) const
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size