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

Unified Diff: src/core/SkBitmapDevice.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/SkBitmapDevice.cpp
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp
index eee201881a879d340c3ed594ba4b9b55340ecab7..ff68481538286fd25f92734f527a3134de03b1f4 100644
--- a/src/core/SkBitmapDevice.cpp
+++ b/src/core/SkBitmapDevice.cpp
@@ -27,9 +27,9 @@ SkBitmapDevice::SkBitmapDevice(const SkBitmap& bitmap, const SkDeviceProperties&
}
SkBitmapDevice::SkBitmapDevice(SkBitmap::Config config, int width, int height, bool isOpaque) {
- fBitmap.setConfig(config, width, height);
+ fBitmap.setConfig(config, width, height, 0, isOpaque ?
+ kOpaque_SkAlphaType : kPremul_SkAlphaType);
fBitmap.allocPixels();
- fBitmap.setIsOpaque(isOpaque);
if (!isOpaque) {
fBitmap.eraseColor(SK_ColorTRANSPARENT);
}
@@ -39,9 +39,9 @@ SkBitmapDevice::SkBitmapDevice(SkBitmap::Config config, int width, int height, b
const SkDeviceProperties& deviceProperties)
: SkBaseDevice(deviceProperties) {
- fBitmap.setConfig(config, width, height);
+ fBitmap.setConfig(config, width, height, 0, isOpaque ?
+ kOpaque_SkAlphaType : kPremul_SkAlphaType);
fBitmap.allocPixels();
- fBitmap.setIsOpaque(isOpaque);
if (!isOpaque) {
fBitmap.eraseColor(SK_ColorTRANSPARENT);
}

Powered by Google App Engine
This is Rietveld 408576698