• Home
  • Raw
  • Download

Lines Matching refs:runs

33 static SkRegion::RunType* skip_intervals(const SkRegion::RunType runs[]) {
34 int intervals = runs[-1];
37 SkASSERT(runs[0] < runs[1]);
38 SkASSERT(runs[1] < SkRegion::kRunTypeSentinel);
41 SkASSERT(SkRegion::kRunTypeSentinel == runs[0]);
44 runs += intervals * 2 + 1;
45 return const_cast<SkRegion::RunType*>(runs);
48 bool SkRegion::RunsAreARect(const SkRegion::RunType runs[], int count, in RunsAreARect() argument
50 assert_sentinel(runs[0], false); // top in RunsAreARect()
54 assert_sentinel(runs[1], false); // bottom in RunsAreARect()
55 SkASSERT(1 == runs[2]); in RunsAreARect()
56 assert_sentinel(runs[3], false); // left in RunsAreARect()
57 assert_sentinel(runs[4], false); // right in RunsAreARect()
58 assert_sentinel(runs[5], true); in RunsAreARect()
59 assert_sentinel(runs[6], true); in RunsAreARect()
61 SkASSERT(runs[0] < runs[1]); // valid height in RunsAreARect()
62 SkASSERT(runs[3] < runs[4]); // valid width in RunsAreARect()
64 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()
292 memcpy(fRunHead->writable_runs(), runs, count * sizeof(RunType)); in setRuns()
301 RunType runs[kRectRegionRuns]) { in BuildRectRuns()
302 runs[0] = bounds.fTop; in BuildRectRuns()
303 runs[1] = bounds.fBottom; in BuildRectRuns()
304 runs[2] = 1; // 1 interval for this scanline in BuildRectRuns()
305 runs[3] = bounds.fLeft; in BuildRectRuns()
306 runs[4] = bounds.fRight; in BuildRectRuns()
307 runs[5] = kRunTypeSentinel; in BuildRectRuns()
308 runs[6] = kRunTypeSentinel; in BuildRectRuns()
322 const RunType* runs = fRunHead->findScanline(y); in contains() local
325 runs += 2; in contains()
334 if (x < runs[0]) { in contains()
337 if (x < runs[1]) { in contains()
340 runs += 2; in contains()
345 static SkRegion::RunType scanline_bottom(const SkRegion::RunType runs[]) { in scanline_bottom() argument
346 return runs[0]; in scanline_bottom()
349 static const SkRegion::RunType* scanline_next(const SkRegion::RunType runs[]) { in scanline_next() argument
351 return runs + 2 + runs[1] * 2 + 1; in scanline_next()
354 static bool scanline_contains(const SkRegion::RunType runs[], in scanline_contains() argument
356 runs += 2; // skip Bottom and IntervalCount in scanline_contains()
358 if (L < runs[0]) { in scanline_contains()
361 if (R <= runs[1]) { in scanline_contains()
364 runs += 2; in scanline_contains()
417 const RunType* runs = tmpStorage; in getRuns() local
426 runs = fRunHead->readonly_runs(); in getRuns()
429 return runs; in getRuns()
434 static bool scanline_intersects(const SkRegion::RunType runs[], in scanline_intersects() argument
436 runs += 2; // skip Bottom and IntervalCount in scanline_intersects()
438 if (R <= runs[0]) { in scanline_intersects()
441 if (L < runs[1]) { in scanline_intersects()
444 runs += 2; in scanline_intersects()
1166 static const SkRegion::RunType* skip_intervals_slow(const SkRegion::RunType runs[]) { in skip_intervals_slow() argument
1173 while (runs[0] < SkRegion::kRunTypeSentinel) { in skip_intervals_slow()
1174 SkASSERT(prevR < runs[0]); in skip_intervals_slow()
1175 SkASSERT(runs[0] < runs[1]); in skip_intervals_slow()
1176 SkASSERT(runs[1] < SkRegion::kRunTypeSentinel); in skip_intervals_slow()
1177 prevR = runs[1]; in skip_intervals_slow()
1178 runs += 2; in skip_intervals_slow()
1180 return runs; in skip_intervals_slow()
1183 static void compute_bounds(const SkRegion::RunType runs[], in compute_bounds() argument
1186 assert_sentinel(runs[0], false); // top in compute_bounds()
1194 bounds->fTop = *runs++; in compute_bounds()
1196 bot = *runs++; in compute_bounds()
1201 runs += 1; // skip intervalCount for now in compute_bounds()
1202 if (*runs < SkRegion::kRunTypeSentinel) { in compute_bounds()
1203 if (left > *runs) { in compute_bounds()
1204 left = *runs; in compute_bounds()
1207 const SkRegion::RunType* prev = runs; in compute_bounds()
1208 runs = skip_intervals_slow(runs); in compute_bounds()
1209 int intervals = SkToInt((runs - prev) >> 1); in compute_bounds()
1213 if (rite < runs[-1]) { in compute_bounds()
1214 rite = runs[-1]; in compute_bounds()
1217 SkASSERT(0 == runs[-1]); // no intervals in compute_bounds()
1219 SkASSERT(SkRegion::kRunTypeSentinel == *runs); in compute_bounds()
1220 runs += 1; in compute_bounds()
1221 } while (SkRegion::kRunTypeSentinel != *runs); in compute_bounds()
1266 const RunType* runs = fRunHead->readonly_runs(); in dump() local
1268 SkDebugf(" %d", runs[i]); in dump()
1318 const RunType* runs = fRuns; in next() local
1320 if (runs[0] < kRunTypeSentinel) { // valid X value in next()
1321 fRect.fLeft = runs[0]; in next()
1322 fRect.fRight = runs[1]; in next()
1323 runs += 2; in next()
1325 runs += 1; in next()
1326 if (runs[0] < kRunTypeSentinel) { // valid Y value in next()
1327 int intervals = runs[1]; in next()
1329 fRect.fTop = runs[0]; in next()
1330 runs += 3; in next()
1335 fRect.fBottom = runs[0]; in next()
1336 assert_sentinel(runs[2], false); in next()
1337 assert_sentinel(runs[3], false); in next()
1338 fRect.fLeft = runs[2]; in next()
1339 fRect.fRight = runs[3]; in next()
1340 runs += 4; in next()
1345 fRuns = runs; in next()
1408 const SkRegion::RunType* runs = rgn.fRunHead->findScanline(y); in Spanerator() local
1409 runs += 2; // skip Bottom and IntervalCount in Spanerator()
1412 if (runs[0] >= right) { in Spanerator()
1416 if (runs[1] <= left) { in Spanerator()
1417 runs += 2; in Spanerator()
1421 fRuns = runs; in Spanerator()
1447 const SkRegion::RunType* runs = fRuns; in next() local
1449 if (runs[0] >= fRight) { in next()
1454 SkASSERT(runs[1] > fLeft); in next()
1457 *left = SkMax32(fLeft, runs[0]); in next()
1460 *right = SkMin32(fRight, runs[1]); in next()
1462 fRuns = runs + 2; in next()
1470 bool SkRegion::debugSetRuns(const RunType runs[], int count) { in debugSetRuns() argument
1475 memcpy(storage.get(), runs, count * sizeof(RunType)); in debugSetRuns()