OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2008, Google Inc. All rights reserved. | 2 * Copyright (c) 2008, 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 16 matching lines...) Expand all Loading... |
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 "config.h" | 31 #include "config.h" |
32 | 32 |
33 #include "skia/ext/image_operations.h" | 33 #include "skia/ext/image_operations.h" |
34 | 34 |
35 #include "NativeImageSkia.h" | 35 #include "NativeImageSkia.h" |
36 #include "GraphicsContext3D.h" | 36 #include "GraphicsContext3D.h" |
37 #include "MemoryInstrumentationSkia.h" | |
38 #include "PlatformInstrumentation.h" | 37 #include "PlatformInstrumentation.h" |
39 #include "PlatformMemoryInstrumentation.h" | |
40 #include "SkPixelRef.h" | 38 #include "SkPixelRef.h" |
41 #include "SkiaUtils.h" | 39 #include "SkiaUtils.h" |
42 | 40 |
43 #include "DeferredImageDecoder.h" | 41 #include "DeferredImageDecoder.h" |
44 #include "TraceEvent.h" | 42 #include "TraceEvent.h" |
45 | 43 |
46 namespace WebCore { | 44 namespace WebCore { |
47 | 45 |
48 NativeImageSkia::NativeImageSkia() | 46 NativeImageSkia::NativeImageSkia() |
49 : m_resolutionScale(1) | 47 : m_resolutionScale(1) |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 | 172 |
175 SkIRect NativeImageSkia::CachedImageInfo::rectInSubset(const SkIRect& otherScale
dImageSubset) | 173 SkIRect NativeImageSkia::CachedImageInfo::rectInSubset(const SkIRect& otherScale
dImageSubset) |
176 { | 174 { |
177 if (!scaledImageSubset.contains(otherScaledImageSubset)) | 175 if (!scaledImageSubset.contains(otherScaledImageSubset)) |
178 return SkIRect::MakeEmpty(); | 176 return SkIRect::MakeEmpty(); |
179 SkIRect subsetRect = otherScaledImageSubset; | 177 SkIRect subsetRect = otherScaledImageSubset; |
180 subsetRect.offset(-scaledImageSubset.x(), -scaledImageSubset.y()); | 178 subsetRect.offset(-scaledImageSubset.x(), -scaledImageSubset.y()); |
181 return subsetRect; | 179 return subsetRect; |
182 } | 180 } |
183 | 181 |
184 void NativeImageSkia::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) cons
t | |
185 { | |
186 MemoryClassInfo info(memoryObjectInfo, this); | |
187 info.addMember(m_image, "image"); | |
188 info.addMember(m_resizedImage, "resizedImage"); | |
189 info.addMember(m_cachedImageInfo, "cachedImageInfo"); | |
190 } | |
191 | |
192 void reportMemoryUsage(const NativeImageSkia* image, MemoryObjectInfo* memoryObj
ectInfo) | |
193 { | |
194 image->reportMemoryUsage(memoryObjectInfo); | |
195 } | |
196 | |
197 } // namespace WebCore | 182 } // namespace WebCore |
OLD | NEW |