OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. |
4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. | 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 14 matching lines...) Expand all Loading... |
25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 */ | 26 */ |
27 | 27 |
28 #ifndef ImageBuffer_h | 28 #ifndef ImageBuffer_h |
29 #define ImageBuffer_h | 29 #define ImageBuffer_h |
30 | 30 |
31 #include "platform/PlatformExport.h" | 31 #include "platform/PlatformExport.h" |
32 #include "platform/geometry/FloatRect.h" | 32 #include "platform/geometry/FloatRect.h" |
33 #include "platform/geometry/IntSize.h" | 33 #include "platform/geometry/IntSize.h" |
34 #include "platform/graphics/Canvas2DLayerBridge.h" | 34 #include "platform/graphics/Canvas2DLayerBridge.h" |
35 #include "platform/graphics/ColorSpace.h" | |
36 #include "platform/graphics/GraphicsTypes.h" | 35 #include "platform/graphics/GraphicsTypes.h" |
37 #include "platform/graphics/GraphicsTypes3D.h" | 36 #include "platform/graphics/GraphicsTypes3D.h" |
38 #include "platform/graphics/ImageBufferSurface.h" | 37 #include "platform/graphics/ImageBufferSurface.h" |
39 #include "platform/graphics/paint/DisplayItemClient.h" | 38 #include "platform/graphics/paint/DisplayItemClient.h" |
40 #include "platform/transforms/AffineTransform.h" | 39 #include "platform/transforms/AffineTransform.h" |
41 #include "third_party/skia/include/core/SkPaint.h" | 40 #include "third_party/skia/include/core/SkPaint.h" |
42 #include "wtf/Forward.h" | 41 #include "wtf/Forward.h" |
43 #include "wtf/OwnPtr.h" | 42 #include "wtf/OwnPtr.h" |
44 #include "wtf/PassOwnPtr.h" | 43 #include "wtf/PassOwnPtr.h" |
45 #include "wtf/PassRefPtr.h" | 44 #include "wtf/PassRefPtr.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 146 |
148 PassRefPtr<SkImage> newImageSnapshot() const; | 147 PassRefPtr<SkImage> newImageSnapshot() const; |
149 | 148 |
150 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi
s); } | 149 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi
s); } |
151 String debugName() const { return "ImageBuffer"; } | 150 String debugName() const { return "ImageBuffer"; } |
152 | 151 |
153 private: | 152 private: |
154 ImageBuffer(PassOwnPtr<ImageBufferSurface>); | 153 ImageBuffer(PassOwnPtr<ImageBufferSurface>); |
155 | 154 |
156 void draw(GraphicsContext*, const FloatRect&, const FloatRect*, SkXfermode::
Mode); | 155 void draw(GraphicsContext*, const FloatRect&, const FloatRect*, SkXfermode::
Mode); |
157 static PassRefPtr<SkColorFilter> createColorSpaceFilter(ColorSpace srcColorS
pace, ColorSpace dstColorSpace); | |
158 | 156 |
159 friend class GraphicsContext; | 157 friend class GraphicsContext; |
160 friend class SkiaImageFilterBuilder; | 158 friend class SkiaImageFilterBuilder; |
161 | 159 |
162 OwnPtr<ImageBufferSurface> m_surface; | 160 OwnPtr<ImageBufferSurface> m_surface; |
163 OwnPtr<GraphicsContext> m_context; | 161 OwnPtr<GraphicsContext> m_context; |
164 ImageBufferClient* m_client; | 162 ImageBufferClient* m_client; |
165 }; | 163 }; |
166 | 164 |
167 struct ImageDataBuffer { | 165 struct ImageDataBuffer { |
168 ImageDataBuffer(const IntSize& size, unsigned char* data) : m_data(data), m_
size(size) { } | 166 ImageDataBuffer(const IntSize& size, unsigned char* data) : m_data(data), m_
size(size) { } |
169 String PLATFORM_EXPORT toDataURL(const String& mimeType, const double* quali
ty) const; | 167 String PLATFORM_EXPORT toDataURL(const String& mimeType, const double* quali
ty) const; |
170 unsigned char* pixels() const { return m_data; } | 168 unsigned char* pixels() const { return m_data; } |
171 int height() const { return m_size.height(); } | 169 int height() const { return m_size.height(); } |
172 int width() const { return m_size.width(); } | 170 int width() const { return m_size.width(); } |
173 unsigned char* m_data; | 171 unsigned char* m_data; |
174 IntSize m_size; | 172 IntSize m_size; |
175 }; | 173 }; |
176 | 174 |
177 } // namespace blink | 175 } // namespace blink |
178 | 176 |
179 #endif // ImageBuffer_h | 177 #endif // ImageBuffer_h |
OLD | NEW |