Lines Matching defs:width
45 // assert we're exactly width-wide, and then return the number of bytes used
46 static size_t compute_row_length(const uint8_t row[], int width) {
48 while (width > 0) {
51 SkASSERT(n <= width);
53 width -= n;
55 SkASSERT(0 == width);
192 static int ComputeRowSizeForWidth(int width) {
195 while (width > 0) {
197 int n = std::min(width, 255);
198 width -= n;
205 int width = bounds.width();
206 size_t rowSize = ComputeRowSizeForWidth(width);
212 while (width > 0) {
213 int n = std::min(width, 255);
216 width -= n;
254 fWidth = bounds.width();
297 SkASSERT(row->fWidth < fBounds.width());
305 SkASSERT(row->fWidth < fBounds.width());
310 SkASSERT(row->fWidth <= fBounds.width());
323 void addRectRun(int x, int y, int width, int height) {
324 SkASSERT(fBounds.contains(x + width - 1, y + height - 1));
325 this->addRun(x, y, 0xFF, width);
336 void addAntiRectRun(int x, int y, int width, int height,
339 // we should always consider [x, x+1] as the left-most column and [x+1, x+1+width]
341 SkASSERT(fBounds.contains(x + width + (rightAlpha > 0 ? 1 : 0),
343 SkASSERT(width >= 0);
348 width++;
356 width++;
358 if (width > 0) {
359 this->addRun(x, y, 0xFF, width);
362 this->addRun(x + width, y, rightAlpha, 1);
415 SkASSERT(compute_row_length(data, fBounds.width()) == n);
662 this->addRun(fBounds.fLeft, bot - 1, 0, fBounds.width());
713 must support it (given AntiRect semantics: minimum width is 2).
731 void blitRect(int x, int y, int width, int height) override {
734 fBuilder->addRectRun(x, y, width, height);
738 void blitAntiRect(int x, int y, int width, int height,
742 fBuilder->addAntiRectRun(x, y, width, height, leftAlpha, rightAlpha);
753 void blitH(int x, int y, int width) override {
756 fBuilder->addRun(x, y, 0xFF, width);
768 // The supersampler's buffer can be the width of the device, so
846 auto expandRowToMask = [](uint8_t* dst, const uint8_t* row, int width) {
847 while (width > 0) {
849 SkASSERT(width >= n);
853 width -= n;
855 SkASSERT(0 == width);
867 mask->fRowBytes = fBounds.width();
873 const int width = fBounds.width();
878 expandRowToMask(dst, iter.data(), width);
912 size_t rowLength = compute_row_length(row, fBounds.width());
922 int width, int leading_num) {
926 while (width > 0) {
939 width -= n;
946 const int width = fBounds.width();
951 dump_one_row(iter.data(), width, iter.bottom() - iter.top() + 1);
954 dump_one_row(iter.data(), width, 0);
965 // RLE row. If 'row' is all zeros return 'width' in both variables.
966 static void count_left_right_zeros(const uint8_t* row, int width,
975 SkASSERT(n <= width);
978 width -= n;
979 } while (width > 0);
982 if (0 == width) {
983 // this line is completely empty return 'width' in both variables
989 while (width > 0) {
998 width -= n;
1005 static int trim_row_left_right(uint8_t* row, int width, int leftZ, int riteZ) {
1011 SkASSERT(n <= width);
1012 width -= n;
1025 while (width > 0) {
1027 SkASSERT(n <= width);
1028 width -= n;
1056 const int width = fBounds.width();
1065 int leftZeros = width;
1066 int riteZeros = width;
1069 count_left_right_zeros(base + yoff->fOffset, width, &L, &R);
1070 SkASSERT(L + R < width || (L == width && R == width));
1085 if (width == leftZeros) {
1086 SkASSERT(width == riteZeros);
1102 SkDEBUGCODE((void)compute_row_length(row, width);)
1103 yoff->fOffset += trim_row_left_right(row, width, leftZeros, riteZeros);
1104 SkDEBUGCODE((void)compute_row_length(base + yoff->fOffset, width - leftZeros - riteZeros);)
1110 static bool row_is_all_zeros(const uint8_t* row, int width) {
1111 SkASSERT(width > 0);
1117 SkASSERT(n <= width);
1118 width -= n;
1120 } while (width > 0);
1121 SkASSERT(0 == width);
1132 const int width = fBounds.width();
1143 if (!row_is_all_zeros(data, width)) {
1183 } while (row_is_all_zeros(base + yoff->fOffset, width));
1294 int width = fBounds.width();
1300 SkASSERT(n <= width);
1301 width -= n;
1303 } while (width > 0);
1324 xArray.setReserve(std::min(bounds.width(), 512) * 128);
1354 appendXRun(0, bounds.width() - prevRight);
1362 appendXRun(0, bounds.width());
1378 SkASSERT(prevRight <= bounds.width());
1381 appendXRun(0, bounds.width() - prevRight);
1616 static void expandToRuns(const uint8_t* SK_RESTRICT data, int initialCount, int width,
1622 if (n > width) {
1623 n = width;
1633 width -= n;
1634 if (0 == width) {
1650 int count = fAAClipBounds.width() + 1;
1659 void SkAAClipBlitter::blitH(int x, int y, int width) {
1660 SkASSERT(width > 0);
1662 SkASSERT(fAAClipBounds.contains(x + width - 1, y));
1668 if (initialCount >= width) {
1674 fBlitter->blitH(x, y, width);
1680 expandToRuns(row, initialCount, width, fRuns, fAA);
1690 int width) {
1724 SkASSERT(accumulated <= width);
1738 merge(row, initialCount, aa, runs, fAA, fRuns, fAAClipBounds.width());
1770 void SkAAClipBlitter::blitRect(int x, int y, int width, int height) {
1771 if (fAAClip->quickContains(x, y, x + width, y + height)) {
1772 fBlitter->blitRect(x, y, width, height);
1777 this->blitH(x, y, width);
1782 typedef void (*MergeAAProc)(const void* src, int width, const uint8_t* row,
1866 const int width = srcMask.fBounds.width();
1874 const int wholeBytes = width >> 3;
1875 const int leftOverBits = width & 7;
1918 grayMask.fRowBytes = origMask.fBounds.width();
1934 const int width = clip.width();
1956 mergeProc(src, width, row, initialCount, rowMask.fImage);