OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 15 matching lines...) Expand all Loading... |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "public/web/WebImageDecoder.h" | 31 #include "public/web/WebImageDecoder.h" |
32 | 32 |
33 #include "platform/SharedBuffer.h" | 33 #include "platform/SharedBuffer.h" |
34 #include "platform/image-decoders/bmp/BMPImageDecoder.h" | 34 #include "platform/image-decoders/bmp/BMPImageDecoder.h" |
35 #include "platform/image-decoders/ico/ICOImageDecoder.h" | 35 #include "platform/image-decoders/ico/ICOImageDecoder.h" |
| 36 #include "platform/wtf/PassRefPtr.h" |
36 #include "public/platform/Platform.h" | 37 #include "public/platform/Platform.h" |
37 #include "public/platform/WebData.h" | 38 #include "public/platform/WebData.h" |
38 #include "public/platform/WebImage.h" | 39 #include "public/platform/WebImage.h" |
39 #include "public/platform/WebSize.h" | 40 #include "public/platform/WebSize.h" |
40 #include "wtf/PassRefPtr.h" | |
41 | 41 |
42 namespace blink { | 42 namespace blink { |
43 | 43 |
44 void WebImageDecoder::reset() { | 44 void WebImageDecoder::reset() { |
45 delete m_private; | 45 delete m_private; |
46 } | 46 } |
47 | 47 |
48 void WebImageDecoder::init(Type type) { | 48 void WebImageDecoder::init(Type type) { |
49 size_t maxDecodedBytes = Platform::current()->maxDecodedImageBytes(); | 49 size_t maxDecodedBytes = Platform::current()->maxDecodedImageBytes(); |
50 | 50 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 WebImage WebImageDecoder::getFrameAtIndex(int index = 0) const { | 98 WebImage WebImageDecoder::getFrameAtIndex(int index = 0) const { |
99 DCHECK(m_private); | 99 DCHECK(m_private); |
100 ImageFrame* const frameBuffer = m_private->frameBufferAtIndex(index); | 100 ImageFrame* const frameBuffer = m_private->frameBufferAtIndex(index); |
101 if (!frameBuffer) | 101 if (!frameBuffer) |
102 return WebImage(); | 102 return WebImage(); |
103 return WebImage(frameBuffer->bitmap()); | 103 return WebImage(frameBuffer->bitmap()); |
104 } | 104 } |
105 | 105 |
106 } // namespace blink | 106 } // namespace blink |
OLD | NEW |