Lines Matching full:runs
86 static SkRegionPriv::RunType* skip_intervals(const SkRegionPriv::RunType runs[]) { in skip_intervals() argument
87 int intervals = runs[-1]; in skip_intervals()
90 SkASSERT(runs[0] < runs[1]); in skip_intervals()
91 SkASSERT(runs[1] < SkRegion_kRunTypeSentinel); in skip_intervals()
94 SkASSERT(SkRegion_kRunTypeSentinel == runs[0]); in skip_intervals()
97 runs += intervals * 2 + 1; in skip_intervals()
98 return const_cast<SkRegionPriv::RunType*>(runs); in skip_intervals()
101 bool SkRegion::RunsAreARect(const SkRegion::RunType runs[], int count, in RunsAreARect() argument
103 assert_sentinel(runs[0], false); // top in RunsAreARect()
107 assert_sentinel(runs[1], false); // bottom in RunsAreARect()
108 SkASSERT(1 == runs[2]); in RunsAreARect()
109 assert_sentinel(runs[3], false); // left in RunsAreARect()
110 assert_sentinel(runs[4], false); // right in RunsAreARect()
111 assert_sentinel(runs[5], true); in RunsAreARect()
112 assert_sentinel(runs[6], true); in RunsAreARect()
114 SkASSERT(runs[0] < runs[1]); // valid height in RunsAreARect()
115 SkASSERT(runs[3] < runs[4]); // valid width in RunsAreARect()
117 bounds->setLTRB(runs[3], runs[0], runs[4], runs[1]); in RunsAreARect()
281 bool SkRegion::setRuns(RunType runs[], int count) { in setRuns() argument
287 assert_sentinel(runs[count-1], true); in setRuns()
294 RunType* stop = runs + count; in setRuns()
295 assert_sentinel(runs[0], false); // top in setRuns()
296 assert_sentinel(runs[1], false); // bottom in setRuns()
297 // runs[2] is uncomputed intervalCount in setRuns()
299 if (runs[3] == SkRegion_kRunTypeSentinel) { // should be first left... in setRuns()
300 runs += 3; // skip empty initial span in setRuns()
301 runs[0] = runs[-2]; // set new top to prev bottom in setRuns()
302 assert_sentinel(runs[1], false); // bot: a sentinal would mean two in a row in setRuns()
303 assert_sentinel(runs[2], false); // intervalcount in setRuns()
304 assert_sentinel(runs[3], false); // left in setRuns()
305 assert_sentinel(runs[4], false); // right in setRuns()
312 if (stop[-5] == SkRegion_kRunTypeSentinel) { // eek, stop[-4] was a bottom with no x-runs in setRuns()
322 count = (int)(stop - runs); in setRuns()
327 if (SkRegion::RunsAreARect(runs, count, &fBounds)) { in setRuns()
339 // must call this before we can write directly into runs() in setRuns()
342 memcpy(fRunHead->writable_runs(), runs, count * sizeof(RunType)); in setRuns()
356 RunType runs[kRectRegionRuns]) { in BuildRectRuns()
357 runs[0] = bounds.fTop; in BuildRectRuns()
358 runs[1] = bounds.fBottom; in BuildRectRuns()
359 runs[2] = 1; // 1 interval for this scanline in BuildRectRuns()
360 runs[3] = bounds.fLeft; in BuildRectRuns()
361 runs[4] = bounds.fRight; in BuildRectRuns()
362 runs[5] = SkRegion_kRunTypeSentinel; in BuildRectRuns()
363 runs[6] = SkRegion_kRunTypeSentinel; in BuildRectRuns()
377 const RunType* runs = fRunHead->findScanline(y); in contains() local
380 runs += 2; in contains()
383 // appear as a left-inteval (runs[0]) and should abort the search. in contains()
385 // We could do a bsearch, using interval-count (runs[1]), but need to time in contains()
389 if (x < runs[0]) { in contains()
392 if (x < runs[1]) { in contains()
395 runs += 2; in contains()
400 static SkRegionPriv::RunType scanline_bottom(const SkRegionPriv::RunType runs[]) { in scanline_bottom() argument
401 return runs[0]; in scanline_bottom()
404 static const SkRegionPriv::RunType* scanline_next(const SkRegionPriv::RunType runs[]) { in scanline_next() argument
406 return runs + 2 + runs[1] * 2 + 1; in scanline_next()
409 static bool scanline_contains(const SkRegionPriv::RunType runs[], in scanline_contains() argument
411 runs += 2; // skip Bottom and IntervalCount in scanline_contains()
413 if (L < runs[0]) { in scanline_contains()
416 if (R <= runs[1]) { in scanline_contains()
419 runs += 2; in scanline_contains()
472 const RunType* runs = tmpStorage; in getRuns() local
481 runs = fRunHead->readonly_runs(); in getRuns()
484 return runs; in getRuns()
489 static bool scanline_intersects(const SkRegionPriv::RunType runs[], in scanline_intersects() argument
491 runs += 2; // skip Bottom and IntervalCount in scanline_intersects()
493 if (R <= runs[0]) { in scanline_intersects()
496 if (L < runs[1]) { in scanline_intersects()
499 runs += 2; in scanline_intersects()
778 static int distance_to_sentinel(const SkRegionPriv::RunType* runs) { in distance_to_sentinel() argument
779 const SkRegionPriv::RunType* ptr = runs; in distance_to_sentinel()
781 return ptr - runs; in distance_to_sentinel()
1201 // never read beyond &runs[runCount-1].
1202 static bool validate_run(const int32_t* runs, in validate_run() argument
1214 if (runs[runCount - 1] != SkRegion_kRunTypeSentinel || in validate_run()
1215 runs[runCount - 2] != SkRegion_kRunTypeSentinel) { in validate_run()
1218 const int32_t* const end = runs + runCount; in validate_run()
1221 rect.fTop = *runs++; in validate_run()
1233 rect.fBottom = *runs++; in validate_run()
1244 int32_t xIntervals = *runs++; in validate_run()
1245 SkASSERT(runs < end); in validate_run()
1246 if (xIntervals < 0 || xIntervals > intervalCount || runs + 1 + 2 * xIntervals > end) { in validate_run()
1253 rect.fLeft = *runs++; in validate_run()
1254 rect.fRight = *runs++; in validate_run()
1265 if (*runs++ != SkRegion_kRunTypeSentinel) { in validate_run()
1269 SkASSERT(runs < end); in validate_run()
1270 } while (*runs != SkRegion_kRunTypeSentinel); in validate_run()
1271 ++runs; in validate_run()
1275 SkASSERT(runs == end); // if ySpanCount && intervalCount are right, must be correct length. in validate_run()
1289 // COUNT LEFT TOP RIGHT BOTTOM Y_SPAN_COUNT TOTAL_INTERVAL_COUNT [RUNS....] in readFromMemory()
1308 return 0; // invalid runs, don't even allocate in readFromMemory()
1347 const RunType* runs = fRunHead->readonly_runs(); in dump() local
1349 SkDebugf(" %d", runs[i]); in dump()
1399 const RunType* runs = fRuns; in next() local
1401 if (runs[0] < SkRegion_kRunTypeSentinel) { // valid X value in next()
1402 fRect.fLeft = runs[0]; in next()
1403 fRect.fRight = runs[1]; in next()
1404 runs += 2; in next()
1406 runs += 1; in next()
1407 if (runs[0] < SkRegion_kRunTypeSentinel) { // valid Y value in next()
1408 int intervals = runs[1]; in next()
1410 fRect.fTop = runs[0]; in next()
1411 runs += 3; in next()
1416 fRect.fBottom = runs[0]; in next()
1417 assert_sentinel(runs[2], false); in next()
1418 assert_sentinel(runs[3], false); in next()
1419 fRect.fLeft = runs[2]; in next()
1420 fRect.fRight = runs[3]; in next()
1421 runs += 4; in next()
1426 fRuns = runs; in next()
1489 const SkRegion::RunType* runs = rgn.fRunHead->findScanline(y); in Spanerator() local
1490 runs += 2; // skip Bottom and IntervalCount in Spanerator()
1492 // runs[0..1] is to the right of the span, so we're done in Spanerator()
1493 if (runs[0] >= right) { in Spanerator()
1496 // runs[0..1] is to the left of the span, so continue in Spanerator()
1497 if (runs[1] <= left) { in Spanerator()
1498 runs += 2; in Spanerator()
1501 // runs[0..1] intersects the span in Spanerator()
1502 fRuns = runs; in Spanerator()
1528 const SkRegion::RunType* runs = fRuns; in next() local
1530 if (runs[0] >= fRight) { in next()
1535 SkASSERT(runs[1] > fLeft); in next()
1538 *left = std::max(fLeft, runs[0]); in next()
1541 *right = std::min(fRight, runs[1]); in next()
1543 fRuns = runs + 2; in next()