Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Unified Diff: src/core/SkBitmapScaler.cpp

Issue 25275004: store SkAlphaType inside SkBitmap, on road to support unpremul (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/core/SkBitmapScaler.cpp
diff --git a/src/core/SkBitmapScaler.cpp b/src/core/SkBitmapScaler.cpp
index 114836dd7967c72419c4ad92253648467cdf3413..c28d4779c7ae60b3bc3c375b16605be8efdd2049 100644
--- a/src/core/SkBitmapScaler.cpp
+++ b/src/core/SkBitmapScaler.cpp
@@ -287,7 +287,8 @@ bool SkBitmapScaler::Resize(SkBitmap* resultPtr,
// Convolve into the result.
SkBitmap result;
result.setConfig(SkBitmap::kARGB_8888_Config,
- destSubset.width(), destSubset.height());
+ destSubset.width(), destSubset.height(), 0,
+ source.alphaType());
result.allocPixels(allocator, NULL);
if (!result.readyToDraw()) {
return false;
@@ -299,8 +300,6 @@ bool SkBitmapScaler::Resize(SkBitmap* resultPtr,
static_cast<unsigned char*>(result.getPixels()),
convolveProcs, true);
- // Preserve the "opaque" flag for use as an optimization later.
- result.setIsOpaque(source.isOpaque());
*resultPtr = result;
return true;
}

Powered by Google App Engine
This is Rietveld 408576698