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

Side by Side Diff: ui/gfx/codec/jpeg_codec.h

Issue 10912019: Enable robust decoding of custom wallpaper and allow custom wallpaper on login page (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Check conflict. Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/utility/chrome_content_utility_client.cc ('k') | ui/gfx/codec/jpeg_codec.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef UI_GFX_CODEC_JPEG_CODEC_H_ 5 #ifndef UI_GFX_CODEC_JPEG_CODEC_H_
6 #define UI_GFX_CODEC_JPEG_CODEC_H_ 6 #define UI_GFX_CODEC_JPEG_CODEC_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 19 matching lines...) Expand all
30 30
31 // 4 bytes per pixel, in BGRA order in mem regardless of endianness. 31 // 4 bytes per pixel, in BGRA order in mem regardless of endianness.
32 // This is the default Windows DIB order. 32 // This is the default Windows DIB order.
33 FORMAT_BGRA, 33 FORMAT_BGRA,
34 34
35 // 4 bytes per pixel, it can be either RGBA or BGRA. It depends on the bit 35 // 4 bytes per pixel, it can be either RGBA or BGRA. It depends on the bit
36 // order in kARGB_8888_Config skia bitmap. 36 // order in kARGB_8888_Config skia bitmap.
37 FORMAT_SkBitmap 37 FORMAT_SkBitmap
38 }; 38 };
39 39
40 enum LibraryVariant {
41 SYSTEM_LIBJPEG = 0,
42 LIBJPEG_TURBO,
43 IJG_LIBJPEG,
44 };
45
46 // This method helps identify at run time which library chromium is using.
47 static LibraryVariant JpegLibraryVariant();
48
40 // Encodes the given raw 'input' data, with each pixel being represented as 49 // Encodes the given raw 'input' data, with each pixel being represented as
41 // given in 'format'. The encoded JPEG data will be written into the supplied 50 // given in 'format'. The encoded JPEG data will be written into the supplied
42 // vector and true will be returned on success. On failure (false), the 51 // vector and true will be returned on success. On failure (false), the
43 // contents of the output buffer are undefined. 52 // contents of the output buffer are undefined.
44 // 53 //
45 // w, h: dimensions of the image 54 // w, h: dimensions of the image
46 // row_byte_width: the width in bytes of each row. This may be greater than 55 // row_byte_width: the width in bytes of each row. This may be greater than
47 // w * bytes_per_pixel if there is extra padding at the end of each row 56 // w * bytes_per_pixel if there is extra padding at the end of each row
48 // (often, each row is padded to the next machine word). 57 // (often, each row is padded to the next machine word).
49 // quality: an integer in the range 0-100, where 100 is the highest quality. 58 // quality: an integer in the range 0-100, where 100 is the highest quality.
(...skipping 11 matching lines...) Expand all
61 70
62 // Decodes the JPEG data contained in input of length input_size. If 71 // Decodes the JPEG data contained in input of length input_size. If
63 // successful, a SkBitmap is created and returned. It is up to the caller 72 // successful, a SkBitmap is created and returned. It is up to the caller
64 // to delete the returned bitmap. 73 // to delete the returned bitmap.
65 static SkBitmap* Decode(const unsigned char* input, size_t input_size); 74 static SkBitmap* Decode(const unsigned char* input, size_t input_size);
66 }; 75 };
67 76
68 } // namespace gfx 77 } // namespace gfx
69 78
70 #endif // UI_GFX_CODEC_JPEG_CODEC_H_ 79 #endif // UI_GFX_CODEC_JPEG_CODEC_H_
OLDNEW
« no previous file with comments | « chrome/utility/chrome_content_utility_client.cc ('k') | ui/gfx/codec/jpeg_codec.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698