Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
SkAAClip::RunHead Struct Reference

Public Member Functions

YOffset * yoffsets ()
 
const YOffset * yoffsets () const
 
uint8_t * data ()
 
const uint8_t * data () const
 

Static Public Member Functions

static RunHeadAlloc (int rowCount, size_t dataSize)
 
static int ComputeRowSizeForWidth (int width)
 
static RunHeadAllocRect (const SkIRect &bounds)
 
static Iter Iterate (const SkAAClip &clip)
 

Public Attributes

std::atomic< int32_t > fRefCnt
 
int32_t fRowCount
 
size_t fDataSize
 

Detailed Description

Definition at line 175 of file SkAAClip.cpp.

Member Function Documentation

◆ Alloc()

static RunHead * SkAAClip::RunHead::Alloc ( int  rowCount,
size_t  dataSize 
)
inlinestatic

Definition at line 193 of file SkAAClip.cpp.

193 {
194 size_t size = sizeof(RunHead) + rowCount * sizeof(YOffset) + dataSize;
195 RunHead* head = (RunHead*)sk_malloc_throw(size);
196 head->fRefCnt.store(1);
197 head->fRowCount = rowCount;
198 head->fDataSize = dataSize;
199 return head;
200 }
static void * sk_malloc_throw(size_t size)
Definition: SkMalloc.h:67
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
Definition: switches.h:259

◆ AllocRect()

static RunHead * SkAAClip::RunHead::AllocRect ( const SkIRect bounds)
inlinestatic

Definition at line 213 of file SkAAClip.cpp.

213 {
214 SkASSERT(!bounds.isEmpty());
215 int width = bounds.width();
216 size_t rowSize = ComputeRowSizeForWidth(width);
217 RunHead* head = RunHead::Alloc(1, rowSize);
218 YOffset* yoff = head->yoffsets();
219 yoff->fY = bounds.height() - 1;
220 yoff->fOffset = 0;
221 uint8_t* row = head->data();
222 while (width > 0) {
223 int n = std::min(width, 255);
224 row[0] = n;
225 row[1] = 0xFF;
226 width -= n;
227 row += 2;
228 }
229 return head;
230 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
static float min(float r, float g, float b)
Definition: hsl.cpp:48
Optional< SkRect > bounds
Definition: SkRecords.h:189
int32_t width
static int ComputeRowSizeForWidth(int width)
Definition: SkAAClip.cpp:202
static RunHead * Alloc(int rowCount, size_t dataSize)
Definition: SkAAClip.cpp:193

◆ ComputeRowSizeForWidth()

static int SkAAClip::RunHead::ComputeRowSizeForWidth ( int  width)
inlinestatic

Definition at line 202 of file SkAAClip.cpp.

202 {
203 // 2 bytes per segment, where each segment can store up to 255 for count
204 int segments = 0;
205 while (width > 0) {
206 segments += 1;
207 int n = std::min(width, 255);
208 width -= n;
209 }
210 return segments * 2; // each segment is row[0] + row[1] (n + alpha)
211 }

◆ data() [1/2]

uint8_t * SkAAClip::RunHead::data ( )
inline

Definition at line 186 of file SkAAClip.cpp.

186 {
187 return (uint8_t*)(this->yoffsets() + fRowCount);
188 }
YOffset * yoffsets()
Definition: SkAAClip.cpp:180

◆ data() [2/2]

const uint8_t * SkAAClip::RunHead::data ( ) const
inline

Definition at line 189 of file SkAAClip.cpp.

189 {
190 return (const uint8_t*)(this->yoffsets() + fRowCount);
191 }

◆ Iterate()

static Iter SkAAClip::RunHead::Iterate ( const SkAAClip clip)
inlinestatic

Definition at line 232 of file SkAAClip.cpp.

232 {
233 const RunHead* head = clip.fRunHead;
234 if (!clip.fRunHead) {
235 // A null run head is an empty clip, so return aan already finished iterator.
236 return Iter();
237 }
238
239 return Iter(clip.getBounds().fTop, head->data(), head->yoffsets(),
240 head->yoffsets() + head->fRowCount);
241 }
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition: SkPath.cpp:3892
const SkRect & getBounds() const
Definition: SkPath.cpp:430
SkScalar fTop
smaller y-axis bounds
Definition: extension.cpp:15

◆ yoffsets() [1/2]

YOffset * SkAAClip::RunHead::yoffsets ( )
inline

Definition at line 180 of file SkAAClip.cpp.

180 {
181 return (YOffset*)((char*)this + sizeof(RunHead));
182 }

◆ yoffsets() [2/2]

const YOffset * SkAAClip::RunHead::yoffsets ( ) const
inline

Definition at line 183 of file SkAAClip.cpp.

183 {
184 return (const YOffset*)((const char*)this + sizeof(RunHead));
185 }

Member Data Documentation

◆ fDataSize

size_t SkAAClip::RunHead::fDataSize

Definition at line 178 of file SkAAClip.cpp.

◆ fRefCnt

std::atomic<int32_t> SkAAClip::RunHead::fRefCnt

Definition at line 176 of file SkAAClip.cpp.

◆ fRowCount

int32_t SkAAClip::RunHead::fRowCount

Definition at line 177 of file SkAAClip.cpp.


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