OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 #ifndef WebImage_h | 31 #ifndef WebImage_h |
32 #define WebImage_h | 32 #define WebImage_h |
33 | 33 |
34 #include "WebCommon.h" | 34 #include "WebCommon.h" |
35 #include "WebVector.h" | 35 #include "WebVector.h" |
36 | 36 |
37 #include "third_party/skia/include/core/SkBitmap.h" | 37 #include "third_party/skia/include/core/SkBitmap.h" |
38 | 38 |
39 #if INSIDE_BLINK | 39 #if INSIDE_BLINK |
40 namespace WebCore { class Image; } | 40 namespace blink { class Image; } |
41 namespace WTF { template <typename T> class PassRefPtr; } | 41 namespace WTF { template <typename T> class PassRefPtr; } |
42 #endif | 42 #endif |
43 | 43 |
44 namespace blink { | 44 namespace blink { |
45 | 45 |
46 class WebData; | 46 class WebData; |
47 struct WebSize; | 47 struct WebSize; |
48 | 48 |
49 // A container for an ARGB bitmap. | 49 // A container for an ARGB bitmap. |
50 class WebImage { | 50 class WebImage { |
(...skipping 22 matching lines...) Expand all Loading... |
73 // size will be returned. | 73 // size will be returned. |
74 BLINK_PLATFORM_EXPORT static WebVector<WebImage> framesFromData(const WebDat
a&); | 74 BLINK_PLATFORM_EXPORT static WebVector<WebImage> framesFromData(const WebDat
a&); |
75 | 75 |
76 BLINK_PLATFORM_EXPORT void reset(); | 76 BLINK_PLATFORM_EXPORT void reset(); |
77 BLINK_PLATFORM_EXPORT void assign(const WebImage&); | 77 BLINK_PLATFORM_EXPORT void assign(const WebImage&); |
78 | 78 |
79 BLINK_PLATFORM_EXPORT bool isNull() const; | 79 BLINK_PLATFORM_EXPORT bool isNull() const; |
80 BLINK_PLATFORM_EXPORT WebSize size() const; | 80 BLINK_PLATFORM_EXPORT WebSize size() const; |
81 | 81 |
82 #if INSIDE_BLINK | 82 #if INSIDE_BLINK |
83 BLINK_PLATFORM_EXPORT WebImage(const WTF::PassRefPtr<WebCore::Image>&); | 83 BLINK_PLATFORM_EXPORT WebImage(const WTF::PassRefPtr<blink::Image>&); |
84 BLINK_PLATFORM_EXPORT WebImage& operator=(const WTF::PassRefPtr<WebCore::Ima
ge>&); | 84 BLINK_PLATFORM_EXPORT WebImage& operator=(const WTF::PassRefPtr<blink::Image
>&); |
85 #endif | 85 #endif |
86 | 86 |
87 WebImage(const SkBitmap& bitmap) : m_bitmap(bitmap) { } | 87 WebImage(const SkBitmap& bitmap) : m_bitmap(bitmap) { } |
88 | 88 |
89 WebImage& operator=(const SkBitmap& bitmap) | 89 WebImage& operator=(const SkBitmap& bitmap) |
90 { | 90 { |
91 m_bitmap = bitmap; | 91 m_bitmap = bitmap; |
92 return *this; | 92 return *this; |
93 } | 93 } |
94 | 94 |
95 SkBitmap& getSkBitmap() { return m_bitmap; } | 95 SkBitmap& getSkBitmap() { return m_bitmap; } |
96 const SkBitmap& getSkBitmap() const { return m_bitmap; } | 96 const SkBitmap& getSkBitmap() const { return m_bitmap; } |
97 | 97 |
98 private: | 98 private: |
99 void init() { } | 99 void init() { } |
100 SkBitmap m_bitmap; | 100 SkBitmap m_bitmap; |
101 | 101 |
102 }; | 102 }; |
103 | 103 |
104 } // namespace blink | 104 } // namespace blink |
105 | 105 |
106 #endif | 106 #endif |
OLD | NEW |