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

Unified Diff: src/image/SkImagePriv.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/image/SkImagePriv.cpp
diff --git a/src/image/SkImagePriv.cpp b/src/image/SkImagePriv.cpp
index f707543c2ab5d0972957f0499395950b54450d08..eeeb9d87f77738599018d1f752299dc00ce70b18 100644
--- a/src/image/SkImagePriv.cpp
+++ b/src/image/SkImagePriv.cpp
@@ -9,45 +9,16 @@
#include "SkCanvas.h"
#include "SkPicture.h"
-SkBitmap::Config SkImageInfoToBitmapConfig(const SkImage::Info& info,
- bool* isOpaque) {
+SkBitmap::Config SkImageInfoToBitmapConfig(const SkImage::Info& info) {
switch (info.fColorType) {
case SkImage::kAlpha_8_ColorType:
- switch (info.fAlphaType) {
- case kIgnore_SkAlphaType:
- // makes no sense
- return SkBitmap::kNo_Config;
-
- case kOpaque_SkAlphaType:
- *isOpaque = true;
- return SkBitmap::kA8_Config;
-
- case kPremul_SkAlphaType:
- case kUnpremul_SkAlphaType:
- *isOpaque = false;
- return SkBitmap::kA8_Config;
- }
- break;
+ return SkBitmap::kA8_Config;
case SkImage::kRGB_565_ColorType:
- // we ignore fAlpahType, though some would not make sense
- *isOpaque = true;
return SkBitmap::kRGB_565_Config;
case SkImage::kPMColor_ColorType:
- switch (info.fAlphaType) {
- case kIgnore_SkAlphaType:
- case kUnpremul_SkAlphaType:
- // not supported yet
- return SkBitmap::kNo_Config;
- case kOpaque_SkAlphaType:
- *isOpaque = true;
- return SkBitmap::kARGB_8888_Config;
- case kPremul_SkAlphaType:
- *isOpaque = false;
- return SkBitmap::kARGB_8888_Config;
- }
- break;
+ return SkBitmap::kARGB_8888_Config;
default:
// break for unsupported colortypes

Powered by Google App Engine
This is Rietveld 408576698