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 12 matching lines...) Expand all Loading... |
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 "platform/graphics/CrossfadeGeneratedImage.h" | 27 #include "platform/graphics/CrossfadeGeneratedImage.h" |
28 | 28 |
29 #include "platform/geometry/FloatRect.h" | 29 #include "platform/geometry/FloatRect.h" |
30 #include "platform/graphics/GraphicsContextStateSaver.h" | 30 #include "platform/graphics/GraphicsContextStateSaver.h" |
31 #include "platform/graphics/ImageBuffer.h" | 31 #include "platform/graphics/ImageBuffer.h" |
32 | 32 |
33 using namespace std; | |
34 | |
35 namespace blink { | 33 namespace blink { |
36 | 34 |
37 CrossfadeGeneratedImage::CrossfadeGeneratedImage(Image* fromImage, Image* toImag
e, float percentage, IntSize crossfadeSize, const IntSize& size) | 35 CrossfadeGeneratedImage::CrossfadeGeneratedImage(Image* fromImage, Image* toImag
e, float percentage, IntSize crossfadeSize, const IntSize& size) |
38 : m_fromImage(fromImage) | 36 : m_fromImage(fromImage) |
39 , m_toImage(toImage) | 37 , m_toImage(toImage) |
40 , m_percentage(percentage) | 38 , m_percentage(percentage) |
41 , m_crossfadeSize(crossfadeSize) | 39 , m_crossfadeSize(crossfadeSize) |
42 { | 40 { |
43 m_size = size; | 41 m_size = size; |
44 } | 42 } |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 103 |
106 // Fill with the cross-faded image. | 104 // Fill with the cross-faded image. |
107 GraphicsContext* graphicsContext = imageBuffer->context(); | 105 GraphicsContext* graphicsContext = imageBuffer->context(); |
108 drawCrossfade(graphicsContext); | 106 drawCrossfade(graphicsContext); |
109 | 107 |
110 // Tile the image buffer into the context. | 108 // Tile the image buffer into the context. |
111 imageBuffer->drawPattern(context, srcRect, scale, phase, compositeOp, dstRec
t, blendMode, repeatSpacing); | 109 imageBuffer->drawPattern(context, srcRect, scale, phase, compositeOp, dstRec
t, blendMode, repeatSpacing); |
112 } | 110 } |
113 | 111 |
114 } // namespace blink | 112 } // namespace blink |
OLD | NEW |