SkBitmap dst;
dst.setConfig(this->config(), r.width(), r.height(), this->rowBytes());
+ dst.setIsOpaque(this->isOpaque());
if (fPixelRef) {
// share the pixelref with a custom offset
}
// test extractSubset
{
+ SkBitmap bitmap(src);
SkBitmap subset;
SkIRect r;
r.set(1, 1, 2, 2);
- if (src.extractSubset(&subset, r)) {
+ bitmap.setIsOpaque(true);
+ if (bitmap.extractSubset(&subset, r)) {
REPORTER_ASSERT(reporter, subset.width() == 1);
REPORTER_ASSERT(reporter, subset.height() == 1);
+ REPORTER_ASSERT(reporter,
+ subset.isOpaque() == bitmap.isOpaque());
SkBitmap copy;
REPORTER_ASSERT(reporter,
REPORTER_ASSERT(reporter,
(copy.getColorTable() != NULL) == hasCT);
}
+ bitmap.setIsOpaque(false);
+ if (bitmap.extractSubset(&subset, r)) {
+ REPORTER_ASSERT(reporter,
+ subset.isOpaque() == bitmap.isOpaque());
+ }
}
} else {
// dst should be unchanged from its initial state