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

Side by Side Diff: ui/gfx/image/image_png.h

Issue 10799014: Add support for PNG representation in gfx::Image (Closed) Base URL: http://git.chromium.org/chromium/src.git@bookmark-sync
Patch Set: Created 8 years, 5 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
« no previous file with comments | « ui/gfx/image/image.cc ('k') | ui/gfx/image/image_png.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_GFX_IMAGE_IMAGE_PNG_H_
6 #define UI_GFX_IMAGE_IMAGE_PNG_H_
7
8 #include <vector>
9
10 #include "base/basictypes.h"
11 #include "base/memory/ref_counted_memory.h"
12 #include "ui/base/ui_export.h"
13
14 namespace gfx {
15
16 // ImagePNG is a simple container for png-encoded data. It is cheap to copy
17 // and intentionally supports copy semantics.
18 class UI_EXPORT ImagePNG {
Robert Sesek 2012/07/19 23:45:07 Why do we need ImagePNG? I think everything can be
cjhopman 2012/07/20 17:28:24 Done. Yeah, that works for me, we don't need Image
19 public:
20 // Creates an ImagePNG from a copy of the png-encoded input.
21 explicit ImagePNG(const std::vector<unsigned char>& input);
22 ImagePNG(const unsigned char* input, size_t input_size);
23
24 // Copies a reference to |other|'s storage.
25 ImagePNG(const ImagePNG& other);
26
27 // Copies a reference to |other|'s storage.
28 ImagePNG& operator=(const ImagePNG& other);
29
30 ~ImagePNG();
31
32 static ImagePNG FromSkBitmap(const SkBitmap* bitmap);
33
34 bool empty() const;
35
36 const std::vector<unsigned char>& Image() const;
37 private:
38 // Default constructor only used by FromSkBitmap
39 ImagePNG();
40
41 // A refptr so that ImagePNG can be copied cheaply.
42 scoped_refptr<base::RefCountedBytes> image_;
43 };
44
45 } // namespace gfx
46
47 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_
OLDNEW
« no previous file with comments | « ui/gfx/image/image.cc ('k') | ui/gfx/image/image_png.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698