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

Unified Diff: src/codec/SkJpegCodec.cpp

Issue 1401883005: Add dm target to BUILD and refactor BUILD file. Fix blaze compilation errors. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Rebase and fix new issues in SkJpegCodec.cpp. 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 | « BUILD.public ('k') | tools/BUILD.public.expected » ('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 36a723f2d642cc9113abea2e39a71b2152488878..cca71c1cadec45665bdc96d8af38cc71d57aee67 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/27 13:51:23 Is this because GOOGLE3 is expected to build again
mtklein 2015/10/27 14:27:59 Why don't we just use libjpeg's own defines as the
msarett 2015/10/27 14:31:36 sgtm They are actually enums. Will that still wo
dogben 2015/10/27 15:07:22 Sorry, I should have left a comment or TODO. I for
+ 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
// current platform
-#if defined(SK_PMCOLOR_IS_RGBA)
- fDecoderMgr->dinfo()->out_color_space = JCS_EXT_RGBA;
+#if defined(GOOGLE3)
+ return false;
scroggo 2015/10/27 13:51:23 It appears that in GOOGLE3, SkJpegCodec will not w
dogben 2015/10/27 15:07:22 I didn't realize that not supporting JCS_EXT_* wou
#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/27 13:51:23 Why this difference? I assume that SkASSERT works
dogben 2015/10/27 15:07:22 Sorry, I added this before https://codereview.chro
+#else
SkASSERT(false);
+#endif
}
fSwizzler.reset(SkSwizzler::CreateSwizzler(srcConfig, nullptr, dstInfo, options));
@@ -488,7 +504,7 @@ int SkJpegCodec::onGetScanlines(void* dst, int count, size_t rowBytes) {
#ifndef TURBO_HAS_SKIP
// TODO (msarett): Avoid reallocating the memory buffer on each call to skip.
-static uint32_t jpeg_skip_scanlines(dinfo, count) {
+static uint32_t jpeg_skip_scanlines(jpeg_decompress_struct* dinfo, int count) {
msarett 2015/10/15 15:02:33 +1
SkAutoMalloc storage(get_row_bytes(dinfo));
uint8_t* storagePtr = static_cast<uint8_t*>(storage.get());
for (int y = 0; y < count; y++) {
« no previous file with comments | « BUILD.public ('k') | tools/BUILD.public.expected » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698