Lines Matching full:srcrect
21 void extractImageData(const SkBitmap& bitmap, const SkIRect& srcRect,
31 const int rowBytes = srcRect.width();
32 image = new SkMemoryStream(rowBytes * srcRect.height());
34 for (int y = srcRect.fTop; y < srcRect.fBottom; y++) {
35 memcpy(dst, bitmap.getAddr8(srcRect.fLeft, y), rowBytes);
42 const int rowBytes = (srcRect.width() * 3 + 1) / 2;
43 const int alphaRowBytes = (srcRect.width() + 1) / 2;
44 image = new SkMemoryStream(rowBytes * srcRect.height());
45 alpha = new SkMemoryStream(alphaRowBytes * srcRect.height());
48 for (int y = srcRect.fTop; y < srcRect.fBottom; y++) {
51 for (x = srcRect.fLeft; x + 1 < srcRect.fRight; x += 2) {
69 if (srcRect.width() & 1) {
87 const int rowBytes = srcRect.width() * 3;
88 image = new SkMemoryStream(rowBytes * srcRect.height());
90 for (int y = srcRect.fTop; y < srcRect.fBottom; y++) {
92 for (int x = srcRect.fLeft; x < srcRect.fRight; x++) {
103 const int rowBytes = srcRect.width() * 3;
104 image = new SkMemoryStream(rowBytes * srcRect.height());
105 alpha = new SkMemoryStream(srcRect.width() * srcRect.height());
108 for (int y = srcRect.fTop; y < srcRect.fBottom; y++) {
110 for (int x = srcRect.fLeft; x < srcRect.fRight; x++) {
132 const int alphaRowBytes = (srcRect.width() + 7) / 8;
133 alpha = new SkMemoryStream(alphaRowBytes * srcRect.height());
135 int offset1 = srcRect.fLeft % 8;
137 for (int y = srcRect.fTop; y < srcRect.fBottom; y++) {
141 for (int x = srcRect.fLeft; x < srcRect.fRight; x += 8) {
148 if (x + 7 < srcRect.fRight && alphaDst[0] != 0xFF) {
151 if (x + 7 < srcRect.fRight && alphaDst[0]) {
159 uint8_t mask = ~((1 << (8 - (srcRect.width() % 8))) - 1);
160 if (srcRect.width() % 8 && (alphaDst[-1] & mask) != mask) {
163 if (srcRect.width() % 8 && (alphaDst[-1] & mask)) {
174 const int alphaRowBytes = srcRect.width();
175 alpha = new SkMemoryStream(alphaRowBytes * srcRect.height());
177 for (int y = srcRect.fTop; y < srcRect.fBottom; y++) {
179 for (int x = srcRect.fLeft; x < srcRect.fRight; x++) {
236 const SkIRect& srcRect,
244 extractImageData(bitmap, srcRect, &imageData, &alphaData);
253 SkNEW_ARGS(SkPDFImage, (imageData, bitmap, srcRect, false, encoder));
258 image->addSMask(SkNEW_ARGS(SkPDFImage, (alphaData, bitmap, srcRect, true, NULL)))->unref();
281 const SkIRect& srcRect,
284 : SkPDFImageStream(imageData, bitmap, srcRect, encoder) {
299 insertInt("Width", srcRect.width());
300 insertInt("Height", srcRect.height());