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

Unified Diff: src/codec/SkJpegCodec.cpp

Issue 2184543003: Perform color correction on png decodes (Closed) Base URL: https://skia.googlesource.com/skia.git@colorjpegs
Patch Set: Created 4 years, 5 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/codec/SkJpegCodec.cpp
diff --git a/src/codec/SkJpegCodec.cpp b/src/codec/SkJpegCodec.cpp
index 7c0fcebdead5a4c56307281111af3ad35d578a9d..567bee423b05267fba14d05bf4dcdd24c7e4e491 100644
--- a/src/codec/SkJpegCodec.cpp
+++ b/src/codec/SkJpegCodec.cpp
@@ -469,13 +469,6 @@ bool SkJpegCodec::onDimensionsSupported(const SkISize& size) {
return true;
}
-static bool needs_color_xform(const SkImageInfo& dstInfo, const SkImageInfo& srcInfo) {
- // FIXME (msarett):
- // Do a better check for color space equality.
- return (kRGBA_F16_SkColorType == dstInfo.colorType()) ||
- (dstInfo.colorSpace() && (dstInfo.colorSpace() != srcInfo.colorSpace()));
-}
-
int SkJpegCodec::readRows(const SkImageInfo& dstInfo, void* dst, size_t rowBytes, int count) {
// Set the jump location for libjpeg-turbo errors
if (setjmp(fDecoderMgr->getJmpBuf())) {
@@ -520,22 +513,7 @@ int SkJpegCodec::readRows(const SkImageInfo& dstInfo, void* dst, size_t rowBytes
}
if (fColorXform) {
- int width = dstInfo.width();
- switch (dstInfo.colorType()) {
- case kRGBA_8888_SkColorType:
- fColorXform->applyToRGBA((uint32_t*) dst, swizzleDst, width);
- break;
- case kBGRA_8888_SkColorType:
- fColorXform->applyToBGRA((uint32_t*) dst, swizzleDst, width);
- break;
- case kRGBA_F16_SkColorType:
- fColorXform->applyToF16((uint64_t*) dst, swizzleDst, width);
- break;
- default:
- SkASSERT(false);
- break;
- }
-
+ fColorXform->apply(dst, swizzleDst, dstInfo.width(), dstInfo.colorType(), false);
dst = SkTAddOffset<void>(dst, rowBytes);
}
« no previous file with comments | « src/codec/SkCodecPriv.h ('k') | src/codec/SkPngCodec.h » ('j') | src/opts/SkOpts_sse41.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698