Home | History | Annotate | Download | only in core

Lines Matching refs:SkRegion

20 static SkRegion::RunType* skip_scanline(const SkRegion::RunType runs[])
22 while (runs[0] != SkRegion::kRunTypeSentinel)
27 return (SkRegion::RunType*)(runs + 1); // return past the X-sentinel
31 bool SkRegion::ComputeRunBounds(const SkRegion::RunType runs[], int count, SkIRect* bounds)
57 if (*runs < SkRegion::kRunTypeSentinel)
67 } while (runs[0] < SkRegion::kRunTypeSentinel);
76 SkRegion::SkRegion() {
81 SkRegion::SkRegion(const SkRegion& src) {
86 SkRegion::SkRegion(const SkIRect& rect) {
91 SkRegion::~SkRegion() {
95 void SkRegion::freeRuns() {
107 void SkRegion::allocateRuns(int count) {
111 SkRegion& SkRegion::operator=(const SkRegion& src) {
116 void SkRegion::swap(SkRegion& other) {
121 bool SkRegion::setEmpty() {
128 bool SkRegion::setRect(int32_t left, int32_t top,
139 bool SkRegion::setRect(const SkIRect& r) {
143 bool SkRegion::setRegion(const SkRegion& src) {
156 bool SkRegion::op(const SkIRect& rect, const SkRegion& rgn, Op op) {
157 SkRegion tmp(rect);
162 bool SkRegion::op(const SkRegion& rgn, const SkIRect& rect, Op op) {
163 SkRegion tmp(rect);
171 char* SkRegion::toString()
179 // 4 ints, up to 10 digits each plus sign, 3 commas, '(', ')', SkRegion() and '\0'
185 count = sprintf(result, "SkRegion(");
199 int SkRegion::count_runtype_values(int* itop, int* ibot) const
226 } while (runs[0] < SkRegion::kRunTypeSentinel);
233 bool SkRegion::setRuns(RunType runs[], int count)
252 if (runs[2] == SkRegion::kRunTypeSentinel) // should be first left...
265 if (stop[-4] == SkRegion::kRunTypeSentinel) // eek, stop[-3] was a bottom with no x-runs
267 stop[-3] = SkRegion::kRunTypeSentinel; // kill empty last span
296 while (*r < SkRegion::kRunTypeSentinel)
299 while (*r < SkRegion::kRunTypeSentinel)
322 void SkRegion::BuildRectRuns(const SkIRect& bounds,
333 static SkRegion::RunType* find_scanline(const SkRegion::RunType runs[], int y)
340 if (runs[0] == SkRegion::kRunTypeSentinel)
343 return (SkRegion::RunType*)&runs[1];
349 bool SkRegion::contains(int32_t x, int32_t y) const
372 bool SkRegion::contains(const SkIRect& r) const
374 SkRegion tmp(r);
379 bool SkRegion::contains(const SkRegion& rgn) const
387 SkRegion tmp;
393 const SkRegion::RunType* SkRegion::getRuns(RunType tmpStorage[], int* count) const
418 bool SkRegion::intersects(const SkIRect& r) const {
432 SkRegion tmp;
436 bool SkRegion::intersects(const SkRegion& rgn) const {
452 SkRegion tmp;
458 bool SkRegion::operator==(const SkRegion& b) const {
469 const SkRegion::RunHead* ah = fRunHead;
470 const SkRegion::RunHead* bh = b.fRunHead;
482 ah->fRunCount * sizeof(SkRegion::RunType));
485 void SkRegion::translate(int dx, int dy, SkRegion* dst) const {
500 SkRegion tmp;
511 *druns++ = (SkRegion::RunType)(*sruns++ + dy); // top
517 *druns++ = (SkRegion::RunType)(bottom + dy); // bottom;
523 *druns++ = (SkRegion::RunType)(x + dx);
524 *druns++ = (SkRegion::RunType)(*sruns++ + dx);
539 bool SkRegion::setRects(const SkIRect rects[], int count) {
561 SkASSERT(left == SkRegion::kRunTypeSentinel || left < rite);
568 const SkRegion::RunType* fA_runs;
569 const SkRegion::RunType* fB_runs;
573 void init(const SkRegion::RunType a_runs[], const SkRegion::RunType b_runs[])
586 SkASSERT(fA_left <= SkRegion::kRunTypeSentinel);
587 SkASSERT(fB_left <= SkRegion::kRunTypeSentinel);
588 return fA_left == SkRegion::kRunTypeSentinel && fB_left == SkRegion::kRunTypeSentinel;
670 static SkRegion::RunType* operate_on_span(const SkRegion::RunType a_runs[],
671 const SkRegion::RunType b_runs[],
672 SkRegion::RunType dst[],
693 *dst++ = (SkRegion::RunType)(left);
694 *dst++ = (SkRegion::RunType)(rite);
698 dst[-1] = (SkRegion::RunType)(rite);
702 *dst++ = SkRegion::kRunTypeSentinel;
722 RgnOper(int top, SkRegion::RunType dst[], SkRegion::Op op)
725 SkASSERT(SkRegion::kDifference_Op == 0);
726 SkASSERT(SkRegion::kIntersect_Op == 1);
727 SkASSERT(SkRegion::kUnion_Op == 2);
728 SkASSERT(SkRegion::kXOR_Op == 3);
734 fTop = (SkRegion::RunType)(top); // just a first guess, we might update this
740 void addSpan(int bottom, const SkRegion::RunType a_runs[], const SkRegion::RunType b_runs[])
742 SkRegion::RunType* start = fPrevDst + fPrevLen + 1; // skip X values and slot for the next Y
743 SkRegion::RunType* stop = operate_on_span(a_runs, b_runs, start, fMin, fMax);
746 if (fPrevLen == len && !memcmp(fPrevDst, start, len * sizeof(SkRegion::RunType))) // update Y value
747 fPrevDst[-1] = (SkRegion::RunType)(bottom);
751 fTop = (SkRegion::RunType)(bottom); // just update our bottom
753 start[-1] = (SkRegion::RunType)(bottom);
763 fPrevDst[fPrevLen] = SkRegion::kRunTypeSentinel;
770 SkRegion::RunType* fStartDst;
771 SkRegion::RunType* fPrevDst;
773 SkRegion::RunType fTop;
776 static int operate(const SkRegion::RunType a_runs[],
777 const SkRegion::RunType b_runs[],
778 SkRegion::RunType dst[],
779 SkRegion::Op op) {
780 const SkRegion::RunType gSentinel[] = {
781 SkRegion::kRunTypeSentinel,
801 int prevBot = SkRegion::kRunTypeSentinel; // so we fail the first test
803 while (a_bot < SkRegion::kRunTypeSentinel ||
804 b_bot < SkRegion::kRunTypeSentinel) {
806 const SkRegion::RunType* run0 = gSentinel;
807 const SkRegion::RunType* run1 = gSentinel;
853 if (a_bot == SkRegion::kRunTypeSentinel) {
861 if (b_bot == SkRegion::kRunTypeSentinel) {
908 bool SkRegion::op(const SkRegion& rgnaOrig, const SkRegion& rgnbOrig, Op op)
918 const SkRegion* rgna = &rgnaOrig;
919 const SkRegion* rgnb = &rgnbOrig;
925 SkTSwap<const SkRegion*>(rgna, rgnb);
992 uint32_t SkRegion::flatten(void* storage) const {
1022 uint32_t SkRegion::unflatten(const void* storage) {
1024 SkRegion tmp;
1043 const SkRegion& SkRegion::GetEmptyRegion() {
1044 static SkRegion gEmpty;
1052 static const SkRegion::RunType* validate_line(const SkRegion::RunType run[], const SkIRect& bounds)
1060 if (*run != SkRegion::kRunTypeSentinel)
1070 } while (*run < SkRegion::kRunTypeSentinel);
1075 void SkRegion::validate() const
1113 void SkRegion::dump() const
1134 SkRegion::Iterator::Iterator(const SkRegion& rgn) {
1138 bool SkRegion::Iterator::rewind() {
1146 void SkRegion::Iterator::reset(const SkRegion& rgn) {
1163 void SkRegion::Iterator::next() {
1201 SkRegion::Cliperator::Cliperator(const SkRegion& rgn, const SkIRect& clip)
1217 void SkRegion::Cliperator::next() {
1240 static SkRegion::RunType* find_y(const SkRegion::RunType runs[], int y) {
1246 if (bot == SkRegion::kRunTypeSentinel ||
1247 *runs == SkRegion::kRunTypeSentinel) {
1250 return (SkRegion::RunType*)runs;
1258 SkRegion::Spanerator::Spanerator(const SkRegion& rgn, int y, int left,
1279 const SkRegion::RunType* runs = find_y(
1304 bool SkRegion::Spanerator::next(int* left, int* right) {
1320 const SkRegion::RunType* runs = fRuns;
1343 bool SkRegion::debugSetRuns(const RunType runs[], int count) {