Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Mock Struct Reference

Public Member Functions

 Mock (size_t maxBytes)
 
GrResourceCachecache ()
 
GrGpugpu ()
 
GrDirectContextdContext ()
 
void reset ()
 
bool operator== (const Mock &that) const
 
bool operator!= (const Mock &that) const
 

Static Public Member Functions

static bool LessP (Mock *const &a, Mock *const &b)
 
static intPQIndex (Mock *const &mock)
 

Public Attributes

int fValue
 
int fPriority
 
int fIndex
 

Detailed Description

Definition at line 396 of file ResourceCacheTest.cpp.

Constructor & Destructor Documentation

◆ Mock()

Mock::Mock ( size_t  maxBytes)
inline

Definition at line 398 of file ResourceCacheTest.cpp.

398 {
399 fDContext = GrDirectContext::MakeMock(nullptr);
400 SkASSERT(fDContext);
401 fDContext->setResourceCacheLimit(maxBytes);
402 GrResourceCache* cache = fDContext->priv().getResourceCache();
405 }
#define SkASSERT(cond)
Definition SkAssert.h:116
GrResourceCache * getResourceCache()
static sk_sp< GrDirectContext > MakeMock(const GrMockOptions *, const GrContextOptions &)
GrDirectContextPriv priv()
void setResourceCacheLimit(size_t maxResourceBytes)
size_t getResourceBytes() const
int getResourceCount() const
void purgeUnlockedResources(GrPurgeResourceOptions opts)
GrResourceCache * cache()

Member Function Documentation

◆ cache()

GrResourceCache * Mock::cache ( )
inline

Definition at line 407 of file ResourceCacheTest.cpp.

407{ return fDContext->priv().getResourceCache(); }

◆ dContext()

GrDirectContext * Mock::dContext ( )
inline

Definition at line 409 of file ResourceCacheTest.cpp.

409{ return fDContext.get(); }
T * get() const
Definition SkRefCnt.h:303

◆ gpu()

GrGpu * Mock::gpu ( )
inline

Definition at line 408 of file ResourceCacheTest.cpp.

408{ return fDContext->priv().getGpu(); }

◆ LessP()

static bool Mock::LessP ( Mock *const &  a,
Mock *const &  b 
)
inlinestatic

Definition at line 73 of file TDPQueueTest.cpp.

73{ return a->fPriority < b->fPriority; }
static bool b
struct MyStruct a[10]

◆ operator!=()

bool Mock::operator!= ( const Mock that) const
inline

Definition at line 79 of file TDPQueueTest.cpp.

79{ return !(*this == that); }

◆ operator==()

bool Mock::operator== ( const Mock that) const
inline

Definition at line 76 of file TDPQueueTest.cpp.

76 {
77 return fValue == that.fValue && fPriority == that.fPriority;
78 }
int fValue
int fPriority

◆ PQIndex()

static int * Mock::PQIndex ( Mock *const &  mock)
inlinestatic

Definition at line 74 of file TDPQueueTest.cpp.

74{ return &mock->fIndex; }
int fIndex

◆ reset()

void Mock::reset ( )
inline

Definition at line 411 of file ResourceCacheTest.cpp.

411 {
412 fDContext.reset();
413 }
void reset(T *ptr=nullptr)
Definition SkRefCnt.h:310

Member Data Documentation

◆ fIndex

int Mock::fIndex
mutable

Definition at line 71 of file TDPQueueTest.cpp.

◆ fPriority

int Mock::fPriority

Definition at line 70 of file TDPQueueTest.cpp.

◆ fValue

int Mock::fValue

Definition at line 69 of file TDPQueueTest.cpp.


The documentation for this struct was generated from the following files: