Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
skgpu::graphite::ProxyReadCountMap Class Reference

#include <ScratchResourceManager.h>

Public Member Functions

 ProxyReadCountMap ()=default
 
void increment (const TextureProxy *proxy)
 
bool decrement (const TextureProxy *proxy)
 
int get (const TextureProxy *proxy) const
 

Detailed Description

Definition at line 30 of file ScratchResourceManager.h.

Constructor & Destructor Documentation

◆ ProxyReadCountMap()

skgpu::graphite::ProxyReadCountMap::ProxyReadCountMap ( )
default

Member Function Documentation

◆ decrement()

bool skgpu::graphite::ProxyReadCountMap::decrement ( const TextureProxy proxy)
inline

Definition at line 42 of file ScratchResourceManager.h.

42 {
43 int* count = fCounts.find(proxy);
44 SkASSERT(count && *count > 0);
45 (*count)--;
46 return *count == 0;
47 }
int count
Definition: FontMgrTest.cpp:50
#define SkASSERT(cond)
Definition: SkAssert.h:116

◆ get()

int skgpu::graphite::ProxyReadCountMap::get ( const TextureProxy proxy) const
inline

Definition at line 49 of file ScratchResourceManager.h.

49 {
50 const int* count = fCounts.find(proxy);
51 return count ? *count : 0;
52 }

◆ increment()

void skgpu::graphite::ProxyReadCountMap::increment ( const TextureProxy proxy)
inline

Definition at line 34 of file ScratchResourceManager.h.

34 {
35 int* count = fCounts.find(proxy);
36 if (!count) {
37 count = fCounts.set(proxy, 0);
38 }
39 (*count)++;
40 }

The documentation for this class was generated from the following file: