summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorsaintlou@chromium.org <saintlou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-31 00:35:31 +0000
committersaintlou@chromium.org <saintlou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-31 00:35:31 +0000
commit8c98ad1cd5bf430ed2beb606316ee236d45dc389 (patch)
treee63fd185b72916386a1312c42743c70228adc789 /ui
parentc5667b283234e05eb9c561fbb993a38e771a1b50 (diff)
downloadchromium_src-8c98ad1cd5bf430ed2beb606316ee236d45dc389.zip
chromium_src-8c98ad1cd5bf430ed2beb606316ee236d45dc389.tar.gz
chromium_src-8c98ad1cd5bf430ed2beb606316ee236d45dc389.tar.bz2
+ Ensure that OnRobustJPEGDecodeImage only uses the codec of our choosing (IJGlibjpeg at the moment).
+ Solve CrOS boot time hang when image decoding fail in utility process. + Enforce Robust JPEG decoding of Wallpaper image, -> and as a result re-enable custom wallpapers rendering on the login page. BUG=143198,144296,144999 Review URL: https://chromiumcodereview.appspot.com/10912019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154330 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/gfx/codec/jpeg_codec.cc11
-rw-r--r--ui/gfx/codec/jpeg_codec.h9
2 files changed, 20 insertions, 0 deletions
diff --git a/ui/gfx/codec/jpeg_codec.cc b/ui/gfx/codec/jpeg_codec.cc
index 6836143..bfa47b9 100644
--- a/ui/gfx/codec/jpeg_codec.cc
+++ b/ui/gfx/codec/jpeg_codec.cc
@@ -42,6 +42,17 @@ void ErrorExit(jpeg_common_struct* cinfo) {
} // namespace
+// This method helps identify at run time which library chromium is using.
+JPEGCodec::LibraryVariant JPEGCodec::JpegLibraryVariant() {
+#if defined(USE_SYSTEM_LIBJPEG)
+ return SYSTEM_LIBJPEG;
+#elif defined(USE_LIBJPEG_TURBO)
+ return LIBJPEG_TURBO;
+#else
+ return IJG_LIBJPEG;
+#endif
+}
+
// Encoder ---------------------------------------------------------------------
//
// This code is based on nsJPEGEncoder from Mozilla.
diff --git a/ui/gfx/codec/jpeg_codec.h b/ui/gfx/codec/jpeg_codec.h
index 2c886eb..e4edeee 100644
--- a/ui/gfx/codec/jpeg_codec.h
+++ b/ui/gfx/codec/jpeg_codec.h
@@ -37,6 +37,15 @@ class UI_EXPORT JPEGCodec {
FORMAT_SkBitmap
};
+ enum LibraryVariant {
+ SYSTEM_LIBJPEG = 0,
+ LIBJPEG_TURBO,
+ IJG_LIBJPEG,
+ };
+
+ // This method helps identify at run time which library chromium is using.
+ static LibraryVariant JpegLibraryVariant();
+
// Encodes the given raw 'input' data, with each pixel being represented as
// given in 'format'. The encoded JPEG data will be written into the supplied
// vector and true will be returned on success. On failure (false), the