76 if (!fCodec->getSupportedSubset(&subset)) {
80 SkISize scaledSize = fCodec->getSampledSubsetDimensions(sampleSize, subset);
83 SkAlphaType dstAlphaType = fCodec->computeOutputAlphaType(requireUnpremul);
85 SkImageInfo::Make(scaledSize, dstColorType, dstAlphaType, std::move(dstColorSpace));
90 int scaledOutWidth = scaledSize.
width();
91 int scaledOutHeight = scaledSize.
height();
93 scaledOutX = outX / sampleSize;
94 scaledOutY = outY / sampleSize;
96 const int extraX = std::max(0, desiredSubset.
width() - outX - subset.
width());
97 const int extraY = std::max(0, desiredSubset.
height() - outY - subset.
height());
98 const int scaledExtraX = extraX / sampleSize;
99 const int scaledExtraY = extraY / sampleSize;
100 scaledOutWidth += scaledOutX + scaledExtraX;
101 scaledOutHeight += scaledOutY + scaledExtraY;
112 if (!
bitmap->tryAllocPixels(allocator)) {
125 void* pixels =
bitmap->getPixels();
127 memset(pixels, 0, bytes);
134 options.fZeroInitialized = zeroInit;
135 void* dst =
bitmap->getAddr(scaledOutX, scaledOutY);
145 SkCodecPrintf(
"Error: Could not get pixels with message \"%s\".\n",