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

Unified Diff: src/codec/SkCodec_libpng.cpp

Issue 1012873002: Revert "Implementation of image decoding for bmp files, in accordance with the new API." (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « src/codec/SkCodec_libbmp.cpp ('k') | src/codec/SkMaskSwizzler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkCodec_libpng.cpp
diff --git a/src/codec/SkCodec_libpng.cpp b/src/codec/SkCodec_libpng.cpp
index f42af38fea707787f0fc760dba74d5486acf0572..8e7ee33a9554bce341cf8681b2db86d334bfae1b 100644
--- a/src/codec/SkCodec_libpng.cpp
+++ b/src/codec/SkCodec_libpng.cpp
@@ -6,7 +6,6 @@
*/
#include "SkCodec_libpng.h"
-#include "SkCodecPriv.h"
#include "SkColorPriv.h"
#include "SkColorTable.h"
#include "SkBitmap.h"
@@ -347,6 +346,10 @@ SkPngCodec::~SkPngCodec() {
// Getting the pixels
///////////////////////////////////////////////////////////////////////////////
+static bool premul_and_unpremul(SkAlphaType A, SkAlphaType B) {
+ return kPremul_SkAlphaType == A && kUnpremul_SkAlphaType == B;
+}
+
static bool conversion_possible(const SkImageInfo& A, const SkImageInfo& B) {
// TODO: Support other conversions
if (A.colorType() != B.colorType()) {
@@ -463,7 +466,7 @@ SkCodec::Result SkPngCodec::onGetPixels(const SkImageInfo& requestedInfo, void*
// Now swizzle it.
uint8_t* row = base;
for (int y = 0; y < height; y++) {
- reallyHasAlpha |= !SkSwizzler::IsOpaque(swizzler->next(row));
+ reallyHasAlpha |= swizzler->next(row);
row += rowBytes;
}
} else {
@@ -471,7 +474,7 @@ SkCodec::Result SkPngCodec::onGetPixels(const SkImageInfo& requestedInfo, void*
uint8_t* srcRow = static_cast<uint8_t*>(storage.get());
for (int y = 0; y < requestedInfo.height(); y++) {
png_read_rows(fPng_ptr, &srcRow, png_bytepp_NULL, 1);
- reallyHasAlpha |= !SkSwizzler::IsOpaque(swizzler->next(srcRow));
+ reallyHasAlpha |= swizzler->next(srcRow);
}
}
« no previous file with comments | « src/codec/SkCodec_libbmp.cpp ('k') | src/codec/SkMaskSwizzler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698