Home | History | Annotate | Download | only in core

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);
186 char* SkRegion::toString() {
193 // 4 ints, up to 10 digits each plus sign, 3 commas, '(', ')', SkRegion() and '\0'
199 count = sprintf(result, "SkRegion(");
213 int SkRegion::count_runtype_values(int* itop, int* ibot) const {
237 bool SkRegion::setRuns(RunType runs[], int count) {
255 if (runs[3] == SkRegion::kRunTypeSentinel) { // should be first left...
268 if (stop[-5] == SkRegion::kRunTypeSentinel) { // eek, stop[-4] was a bottom with no x-runs
269 stop[-4] = SkRegion::kRunTypeSentinel; // kill empty last span
283 if (SkRegion::RunsAreARect(runs, count, &fBounds)) {
305 void SkRegion::BuildRectRuns(const SkIRect& bounds,
316 bool SkRegion::contains(int32_t x, int32_t y) const {
350 static SkRegion::RunType scanline_bottom(const SkRegion::RunType runs[]) {
354 static const SkRegion::RunType* scanline_next(const SkRegion::RunType runs[]) {
359 static bool scanline_contains(const SkRegion::RunType runs[],
360 SkRegion::RunType L, SkRegion::RunType R) {
374 bool SkRegion::contains(const SkIRect& r) const {
398 bool SkRegion::contains(const SkRegion& rgn) const {
419 const SkRegion::RunType* SkRegion::getRuns(RunType tmpStorage[],
439 static bool scanline_intersects(const SkRegion::RunType runs[],
440 SkRegion::RunType L, SkRegion::RunType R) {
454 bool SkRegion::intersects(const SkIRect& r) const {
483 bool SkRegion::intersects(const SkRegion& rgn) const {
511 bool SkRegion::operator==(const SkRegion& b) const {
522 const SkRegion::RunHead* ah = fRunHead;
523 const SkRegion::RunHead* bh = b.fRunHead;
535 ah->fRunCount * sizeof(SkRegion::RunType));
538 void SkRegion::translate(int dx, int dy, SkRegion* dst) const {
553 SkRegion tmp;
564 *druns++ = (SkRegion::RunType)(*sruns++ + dy); // top
570 *druns++ = (SkRegion::RunType)(bottom + dy); // bottom;
577 *druns++ = (SkRegion::RunType)(x + dx);
578 *druns++ = (SkRegion::RunType)(*sruns++ + dx);
593 bool SkRegion::setRects(const SkIRect rects[], int count) {
615 SkASSERT(left == SkRegion::kRunTypeSentinel || left < rite);
622 const SkRegion::RunType* fA_runs;
623 const SkRegion::RunType* fB_runs;
627 void init(const SkRegion::RunType a_runs[],
628 const SkRegion::RunType b_runs[]) {
639 SkASSERT(fA_left <= SkRegion::kRunTypeSentinel);
640 SkASSERT(fB_left <= SkRegion::kRunTypeSentinel);
641 return fA_left == SkRegion::kRunTypeSentinel &&
642 fB_left == SkRegion::kRunTypeSentinel;
712 static SkRegion::RunType* operate_on_span(const SkRegion::RunType a_runs[],
713 const SkRegion::RunType b_runs[],
714 SkRegion::RunType dst[],
731 *dst++ = (SkRegion::RunType)(left);
732 *dst++ = (SkRegion::RunType)(rite);
736 dst[-1] = (SkRegion::RunType)(rite);
741 *dst++ = SkRegion::kRunTypeSentinel;
761 RgnOper(int top, SkRegion::RunType dst[], SkRegion::Op op) {
763 SkASSERT(SkRegion::kDifference_Op == 0);
764 SkASSERT(SkRegion::kIntersect_Op == 1);
765 SkASSERT(SkRegion::kUnion_Op == 2);
766 SkASSERT(SkRegion::kXOR_Op == 3);
772 fTop = (SkRegion::RunType)(top); // just a first guess, we might update this
778 void addSpan(int bottom, const SkRegion::RunType a_runs[],
779 const SkRegion::RunType b_runs[]) {
781 SkRegion::RunType* start = fPrevDst + fPrevLen + 2;
783 SkRegion::RunType* stop = operate_on_span(a_runs, b_runs, start, fMin, fMax);
786 SkASSERT(SkRegion::kRunTypeSentinel == stop[-1]);
790 (len - 1) * sizeof(SkRegion::RunType)))) {
792 fPrevDst[-2] = (SkRegion::RunType)(bottom);
795 fTop = (SkRegion::RunType)(bottom); // just update our bottom
797 start[-2] = (SkRegion::RunType)(bottom);
807 fPrevDst[fPrevLen] = SkRegion::kRunTypeSentinel;
816 SkRegion::RunType* fStartDst;
817 SkRegion::RunType* fPrevDst;
819 SkRegion::RunType fTop;
825 static int operate(const SkRegion::RunType a_runs[],
826 const SkRegion::RunType b_runs[],
827 SkRegion::RunType dst[],
828 SkRegion::Op op,
830 const SkRegion::RunType gEmptyScanline[] = {
833 SkRegion::kRunTypeSentinel,
841 const SkRegion::RunType* const gSentinel = &gEmptyScanline[2];
860 int prevBot = SkRegion::kRunTypeSentinel; // so we fail the first test
862 while (a_bot < SkRegion::kRunTypeSentinel ||
863 b_bot < SkRegion::kRunTypeSentinel) {
865 const SkRegion::RunType* run0 = gSentinel;
866 const SkRegion::RunType* run1 = gSentinel;
916 if (a_bot == SkRegion::kRunTypeSentinel) {
925 if (b_bot == SkRegion::kRunTypeSentinel) {
972 static bool setEmptyCheck(SkRegion* result) {
976 static bool setRectCheck(SkRegion* result, const SkIRect& rect) {
980 static bool setRegionCheck(SkRegion* result, const SkRegion& rgn) {
984 bool SkRegion::Oper(const SkRegion& rgnaOrig, const SkRegion& rgnbOrig, Op op,
985 SkRegion* result) {
993 const SkRegion* rgna = &rgnaOrig;
994 const SkRegion* rgnb = &rgnbOrig;
999 SkTSwap<const SkRegion*>(rgna, rgnb);
1093 bool SkRegion::op(const SkRegion& rgna, const SkRegion& rgnb, Op op) {
1095 return SkRegion::Oper(rgna, rgnb, op, this);
1102 uint32_t SkRegion::writeToMemory(void* storage) const {
1135 uint32_t SkRegion::readFromMemory(const void* storage) {
1137 SkRegion tmp;
1158 const SkRegion& SkRegion::GetEmptyRegion() {
1159 static SkRegion gEmpty;
1168 static const SkRegion::RunType* skip_intervals_slow(const SkRegion::RunType runs[]) {
1173 SkRegion::RunType prevR = -SkRegion::kRunTypeSentinel;
1175 while (runs[0] < SkRegion::kRunTypeSentinel) {
1178 SkASSERT(runs[1] < SkRegion::kRunTypeSentinel);
1185 static void compute_bounds(const SkRegion::RunType runs[],
1199 SkASSERT(SkRegion::kRunTypeSentinel > bot);
1204 if (*runs < SkRegion::kRunTypeSentinel) {
1209 const SkRegion::RunType* prev = runs;
1221 SkASSERT(SkRegion::kRunTypeSentinel == *runs);
1223 } while (SkRegion::kRunTypeSentinel != *runs);
1232 void SkRegion::validate() const {
1262 void SkRegion::dump() const {
1280 SkRegion::Iterator::Iterator(const SkRegion& rgn) {
1284 bool SkRegion::Iterator::rewind() {
1292 void SkRegion::Iterator::reset(const SkRegion& rgn) {
1310 void SkRegion::Iterator::next() {
1350 SkRegion::Cliperator::Cliperator(const SkRegion& rgn, const SkIRect& clip)
1366 void SkRegion::Cliperator::next() {
1389 SkRegion::Spanerator::Spanerator(const SkRegion& rgn, int y, int left,
1410 const SkRegion::RunType* runs = rgn.fRunHead->findScanline(y);
1433 bool SkRegion::Spanerator::next(int* left, int* right) {
1449 const SkRegion::RunType* runs = fRuns;
1472 bool SkRegion::debugSetRuns(const RunType runs[], int count) {