OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/gfx/codec/jpeg_codec.h" | 5 #include "ui/gfx/codec/jpeg_codec.h" |
6 | 6 |
7 #include <setjmp.h> | 7 #include <setjmp.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "third_party/skia/include/core/SkBitmap.h" | 11 #include "third_party/skia/include/core/SkBitmap.h" |
12 #include "third_party/skia/include/core/SkColorPriv.h" | 12 #include "third_party/skia/include/core/SkColorPriv.h" |
13 | 13 |
14 extern "C" { | 14 extern "C" { |
15 #if defined(USE_SYSTEM_LIBJPEG) | 15 #if defined(USE_SYSTEM_LIBJPEG) |
16 #include <jpeglib.h> | 16 #include <jpeglib.h> |
| 17 #elif defined(USE_LIBJPEG_TURBO) |
| 18 #include "third_party/libjpeg_turbo/jpeglib.h" |
17 #else | 19 #else |
18 #include "jpeglib.h" | 20 #include "third_party/libjpeg/jpeglib.h" |
19 #endif | 21 #endif |
20 } | 22 } |
21 | 23 |
22 namespace gfx { | 24 namespace gfx { |
23 | 25 |
24 // Encoder/decoder shared stuff ------------------------------------------------ | 26 // Encoder/decoder shared stuff ------------------------------------------------ |
25 | 27 |
26 namespace { | 28 namespace { |
27 | 29 |
28 // used to pass error info through the JPEG library | 30 // used to pass error info through the JPEG library |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 | 601 |
600 SkBitmap* bitmap = new SkBitmap(); | 602 SkBitmap* bitmap = new SkBitmap(); |
601 bitmap->setConfig(SkBitmap::kARGB_8888_Config, w, h); | 603 bitmap->setConfig(SkBitmap::kARGB_8888_Config, w, h); |
602 bitmap->allocPixels(); | 604 bitmap->allocPixels(); |
603 memcpy(bitmap->getAddr32(0, 0), &data_vector[0], data_length); | 605 memcpy(bitmap->getAddr32(0, 0), &data_vector[0], data_length); |
604 | 606 |
605 return bitmap; | 607 return bitmap; |
606 } | 608 } |
607 | 609 |
608 } // namespace gfx | 610 } // namespace gfx |
OLD | NEW |