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

Unified Diff: src/codec/SkJpegCodec.cpp

Issue 1400343005: Reenable warnings in src/codec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 5 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
« no previous file with comments | « src/codec/SkCodec_wbmp.cpp ('k') | src/codec/SkSwizzler.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkJpegCodec.cpp
diff --git a/src/codec/SkJpegCodec.cpp b/src/codec/SkJpegCodec.cpp
index d0d11b1a08bd5a7ecc16bc8cbadbd78ce2d7be92..f25d7de9f07a7c2c99c68ac9e9faf425e6aaba27 100644
--- a/src/codec/SkJpegCodec.cpp
+++ b/src/codec/SkJpegCodec.cpp
@@ -151,7 +151,11 @@ SkJpegCodec::SkJpegCodec(const SkImageInfo& srcInfo, SkStream* stream,
* Return the row bytes of a particular image type and width
*/
static int get_row_bytes(const j_decompress_ptr dinfo) {
+#if defined (GOOGLE3)
scroggo 2015/10/14 20:41:33 Instead, should this be based on whether JCS_RGB56
+ int colorBytes = dinfo->out_color_components;
+#else
int colorBytes = (dinfo->out_color_space == JCS_RGB565) ? 2 : dinfo->out_color_components;
+#endif
return dinfo->output_width * colorBytes;
}
@@ -247,10 +251,14 @@ bool SkJpegCodec::setOutputColorSpace(const SkImageInfo& dst) {
} else {
// Check the byte ordering of the RGBA color space for the
scroggo 2015/10/14 20:41:33 nit: I think this comment goes inside the #else st
// current platform
-#if defined(SK_PMCOLOR_IS_RGBA)
- fDecoderMgr->dinfo()->out_color_space = JCS_EXT_RGBA;
+#if defined(GOOGLE3)
+ return false;
scroggo 2015/10/14 20:41:33 So in GOOGLE3 we can only do CMYK to N32? That see
#else
+ #if defined(SK_PMCOLOR_IS_RGBA)
+ fDecoderMgr->dinfo()->out_color_space = JCS_EXT_RGBA;
+ #else
fDecoderMgr->dinfo()->out_color_space = JCS_EXT_BGRA;
+ #endif
#endif
}
return true;
@@ -261,8 +269,12 @@ bool SkJpegCodec::setOutputColorSpace(const SkImageInfo& dst) {
// best to do this in SkSwizzler and also move convert_CMYK_to_RGBA into SkSwizzler.
return false;
} else {
+#if defined(GOOGLE3)
+ return false;
+#else
fDecoderMgr->dinfo()->dither_mode = JDITHER_NONE;
fDecoderMgr->dinfo()->out_color_space = JCS_RGB565;
+#endif
}
return true;
case kGray_8_SkColorType:
@@ -397,7 +409,11 @@ void SkJpegCodec::initializeSwizzler(const SkImageInfo& dstInfo, const Options&
break;
default:
// This function should only be called if the colorType is supported by jpeg
+#if defined(GOOGLE3)
+ SK_CRASH();
scroggo 2015/10/14 20:41:33 Why this difference?
+#else
SkASSERT(false);
+#endif
}
fSwizzler.reset(SkSwizzler::CreateSwizzler(srcConfig, nullptr, dstInfo, options));
@@ -503,5 +519,10 @@ bool SkJpegCodec::onSkipScanlines(int count) {
return fDecoderMgr->returnFalse("setjmp");
}
- return count == jpeg_skip_scanlines(fDecoderMgr->dinfo(), count);
+#ifndef TURBO_HAS_SKIP
+ jpeg_skip_scanlines(fDecoderMgr->dinfo(), count);
+ return true;
+#else
+ return (uint32_t) count == jpeg_skip_scanlines(fDecoderMgr->dinfo(), count);
+#endif
}
« no previous file with comments | « src/codec/SkCodec_wbmp.cpp ('k') | src/codec/SkSwizzler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698