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 #ifndef UI_GFX_IMAGE_H_ | 5 #ifndef UI_GFX_IMAGE_H_ |
6 #define UI_GFX_IMAGE_H_ | 6 #define UI_GFX_IMAGE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "ui/gfx/native_widget_types.h" // Forward-declares GdkPixbuf and NSIma ge. | 14 #include "ui/gfx/native_widget_types.h" // Forward-declares GdkPixbuf and NSIma ge. |
15 #include "third_party/skia/include/core/SkBitmap.h" | 15 |
16 class SkBitmap; | |
16 | 17 |
17 namespace { | 18 namespace { |
18 class ImageTest; | 19 class ImageTest; |
19 } | 20 } |
20 | 21 |
21 namespace gfx { | 22 namespace gfx { |
22 | 23 |
23 namespace internal { | 24 namespace internal { |
24 class ImageRep; | 25 class ImageRep; |
25 } | 26 } |
(...skipping 13 matching lines...) Expand all Loading... | |
39 kSkBitmapRep, | 40 kSkBitmapRep, |
40 }; | 41 }; |
41 | 42 |
42 // Creates a new image with the default representation. The object will take | 43 // Creates a new image with the default representation. The object will take |
43 // ownership of the image. | 44 // ownership of the image. |
44 explicit Image(const SkBitmap* bitmap); | 45 explicit Image(const SkBitmap* bitmap); |
45 #if defined(OS_LINUX) | 46 #if defined(OS_LINUX) |
46 // Does not increase |pixbuf|'s reference count. | 47 // Does not increase |pixbuf|'s reference count. |
47 explicit Image(GdkPixbuf* pixbuf); | 48 explicit Image(GdkPixbuf* pixbuf); |
48 #elif defined(OS_MACOSX) | 49 #elif defined(OS_MACOSX) |
49 // Does not retain |image|. | 50 // Does not retain |image|. |
TVL
2011/02/18 21:19:12
i'd tweak this, it's not that it does't retain, it
Robert Sesek
2011/02/18 21:48:17
Done.
| |
50 explicit Image(NSImage* image); | 51 explicit Image(NSImage* image); |
51 #endif | 52 #endif |
52 | 53 |
53 // Deletes the image and all of its cached representations. | 54 // Deletes the image and all of its cached representations. |
54 ~Image(); | 55 ~Image(); |
55 | 56 |
56 // Conversion handlers. | 57 // Conversion handlers. |
57 operator const SkBitmap*(); | 58 operator const SkBitmap*(); |
58 operator const SkBitmap&(); | 59 operator const SkBitmap&(); |
59 #if defined(OS_LINUX) | 60 #if defined(OS_LINUX) |
(...skipping 23 matching lines...) Expand all Loading... | |
83 // All the representations of an Image. Size will always be at least one, with | 84 // All the representations of an Image. Size will always be at least one, with |
84 // more for any converted representations. | 85 // more for any converted representations. |
85 RepresentationMap representations_; | 86 RepresentationMap representations_; |
86 | 87 |
87 DISALLOW_COPY_AND_ASSIGN(Image); | 88 DISALLOW_COPY_AND_ASSIGN(Image); |
88 }; | 89 }; |
89 | 90 |
90 } // namespace gfx | 91 } // namespace gfx |
91 | 92 |
92 #endif // UI_GFX_IMAGE_H_ | 93 #endif // UI_GFX_IMAGE_H_ |
OLD | NEW |