Lines Matching defs:SkRegion

33 static SkRegion::RunType* skip_intervals(const SkRegion::RunType runs[]) {
38 SkASSERT(runs[1] < SkRegion::kRunTypeSentinel);
41 SkASSERT(SkRegion::kRunTypeSentinel == runs[0]);
45 return const_cast<SkRegion::RunType*>(runs);
48 bool SkRegion::RunsAreARect(const SkRegion::RunType runs[], int count,
72 SkRegion::SkRegion() {
77 SkRegion::SkRegion(const SkRegion& src) {
82 SkRegion::SkRegion(const SkIRect& rect) {
87 SkRegion::~SkRegion() {
91 void SkRegion::freeRuns() {
103 void SkRegion::allocateRuns(int count, int ySpanCount, int intervalCount) {
107 void SkRegion::allocateRuns(int count) {
111 void SkRegion::allocateRuns(const RunHead& head) {
117 SkRegion& SkRegion::operator=(const SkRegion& src) {
122 void SkRegion::swap(SkRegion& other) {
127 int SkRegion::computeRegionComplexity() const {
136 bool SkRegion::setEmpty() {
143 bool SkRegion::setRect(int32_t left, int32_t top,
154 bool SkRegion::setRect(const SkIRect& r) {
158 bool SkRegion::setRegion(const SkRegion& src) {
171 bool SkRegion::op(const SkIRect& rect, const SkRegion& rgn, Op op) {
172 SkRegion tmp(rect);
177 bool SkRegion::op(const SkRegion& rgn, const SkIRect& rect, Op op) {
178 SkRegion tmp(rect);
187 char* SkRegion::toString() {
194 // 4 ints, up to 10 digits each plus sign, 3 commas, '(', ')', SkRegion() and '\0'
200 count = sprintf(result, "SkRegion(");
214 int SkRegion::count_runtype_values(int* itop, int* ibot) const {
232 bool SkRegion::setRuns(RunType runs[], int count) {
250 if (runs[3] == SkRegion::kRunTypeSentinel) { // should be first left...
263 if (stop[-5] == SkRegion::kRunTypeSentinel) { // eek, stop[-4] was a bottom with no x-runs
264 stop[-4] = SkRegion::kRunTypeSentinel; // kill empty last span
278 if (SkRegion::RunsAreARect(runs, count, &fBounds)) {
300 void SkRegion::BuildRectRuns(const SkIRect& bounds,
311 bool SkRegion::contains(int32_t x, int32_t y) const {
345 static SkRegion::RunType scanline_bottom(const SkRegion::RunType runs[]) {
349 static const SkRegion::RunType* scanline_next(const SkRegion::RunType runs[]) {
354 static bool scanline_contains(const SkRegion::RunType runs[],
355 SkRegion::RunType L, SkRegion::RunType R) {
369 bool SkRegion::contains(const SkIRect& r) const {
393 bool SkRegion::contains(const SkRegion& rgn) const {
414 const SkRegion::RunType* SkRegion::getRuns(RunType tmpStorage[],
434 static bool scanline_intersects(const SkRegion::RunType runs[],
435 SkRegion::RunType L, SkRegion::RunType R) {
449 bool SkRegion::intersects(const SkIRect& r) const {
478 bool SkRegion::intersects(const SkRegion& rgn) const {
506 bool SkRegion::operator==(const SkRegion& b) const {
517 const SkRegion::RunHead* ah = fRunHead;
518 const SkRegion::RunHead* bh = b.fRunHead;
530 ah->fRunCount * sizeof(SkRegion::RunType));
533 void SkRegion::translate(int dx, int dy, SkRegion* dst) const {
548 SkRegion tmp;
559 *druns++ = (SkRegion::RunType)(*sruns++ + dy); // top
565 *druns++ = (SkRegion::RunType)(bottom + dy); // bottom;
572 *druns++ = (SkRegion::RunType)(x + dx);
573 *druns++ = (SkRegion::RunType)(*sruns++ + dx);
588 bool SkRegion::setRects(const SkIRect rects[], int count) {
610 SkASSERT(left == SkRegion::kRunTypeSentinel || left < rite);
617 const SkRegion::RunType* fA_runs;
618 const SkRegion::RunType* fB_runs;
622 void init(const SkRegion::RunType a_runs[],
623 const SkRegion::RunType b_runs[]) {
634 SkASSERT(fA_left <= SkRegion::kRunTypeSentinel);
635 SkASSERT(fB_left <= SkRegion::kRunTypeSentinel);
636 return fA_left == SkRegion::kRunTypeSentinel &&
637 fB_left == SkRegion::kRunTypeSentinel;
707 static SkRegion::RunType* operate_on_span(const SkRegion::RunType a_runs[],
708 const SkRegion::RunType b_runs[],
709 SkRegion::RunType dst[],
726 *dst++ = (SkRegion::RunType)(left);
727 *dst++ = (SkRegion::RunType)(rite);
731 dst[-1] = (SkRegion::RunType)(rite);
736 *dst++ = SkRegion::kRunTypeSentinel;
756 RgnOper(int top, SkRegion::RunType dst[], SkRegion::Op op) {
758 SkASSERT(SkRegion::kDifference_Op == 0);
759 SkASSERT(SkRegion::kIntersect_Op == 1);
760 SkASSERT(SkRegion::kUnion_Op == 2);
761 SkASSERT(SkRegion::kXOR_Op == 3);
767 fTop = (SkRegion::RunType)(top); // just a first guess, we might update this
773 void addSpan(int bottom, const SkRegion::RunType a_runs[],
774 const SkRegion::RunType b_runs[]) {
776 SkRegion::RunType* start = fPrevDst + fPrevLen + 2;
778 SkRegion::RunType* stop = operate_on_span(a_runs, b_runs, start, fMin, fMax);
781 SkASSERT(SkRegion::kRunTypeSentinel == stop[-1]);
785 (len - 1) * sizeof(SkRegion::RunType)))) {
787 fPrevDst[-2] = (SkRegion::RunType)(bottom);
790 fTop = (SkRegion::RunType)(bottom); // just update our bottom
792 start[-2] = (SkRegion::RunType)(bottom);
802 fPrevDst[fPrevLen] = SkRegion::kRunTypeSentinel;
811 SkRegion::RunType* fStartDst;
812 SkRegion::RunType* fPrevDst;
814 SkRegion::RunType fTop;
820 static int operate(const SkRegion::RunType a_runs[],
821 const SkRegion::RunType b_runs[],
822 SkRegion::RunType dst[],
823 SkRegion::Op op,
825 const SkRegion::RunType gEmptyScanline[] = {
828 SkRegion::kRunTypeSentinel,
836 const SkRegion::RunType* const gSentinel = &gEmptyScanline[2];
855 int prevBot = SkRegion::kRunTypeSentinel; // so we fail the first test
857 while (a_bot < SkRegion::kRunTypeSentinel ||
858 b_bot < SkRegion::kRunTypeSentinel) {
860 const SkRegion::RunType* run0 = gSentinel;
861 const SkRegion::RunType* run1 = gSentinel;
911 if (a_bot == SkRegion::kRunTypeSentinel) {
920 if (b_bot == SkRegion::kRunTypeSentinel) {
967 static bool setEmptyCheck(SkRegion* result) {
971 static bool setRectCheck(SkRegion* result, const SkIRect& rect) {
975 static bool setRegionCheck(SkRegion* result, const SkRegion& rgn) {
979 bool SkRegion::Oper(const SkRegion& rgnaOrig, const SkRegion& rgnbOrig, Op op,
980 SkRegion* result) {
988 const SkRegion* rgna = &rgnaOrig;
989 const SkRegion* rgnb = &rgnbOrig;
994 SkTSwap<const SkRegion*>(rgna, rgnb);
1088 bool SkRegion::op(const SkRegion& rgna, const SkRegion& rgnb, Op op) {
1090 return SkRegion::Oper(rgna, rgnb, op, this);
1097 size_t SkRegion::writeToMemory(void* storage) const {
1130 size_t SkRegion::readFromMemory(const void* storage, size_t length) {
1132 SkRegion tmp;
1156 const SkRegion& SkRegion::GetEmptyRegion() {
1157 static SkRegion gEmpty;
1166 static const SkRegion::RunType* skip_intervals_slow(const SkRegion::RunType runs[]) {
1171 SkRegion::RunType prevR = -SkRegion::kRunTypeSentinel;
1173 while (runs[0] < SkRegion::kRunTypeSentinel) {
1176 SkASSERT(runs[1] < SkRegion::kRunTypeSentinel);
1183 static void compute_bounds(const SkRegion::RunType runs[],
1197 SkASSERT(SkRegion::kRunTypeSentinel > bot);
1202 if (*runs < SkRegion::kRunTypeSentinel) {
1207 const SkRegion::RunType* prev = runs;
1219 SkASSERT(SkRegion::kRunTypeSentinel == *runs);
1221 } while (SkRegion::kRunTypeSentinel != *runs);
1230 void SkRegion::validate() const {
1260 void SkRegion::dump() const {
1278 SkRegion::Iterator::Iterator(const SkRegion& rgn) {
1282 bool SkRegion::Iterator::rewind() {
1290 void SkRegion::Iterator::reset(const SkRegion& rgn) {
1308 void SkRegion::Iterator::next() {
1348 SkRegion::Cliperator::Cliperator(const SkRegion& rgn, const SkIRect& clip)
1364 void SkRegion::Cliperator::next() {
1387 SkRegion::Spanerator::Spanerator(const SkRegion& rgn, int y, int left,
1408 const SkRegion::RunType* runs = rgn.fRunHead->findScanline(y);
1431 bool SkRegion::Spanerator::next(int* left, int* right) {
1447 const SkRegion::RunType* runs = fRuns;
1470 bool SkRegion::debugSetRuns(const RunType runs[], int count) {