8#ifndef SkRegion_DEFINED
9#define SkRegion_DEFINED
31 typedef int32_t RunType;
106 return !(*
this == other);
123 return !this->isEmpty();
146 bool isEmpty()
const {
return fRunHead == emptyRunHeadPtr(); }
152 bool isRect()
const {
return fRunHead == kRectRunHeadPtr; }
158 bool isComplex()
const {
return !this->isEmpty() && !this->isRect(); }
178 int computeRegionComplexity()
const;
189 bool getBoundaryPath(
SkPath* path)
const;
208 bool setRect(
const SkIRect& rect);
237 bool setRegion(
const SkRegion& region);
261 bool intersects(
const SkIRect& rect)
const;
271 bool intersects(
const SkRegion& other)
const;
314 fRunHead == kRectRunHeadPtr &&
328 return this->isEmpty() || rect.isEmpty() ||
340 return this->isEmpty() || rgn.
isEmpty() ||
361 void translate(
int dx,
int dy,
SkRegion* dst)
const;
385 if (this->isRect() && kIntersect_Op == op) {
387 return this->setEmpty();
391 return this->op(*
this, rect, op);
435#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
488 bool done()
const {
return fDone; }
511 const SkRegion::RunType* fRuns;
590 const SkRegion::RunType* fRuns;
603 size_t writeToMemory(
void*
buffer)
const;
614 size_t readFromMemory(
const void*
buffer,
size_t length);
619 static constexpr int kOpCount = kReplace_Op + 1;
624 static constexpr int kRectRegionRuns = 7;
629 static constexpr RunHead* kRectRunHeadPtr =
nullptr;
632 void allocateRuns(
int count);
633 void allocateRuns(
int count,
int ySpanCount,
int intervalCount);
634 void allocateRuns(
const RunHead& src);
651 const RunType* getRuns(RunType tmpStorage[],
int* intervals)
const;
656 bool setRuns(RunType runs[],
int count);
658 int count_runtype_values(
int* itop,
int* ibot)
const;
660 bool isValid()
const;
662 static void BuildRectRuns(
const SkIRect& bounds,
663 RunType runs[kRectRegionRuns]);
667 static bool RunsAreARect(
const SkRegion::RunType runs[],
int count,
681 friend class SkFlatRegion;
static bool rewind(EdgeList *activeEdges, Vertex **current, Vertex *dst, const Comparator &c)
std::unique_ptr< SkLatticeIter > fIter
static float next(float f)
static bool contains(const SkRect &r, SkPoint p)
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
static bool left(const SkPoint &p0, const SkPoint &p1)
static bool right(const SkPoint &p0, const SkPoint &p1)
void swap(sk_sp< T > &a, sk_sp< T > &b)
static void dump(const float m[20], SkYUVColorSpace cs, bool rgb2yuv)
const SkIRect & rect() const
const SkIRect & rect() const
const SkRegion * rgn() const
void translate(int dx, int dy)
bool set(const SkRegion &src)
@ kReverseDifference_Op
operand minus target
@ kUnion_Op
target unioned with operand
@ kReplace_Op
replace target with operand
@ kIntersect_Op
target intersected with operand
@ kDifference_Op
target minus operand
@ kXOR_Op
target exclusive or with operand
bool quickContains(const SkIRect &r) const
const SkIRect & getBounds() const
bool op(const SkIRect &rect, Op op)
bool quickReject(const SkRegion &rgn) const
std::true_type sk_is_trivially_relocatable
bool quickReject(const SkIRect &rect) const
bool operator!=(const SkRegion &other) const
bool op(const SkRegion &rgn, Op op)
bool operator==(const FlutterPoint &a, const FlutterPoint &b)
static const uint8_t buffer[]
static bool Intersects(const SkIRect &a, const SkIRect &b)
int32_t fBottom
larger y-axis bounds
int32_t fTop
smaller y-axis bounds
int32_t fLeft
smaller x-axis bounds
int32_t fRight
larger x-axis bounds
SkScalar fBottom
larger y-axis bounds
bool intersect(const SkRect &r)
SkScalar fLeft
smaller x-axis bounds
SkScalar fRight
larger x-axis bounds
SkScalar fTop
smaller y-axis bounds