diff options
Diffstat (limited to 'skia/ext/image_operations.cc')
-rw-r--r-- | skia/ext/image_operations.cc | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/skia/ext/image_operations.cc b/skia/ext/image_operations.cc index c61da0c..3bb765ff 100644 --- a/skia/ext/image_operations.cc +++ b/skia/ext/image_operations.cc @@ -394,7 +394,7 @@ SkBitmap ImageOperations::ResizeSubpixel(const SkBitmap& source, // Render into subpixels. SkBitmap result; result.setConfig(SkBitmap::kARGB_8888_Config, dest_subset.width(), - dest_subset.height()); + dest_subset.height(), 0, img.alphaType()); result.allocPixels(allocator, NULL); if (!result.readyToDraw()) return img; @@ -455,7 +455,6 @@ SkBitmap ImageOperations::ResizeSubpixel(const SkBitmap& source, src_row += h * row_words; dst_row += result.rowBytes() / 4; } - result.setIsOpaque(img.isOpaque()); return result; #else return SkBitmap(); @@ -510,8 +509,8 @@ SkBitmap ImageOperations::ResizeBasic(const SkBitmap& source, // Convolve into the result. SkBitmap result; - result.setConfig(SkBitmap::kARGB_8888_Config, - dest_subset.width(), dest_subset.height()); + result.setConfig(SkBitmap::kARGB_8888_Config, dest_subset.width(), + dest_subset.height(), 0, source.alphaType()); result.allocPixels(allocator, NULL); if (!result.readyToDraw()) return SkBitmap(); @@ -522,9 +521,6 @@ SkBitmap ImageOperations::ResizeBasic(const SkBitmap& source, static_cast<unsigned char*>(result.getPixels()), true); - // Preserve the "opaque" flag for use as an optimization later. - result.setIsOpaque(source.isOpaque()); - base::TimeDelta delta = base::TimeTicks::Now() - resize_start; UMA_HISTOGRAM_TIMES("Image.ResampleMS", delta); |