Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
SkRegionPriv Class Reference

#include <SkRegionPriv.h>

Public Types

typedef SkRegion::RunType RunType
 
typedef SkRegion::RunHead RunHead
 

Static Public Member Functions

static void VisitSpans (const SkRegion &rgn, const std::function< void(const SkIRect &)> &)
 

Static Public Attributes

static constexpr int kRunTypeSentinel = 0x7FFFFFFF
 

Detailed Description

Definition at line 19 of file SkRegionPriv.h.

Member Typedef Documentation

◆ RunHead

Definition at line 23 of file SkRegionPriv.h.

◆ RunType

typedef SkRegion::RunType SkRegionPriv::RunType

Definition at line 22 of file SkRegionPriv.h.

Member Function Documentation

◆ VisitSpans()

void SkRegionPriv::VisitSpans ( const SkRegion rgn,
const std::function< void(const SkIRect &)> &  visitor 
)
static

Definition at line 1555 of file SkRegion.cpp.

1556 {
1557 if (rgn.isEmpty()) {
1558 return;
1559 }
1560 if (rgn.isRect()) {
1561 visitor(rgn.getBounds());
1562 } else {
1563 const int32_t* p = rgn.fRunHead->readonly_runs();
1564 int32_t top = *p++;
1565 int32_t bot = *p++;
1566 do {
1567 int pairCount = *p++;
1568 if (pairCount == 1) {
1569 visitor({ p[0], top, p[1], bot });
1570 p += 2;
1571 } else if (pairCount > 1) {
1572 // we have to loop repeated in Y, sending each interval in Y -> X order
1573 for (int y = top; y < bot; ++y) {
1574 visit_pairs(pairCount, y, p, visitor);
1575 }
1576 p += pairCount * 2;
1577 }
1578 assert_sentinel(*p, true);
1579 p += 1; // skip sentinel
1580
1581 // read next bottom or sentinel
1582 top = bot;
1583 bot = *p++;
1584 } while (!SkRegionValueIsSentinel(bot));
1585 }
1586}
#define assert_sentinel(value, isSentinel)
bool SkRegionValueIsSentinel(int32_t value)
static void visit_pairs(int pairCount, int y, const int32_t pairs[], const std::function< void(const SkIRect &)> &visitor)
bool isRect() const
Definition SkRegion.h:152
const SkIRect & getBounds() const
Definition SkRegion.h:165
bool isEmpty() const
Definition SkRegion.h:146
double y
const SkRegion::RunType * readonly_runs() const

Member Data Documentation

◆ kRunTypeSentinel

constexpr int SkRegionPriv::kRunTypeSentinel = 0x7FFFFFFF
inlinestaticconstexpr

Definition at line 21 of file SkRegionPriv.h.


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