OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 11 matching lines...) Expand all Loading... |
22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 */ | 25 */ |
26 | 26 |
27 #ifndef ImageFrame_h | 27 #ifndef ImageFrame_h |
28 #define ImageFrame_h | 28 #define ImageFrame_h |
29 | 29 |
30 #include "platform/PlatformExport.h" | 30 #include "platform/PlatformExport.h" |
31 #include "platform/geometry/IntRect.h" | 31 #include "platform/geometry/IntRect.h" |
32 #include "platform/graphics/skia/NativeImageSkia.h" | 32 #include "third_party/skia/include/core/SkBitmap.h" |
33 #include "wtf/Assertions.h" | 33 #include "wtf/Assertions.h" |
34 #include "wtf/PassRefPtr.h" | 34 #include "wtf/PassRefPtr.h" |
35 | 35 |
36 namespace blink { | 36 namespace blink { |
37 | 37 |
38 // ImageFrame represents the decoded image data. This buffer is what all | 38 // ImageFrame represents the decoded image data. This buffer is what all |
39 // decoders write a single frame into. | 39 // decoders write a single frame into. |
40 class PLATFORM_EXPORT ImageFrame { | 40 class PLATFORM_EXPORT ImageFrame { |
41 public: | 41 public: |
42 enum Status { FrameEmpty, FramePartial, FrameComplete }; | 42 enum Status { FrameEmpty, FramePartial, FrameComplete }; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 } | 107 } |
108 | 108 |
109 // Allocates space for the pixel data. Must be called before any pixels | 109 // Allocates space for the pixel data. Must be called before any pixels |
110 // are written. Must only be called once. Returns whether allocation | 110 // are written. Must only be called once. Returns whether allocation |
111 // succeeded. | 111 // succeeded. |
112 bool setSize(int newWidth, int newHeight); | 112 bool setSize(int newWidth, int newHeight); |
113 | 113 |
114 // Returns a caller-owned pointer to the underlying native image data. | 114 // Returns a caller-owned pointer to the underlying native image data. |
115 // (Actual use: This pointer will be owned by BitmapImage and freed in | 115 // (Actual use: This pointer will be owned by BitmapImage and freed in |
116 // FrameData::clear()). | 116 // FrameData::clear()). |
117 PassRefPtr<NativeImageSkia> asNewNativeImage() const; | 117 const SkBitmap& bitmap() const; |
118 | 118 |
119 bool hasAlpha() const; | 119 bool hasAlpha() const; |
120 const IntRect& originalFrameRect() const { return m_originalFrameRect; } | 120 const IntRect& originalFrameRect() const { return m_originalFrameRect; } |
121 Status status() const { return m_status; } | 121 Status status() const { return m_status; } |
122 unsigned duration() const { return m_duration; } | 122 unsigned duration() const { return m_duration; } |
123 DisposalMethod disposalMethod() const { return m_disposalMethod; } | 123 DisposalMethod disposalMethod() const { return m_disposalMethod; } |
124 AlphaBlendSource alphaBlendSource() const { return m_alphaBlendSource; } | 124 AlphaBlendSource alphaBlendSource() const { return m_alphaBlendSource; } |
125 bool premultiplyAlpha() const { return m_premultiplyAlpha; } | 125 bool premultiplyAlpha() const { return m_premultiplyAlpha; } |
126 SkBitmap::Allocator* allocator() const { return m_allocator; } | 126 SkBitmap::Allocator* allocator() const { return m_allocator; } |
127 const SkBitmap& getSkBitmap() const { return m_bitmap; } | 127 const SkBitmap& getSkBitmap() const { return m_bitmap; } |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 // be read for image formats that do not have multiple frames. | 232 // be read for image formats that do not have multiple frames. |
233 size_t m_requiredPreviousFrameIndex; | 233 size_t m_requiredPreviousFrameIndex; |
234 #if ENABLE(ASSERT) | 234 #if ENABLE(ASSERT) |
235 bool m_requiredPreviousFrameIndexValid; | 235 bool m_requiredPreviousFrameIndexValid; |
236 #endif | 236 #endif |
237 }; | 237 }; |
238 | 238 |
239 } // namespace blink | 239 } // namespace blink |
240 | 240 |
241 #endif | 241 #endif |
OLD | NEW |