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) 2007 Alp Toker <alp.toker@collabora.co.uk> | 3 * Copyright (C) 2007 Alp Toker <alp.toker@collabora.co.uk> |
4 * Copyright (C) 2008, Google Inc. All rights reserved. | 4 * Copyright (C) 2008, Google Inc. All rights reserved. |
5 * Copyright (C) 2007-2009 Torch Mobile, Inc | 5 * Copyright (C) 2007-2009 Torch Mobile, Inc |
6 * | 6 * |
7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
9 * are met: | 9 * are met: |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 15 matching lines...) Expand all Loading... |
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 */ | 27 */ |
28 | 28 |
29 #include "config.h" | 29 #include "config.h" |
30 #include "ImageSource.h" | 30 #include "ImageSource.h" |
31 | 31 |
32 #include "ImageDecoder.h" | 32 #include "ImageDecoder.h" |
33 | 33 |
34 #include "ImageOrientation.h" | 34 #include "ImageOrientation.h" |
35 #include "NotImplemented.h" | 35 #include "NotImplemented.h" |
36 #include "PlatformMemoryInstrumentation.h" | |
37 | 36 |
38 #include "DeferredImageDecoder.h" | 37 #include "DeferredImageDecoder.h" |
39 | 38 |
40 namespace WebCore { | 39 namespace WebCore { |
41 | 40 |
42 #if ENABLE(IMAGE_DECODER_DOWN_SAMPLING) | 41 #if ENABLE(IMAGE_DECODER_DOWN_SAMPLING) |
43 unsigned ImageSource::s_maxPixelsPerDecodedImage = 1024 * 1024; | 42 unsigned ImageSource::s_maxPixelsPerDecodedImage = 1024 * 1024; |
44 #endif | 43 #endif |
45 | 44 |
46 ImageSource::ImageSource(ImageSource::AlphaOption alphaOption, ImageSource::Gamm
aAndColorProfileOption gammaAndColorProfileOption) | 45 ImageSource::ImageSource(ImageSource::AlphaOption alphaOption, ImageSource::Gamm
aAndColorProfileOption gammaAndColorProfileOption) |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 return buffer && buffer->status() == ImageFrame::FrameComplete; | 195 return buffer && buffer->status() == ImageFrame::FrameComplete; |
197 } | 196 } |
198 | 197 |
199 unsigned ImageSource::frameBytesAtIndex(size_t index) const | 198 unsigned ImageSource::frameBytesAtIndex(size_t index) const |
200 { | 199 { |
201 if (!m_decoder) | 200 if (!m_decoder) |
202 return 0; | 201 return 0; |
203 return m_decoder->frameBytesAtIndex(index); | 202 return m_decoder->frameBytesAtIndex(index); |
204 } | 203 } |
205 | 204 |
206 void ImageSource::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const | |
207 { | |
208 MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Image); | |
209 info.addMember(m_decoder, "decoder"); | |
210 } | 205 } |
211 | |
212 } | |
OLD | NEW |