• Home
  • Raw
  • Download

Lines Matching full: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()
248 // runs[2] is uncomputed intervalCount 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()
263 if (stop[-5] == SkRegion::kRunTypeSentinel) { // eek, stop[-4] was a bottom with no x-runs in setRuns()
273 count = (int)(stop - runs); in setRuns()
278 if (SkRegion::RunsAreARect(runs, count, &fBounds)) { in setRuns()
290 // must call this before we can write directly into runs() 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()
329 // appear as a left-inteval (runs[0]) and should abort the search. in contains()
331 // We could do a bsearch, using interval-count (runs[1]), but need to time 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()
1134 // never read beyond &runs[runCount-1].
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()
1166 rect.fBottom = *runs++; in validate_run()
1177 int32_t xIntervals = *runs++; in validate_run()
1178 SkASSERT(runs < end); in validate_run()
1179 if (xIntervals < 0 || runs + 1 + 2 * xIntervals > end) { in validate_run()
1189 rect.fLeft = *runs++; in validate_run()
1190 rect.fRight = *runs++; in validate_run()
1201 if (*runs++ != SkRegion::kRunTypeSentinel) { in validate_run()
1205 SkASSERT(runs < end); in validate_run()
1206 } while (*runs != SkRegion::kRunTypeSentinel); in validate_run()
1207 ++runs; in validate_run()
1211 SkASSERT(runs == end); // if ySpanCount && intervalCount are right, must be correct length. in validate_run()
1225 // COUNT LEFT TOP RIGHT BOTTOM Y_SPAN_COUNT TOTAL_INTERVAL_COUNT [RUNS....] in readFromMemory()
1244 return 0; // invalid runs, don't even allocate in readFromMemory()
1290 const RunType* runs = fRunHead->readonly_runs(); in dump() local
1292 SkDebugf(" %d", runs[i]); in dump()
1342 const RunType* runs = fRuns; in next() local
1344 if (runs[0] < kRunTypeSentinel) { // valid X value in next()
1345 fRect.fLeft = runs[0]; in next()
1346 fRect.fRight = runs[1]; in next()
1347 runs += 2; in next()
1349 runs += 1; in next()
1350 if (runs[0] < kRunTypeSentinel) { // valid Y value in next()
1351 int intervals = runs[1]; in next()
1353 fRect.fTop = runs[0]; in next()
1354 runs += 3; in next()
1359 fRect.fBottom = runs[0]; in next()
1360 assert_sentinel(runs[2], false); in next()
1361 assert_sentinel(runs[3], false); in next()
1362 fRect.fLeft = runs[2]; in next()
1363 fRect.fRight = runs[3]; in next()
1364 runs += 4; in next()
1369 fRuns = runs; in next()
1432 const SkRegion::RunType* runs = rgn.fRunHead->findScanline(y); in Spanerator() local
1433 runs += 2; // skip Bottom and IntervalCount in Spanerator()
1435 // runs[0..1] is to the right of the span, so we're done in Spanerator()
1436 if (runs[0] >= right) { in Spanerator()
1439 // runs[0..1] is to the left of the span, so continue in Spanerator()
1440 if (runs[1] <= left) { in Spanerator()
1441 runs += 2; in Spanerator()
1444 // runs[0..1] intersects the span in Spanerator()
1445 fRuns = runs; in Spanerator()
1471 const SkRegion::RunType* runs = fRuns; in next() local
1473 if (runs[0] >= fRight) { in next()
1478 SkASSERT(runs[1] > fLeft); in next()
1481 *left = SkMax32(fLeft, runs[0]); in next()
1484 *right = SkMin32(fRight, runs[1]); in next()
1486 fRuns = runs + 2; in next()
1494 bool SkRegion::debugSetRuns(const RunType runs[], int count) { in debugSetRuns() argument
1499 memcpy(storage.get(), runs, count * sizeof(RunType)); in debugSetRuns()