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

Side by Side Diff: content/child/image_decoder.h

Issue 17704002: Move image_decoder.cc/.h from webkit\glue to content\child. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 6 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 | « content/child/DEPS ('k') | content/child/image_decoder.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 <vector> 5 #include <vector>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "ui/gfx/size.h" 8 #include "ui/gfx/size.h"
9 #include "webkit/glue/webkit_glue_export.h"
10 9
11 class SkBitmap; 10 class SkBitmap;
12 11
13 namespace webkit_glue { 12 namespace content {
14 13
15 // Provides an interface to WebKit's image decoders. 14 // Provides an interface to WebKit's image decoders.
16 // 15 //
17 // Note to future: This class should be deleted. We should have our own nice 16 // Note to future: This class should be deleted. We should have our own nice
18 // image decoders in base/gfx, and our port should use those. Currently, it's 17 // image decoders in base/gfx, and our port should use those. Currently, it's
19 // the other way around. 18 // the other way around.
20 class WEBKIT_GLUE_EXPORT ImageDecoder { 19 class ImageDecoder {
21 public: 20 public:
22 // Use the constructor with desired_size when you think you may have an .ico 21 // Use the constructor with desired_size when you think you may have an .ico
23 // format and care about which size you get back. Otherwise, use the 0-arg 22 // format and care about which size you get back. Otherwise, use the 0-arg
24 // constructor. 23 // constructor.
25 ImageDecoder(); 24 ImageDecoder();
26 ImageDecoder(const gfx::Size& desired_icon_size); 25 ImageDecoder(const gfx::Size& desired_icon_size);
27 ~ImageDecoder(); 26 ~ImageDecoder();
28 27
29 // Call this function to decode the image. If successful, the decoded image 28 // Call this function to decode the image. If successful, the decoded image
30 // will be returned. Otherwise, an empty bitmap will be returned. 29 // will be returned. Otherwise, an empty bitmap will be returned.
31 SkBitmap Decode(const unsigned char* data, size_t size) const; 30 SkBitmap Decode(const unsigned char* data, size_t size) const;
32 31
33 // Returns all frames found in the image represented by data. If there are 32 // Returns all frames found in the image represented by data. If there are
34 // multiple frames at the same size, only the first one is returned. 33 // multiple frames at the same size, only the first one is returned.
35 static std::vector<SkBitmap> DecodeAll( 34 static std::vector<SkBitmap> DecodeAll(
36 const unsigned char* data, size_t size); 35 const unsigned char* data, size_t size);
37 36
38 private: 37 private:
39 // Size will be empty to get the largest possible size. 38 // Size will be empty to get the largest possible size.
40 gfx::Size desired_icon_size_; 39 gfx::Size desired_icon_size_;
41 40
42 DISALLOW_COPY_AND_ASSIGN(ImageDecoder); 41 DISALLOW_COPY_AND_ASSIGN(ImageDecoder);
43 }; 42 };
44 43
45 } // namespace webkit_glue 44 } // namespace content
OLDNEW
« no previous file with comments | « content/child/DEPS ('k') | content/child/image_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698