Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
RunArray Class Reference

Public Member Functions

 RunArray ()
 
SkRegionPriv::RunTypeoperator[] (int i)
 
void resizeToAtLeast (int count)
 

Detailed Description

Definition at line 50 of file SkRegion.cpp.

Constructor & Destructor Documentation

◆ RunArray()

RunArray::RunArray ( )
inline

Definition at line 52 of file SkRegion.cpp.

52{ fPtr = fStack; }

Member Function Documentation

◆ operator[]()

SkRegionPriv::RunType & RunArray::operator[] ( int  i)
inline

Definition at line 56 of file SkRegion.cpp.

56 {
57 SkASSERT((unsigned)i < (unsigned)fCount);
58 return fPtr[i];
59 }
#define SkASSERT(cond)
Definition SkAssert.h:116

◆ resizeToAtLeast()

void RunArray::resizeToAtLeast ( int  count)
inline

Resize the array to a size greater-than-or-equal-to count.

Definition at line 61 of file SkRegion.cpp.

61 {
62 if (count > fCount) {
63 // leave at least 50% extra space for future growth.
64 count += count >> 1;
65 fMalloc.realloc(count);
66 if (fPtr == fStack) {
67 memcpy(fMalloc.get(), fStack, fCount * sizeof(SkRegionPriv::RunType));
68 }
69 fPtr = fMalloc.get();
70 fCount = count;
71 }
72 }
int count
SkRegion::RunType RunType
void realloc(size_t count)

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