Lines Matching refs:runs
32 static SkRegion::RunType* skip_intervals(const SkRegion::RunType runs[]) {
33 int intervals = runs[-1];
36 SkASSERT(runs[0] < runs[1]);
37 SkASSERT(runs[1] < SkRegion::kRunTypeSentinel);
40 SkASSERT(SkRegion::kRunTypeSentinel == runs[0]);
43 runs += intervals * 2 + 1;
44 return const_cast<SkRegion::RunType*>(runs);
47 bool SkRegion::RunsAreARect(const SkRegion::RunType runs[], int count, in RunsAreARect() argument
49 assert_sentinel(runs[0], false); // top in RunsAreARect()
53 assert_sentinel(runs[1], false); // bottom in RunsAreARect()
54 SkASSERT(1 == runs[2]); in RunsAreARect()
55 assert_sentinel(runs[3], false); // left in RunsAreARect()
56 assert_sentinel(runs[4], false); // right in RunsAreARect()
57 assert_sentinel(runs[5], true); in RunsAreARect()
58 assert_sentinel(runs[6], true); in RunsAreARect()
60 SkASSERT(runs[0] < runs[1]); // valid height in RunsAreARect()
61 SkASSERT(runs[3] < runs[4]); // valid width in RunsAreARect()
63 bounds->set(runs[3], runs[0], runs[4], runs[1]); in RunsAreARect()
232 bool SkRegion::setRuns(RunType runs[], int count) { in setRuns() argument
238 assert_sentinel(runs[count-1], true); in setRuns()
245 RunType* stop = runs + count; in setRuns()
246 assert_sentinel(runs[0], false); // top in setRuns()
247 assert_sentinel(runs[1], false); // bottom in setRuns()
250 if (runs[3] == SkRegion::kRunTypeSentinel) { // should be first left... in setRuns()
251 runs += 3; // skip empty initial span in setRuns()
252 runs[0] = runs[-2]; // set new top to prev bottom in setRuns()
253 assert_sentinel(runs[1], false); // bot: a sentinal would mean two in a row in setRuns()
254 assert_sentinel(runs[2], false); // intervalcount in setRuns()
255 assert_sentinel(runs[3], false); // left in setRuns()
256 assert_sentinel(runs[4], false); // right in setRuns()
273 count = (int)(stop - runs); in setRuns()
278 if (SkRegion::RunsAreARect(runs, count, &fBounds)) { in setRuns()
293 memcpy(fRunHead->writable_runs(), runs, count * sizeof(RunType)); in setRuns()
302 RunType runs[kRectRegionRuns]) { in BuildRectRuns()
303 runs[0] = bounds.fTop; in BuildRectRuns()
304 runs[1] = bounds.fBottom; in BuildRectRuns()
305 runs[2] = 1; // 1 interval for this scanline in BuildRectRuns()
306 runs[3] = bounds.fLeft; in BuildRectRuns()
307 runs[4] = bounds.fRight; in BuildRectRuns()
308 runs[5] = kRunTypeSentinel; in BuildRectRuns()
309 runs[6] = kRunTypeSentinel; in BuildRectRuns()
323 const RunType* runs = fRunHead->findScanline(y); in contains() local
326 runs += 2; in contains()
335 if (x < runs[0]) { in contains()
338 if (x < runs[1]) { in contains()
341 runs += 2; in contains()
346 static SkRegion::RunType scanline_bottom(const SkRegion::RunType runs[]) { in scanline_bottom() argument
347 return runs[0]; in scanline_bottom()
350 static const SkRegion::RunType* scanline_next(const SkRegion::RunType runs[]) { in scanline_next() argument
352 return runs + 2 + runs[1] * 2 + 1; in scanline_next()
355 static bool scanline_contains(const SkRegion::RunType runs[], in scanline_contains() argument
357 runs += 2; // skip Bottom and IntervalCount in scanline_contains()
359 if (L < runs[0]) { in scanline_contains()
362 if (R <= runs[1]) { in scanline_contains()
365 runs += 2; in scanline_contains()
418 const RunType* runs = tmpStorage; in getRuns() local
427 runs = fRunHead->readonly_runs(); in getRuns()
430 return runs; in getRuns()
435 static bool scanline_intersects(const SkRegion::RunType runs[], in scanline_intersects() argument
437 runs += 2; // skip Bottom and IntervalCount in scanline_intersects()
439 if (R <= runs[0]) { in scanline_intersects()
442 if (L < runs[1]) { in scanline_intersects()
445 runs += 2; in scanline_intersects()
1135 static bool validate_run(const int32_t* runs, in validate_run() argument
1147 if (runs[runCount - 1] != SkRegion::kRunTypeSentinel || in validate_run()
1148 runs[runCount - 2] != SkRegion::kRunTypeSentinel) { in validate_run()
1151 const int32_t* const end = runs + runCount; in validate_run()
1154 rect.fTop = *runs++; in validate_run()
1163 rect.fBottom = *runs++; in validate_run()
1167 int32_t xIntervals = *runs++; in validate_run()
1168 SkASSERT(runs < end); in validate_run()
1169 if (xIntervals < 0 || runs + 1 + 2 * xIntervals > end) { in validate_run()
1177 rect.fLeft = *runs++; in validate_run()
1178 rect.fRight = *runs++; in validate_run()
1185 if (*runs++ != SkRegion::kRunTypeSentinel) { in validate_run()
1189 SkASSERT(runs < end); in validate_run()
1190 } while (*runs != SkRegion::kRunTypeSentinel); in validate_run()
1191 ++runs; in validate_run()
1195 SkASSERT(runs == end); // if ySpanCount && intervalCount are right, must be correct length. in validate_run()
1274 const RunType* runs = fRunHead->readonly_runs(); in dump() local
1276 SkDebugf(" %d", runs[i]); in dump()
1326 const RunType* runs = fRuns; in next() local
1328 if (runs[0] < kRunTypeSentinel) { // valid X value in next()
1329 fRect.fLeft = runs[0]; in next()
1330 fRect.fRight = runs[1]; in next()
1331 runs += 2; in next()
1333 runs += 1; in next()
1334 if (runs[0] < kRunTypeSentinel) { // valid Y value in next()
1335 int intervals = runs[1]; in next()
1337 fRect.fTop = runs[0]; in next()
1338 runs += 3; in next()
1343 fRect.fBottom = runs[0]; in next()
1344 assert_sentinel(runs[2], false); in next()
1345 assert_sentinel(runs[3], false); in next()
1346 fRect.fLeft = runs[2]; in next()
1347 fRect.fRight = runs[3]; in next()
1348 runs += 4; in next()
1353 fRuns = runs; in next()
1416 const SkRegion::RunType* runs = rgn.fRunHead->findScanline(y); in Spanerator() local
1417 runs += 2; // skip Bottom and IntervalCount in Spanerator()
1420 if (runs[0] >= right) { in Spanerator()
1424 if (runs[1] <= left) { in Spanerator()
1425 runs += 2; in Spanerator()
1429 fRuns = runs; in Spanerator()
1455 const SkRegion::RunType* runs = fRuns; in next() local
1457 if (runs[0] >= fRight) { in next()
1462 SkASSERT(runs[1] > fLeft); in next()
1465 *left = SkMax32(fLeft, runs[0]); in next()
1468 *right = SkMin32(fRight, runs[1]); in next()
1470 fRuns = runs + 2; in next()
1478 bool SkRegion::debugSetRuns(const RunType runs[], int count) { in debugSetRuns() argument
1483 memcpy(storage.get(), runs, count * sizeof(RunType)); in debugSetRuns()