OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 11 matching lines...) Expand all Loading... |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #include "config.h" | 26 #include "config.h" |
27 #include "CrossfadeGeneratedImage.h" | 27 #include "CrossfadeGeneratedImage.h" |
28 | 28 |
29 #include "FloatRect.h" | 29 #include "FloatRect.h" |
30 #include "GraphicsContext.h" | 30 #include "GraphicsContext.h" |
31 #include "ImageBuffer.h" | 31 #include "ImageBuffer.h" |
32 #include "PlatformMemoryInstrumentation.h" | |
33 | 32 |
34 using namespace std; | 33 using namespace std; |
35 | 34 |
36 namespace WebCore { | 35 namespace WebCore { |
37 | 36 |
38 CrossfadeGeneratedImage::CrossfadeGeneratedImage(Image* fromImage, Image* toImag
e, float percentage, IntSize crossfadeSize, const IntSize& size) | 37 CrossfadeGeneratedImage::CrossfadeGeneratedImage(Image* fromImage, Image* toImag
e, float percentage, IntSize crossfadeSize, const IntSize& size) |
39 : m_fromImage(fromImage) | 38 : m_fromImage(fromImage) |
40 , m_toImage(toImage) | 39 , m_toImage(toImage) |
41 , m_percentage(percentage) | 40 , m_percentage(percentage) |
42 , m_crossfadeSize(crossfadeSize) | 41 , m_crossfadeSize(crossfadeSize) |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 return; | 100 return; |
102 | 101 |
103 // Fill with the cross-faded image. | 102 // Fill with the cross-faded image. |
104 GraphicsContext* graphicsContext = imageBuffer->context(); | 103 GraphicsContext* graphicsContext = imageBuffer->context(); |
105 drawCrossfade(graphicsContext); | 104 drawCrossfade(graphicsContext); |
106 | 105 |
107 // Tile the image buffer into the context. | 106 // Tile the image buffer into the context. |
108 imageBuffer->drawPattern(context, srcRect, patternTransform, phase, styleCol
orSpace, compositeOp, dstRect); | 107 imageBuffer->drawPattern(context, srcRect, patternTransform, phase, styleCol
orSpace, compositeOp, dstRect); |
109 } | 108 } |
110 | 109 |
111 void CrossfadeGeneratedImage::reportMemoryUsage(MemoryObjectInfo* memoryObjectIn
fo) const | |
112 { | |
113 MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Image); | |
114 GeneratedImage::reportMemoryUsage(memoryObjectInfo); | |
115 info.addMember(m_fromImage, "fromImage"); | |
116 info.addMember(m_toImage, "toImage"); | |
117 } | 110 } |
118 | |
119 } | |
OLD | NEW |