Flutter Engine
The Flutter Engine
Classes | Enumerations | Functions
GrResourceCacheBench.cpp File Reference
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/gpu/GrDirectContext.h"
#include "src/gpu/ganesh/GrDirectContextPriv.h"
#include "src/gpu/ganesh/GrGpu.h"
#include "src/gpu/ganesh/GrGpuResource.h"
#include "src/gpu/ganesh/GrGpuResourcePriv.h"
#include "src/gpu/ganesh/GrResourceCache.h"

Go to the source code of this file.

Classes

class  BenchResource
 
class  GrResourceCacheBenchAdd
 
class  GrResourceCacheBenchFind
 

Enumerations

enum  { CACHE_SIZE_COUNT = 4096 }
 

Functions

static void populate_cache (GrGpu *gpu, int resourceCount, int keyData32Count)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
CACHE_SIZE_COUNT 

Definition at line 18 of file GrResourceCacheBench.cpp.

18 {
19 CACHE_SIZE_COUNT = 4096,
20};
@ CACHE_SIZE_COUNT

Function Documentation

◆ populate_cache()

static void populate_cache ( GrGpu gpu,
int  resourceCount,
int  keyData32Count 
)
static

Definition at line 44 of file GrResourceCacheBench.cpp.

44 {
45 for (int i = 0; i < resourceCount; ++i) {
47 BenchResource::ComputeKey(i, keyData32Count, &key);
48 GrGpuResource* resource = new BenchResource(gpu, /*label=*/"BenchResource");
49 resource->resourcePriv().setUniqueKey(key);
50 resource->unref();
51 }
52}
static SkString resource(SkPDFResourceType type, int index)
static void ComputeKey(int i, int keyData32Count, skgpu::UniqueKey *key)