Lines Matching defs:count
46 int count() const { return fCount; }
52 /** Resize the array to a size greater-than-or-equal-to count. */
53 void resizeToAtLeast(int count) {
54 if (count > fCount) {
56 count += count >> 1;
57 fMalloc.realloc(count);
62 fCount = count;
73 * We back up 1 to read the interval-count.
91 bool SkRegion::RunsAreARect(const SkRegion::RunType runs[], int count,
94 SkASSERT(count >= kRectRegionRuns);
96 if (count == kRectRegionRuns) {
143 void SkRegion::allocateRuns(int count, int ySpanCount, int intervalCount) {
144 fRunHead = RunHead::Alloc(count, ySpanCount, intervalCount);
147 void SkRegion::allocateRuns(int count) {
148 fRunHead = RunHead::Alloc(count);
227 int count = 0;
229 count++;
233 const int max = (count*((11*4)+5))+11+1;
238 count = snprintf(result, max, "SkRegion(");
242 count += snprintf(result+count, max - count,
246 count += snprintf(result+count, max - count, ")");
267 static bool isRunCountEmpty(int count) {
268 return count <= 2;
271 bool SkRegion::setRuns(RunType runs[], int count) {
273 SkASSERT(count > 0);
275 if (isRunCountEmpty(count)) {
277 assert_sentinel(runs[count-1], true);
283 if (count > kRectRegionRuns) {
284 RunType* stop = runs + count;
309 assert_sentinel(stop[-5], false); // last interval-count
312 count = (int)(stop - runs);
315 SkASSERT(count >= kRectRegionRuns);
317 if (SkRegion::RunsAreARect(runs, count, &fBounds)) {
323 if (!this->isComplex() || fRunHead->fRunCount != count) {
325 this->allocateRuns(count);
332 memcpy(fRunHead->writable_runs(), runs, count * sizeof(RunType));
375 // We could do a bsearch, using interval-count (runs[1]), but need to time
649 bool SkRegion::setRects(const SkIRect rects[], int count) {
650 if (0 == count) {
654 for (int i = 1; i < count; i++) {
807 SkASSERT(dst < &(*array)[array->count() - 1]);
850 // Assert memcmp won't exceed fArray->count().
851 SkASSERT(fArray->count() >= SkToInt(start + len - 1));
873 SkASSERT(fArray->count() > SkToInt(fPrevDst + fPrevLen));
1005 /* Given count RunTypes in a complex region, return the worst case number of
1009 We could just return count/2, since there must be at least 2 values per
1014 static int count_to_intervals(int count) {
1015 SkASSERT(count >= 6); // a single rect is 6 values
1016 return (count - 4) >> 1;
1123 int count = operate(a_runs, b_runs, &array, op, nullptr == result);
1124 SkASSERT(count <= array.count());
1127 SkASSERT(count >= 0);
1128 return result->setRuns(&array[0], count);
1130 return (QUICK_EXIT_TRUE_COUNT == count) || !isRunCountEmpty(count);
1273 int32_t count;
1282 if (!buffer.readS32(&count) || count < -1) {
1285 if (count >= 0) {
1289 if (count == 0) {
1295 buffer.available() < count * sizeof(int32_t)) {
1298 if (!validate_run((const int32_t*)((const char*)storage + buffer.pos()), count,
1302 tmp.allocateRuns(count, ySpanCount, intervalCount);
1304 SkAssertResult(buffer.read(tmp.fRunHead->writable_runs(), count * sizeof(int32_t)));