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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #include "wtf/Uint8ClampedArray.h" | 43 #include "wtf/Uint8ClampedArray.h" |
44 #include "wtf/Vector.h" | 44 #include "wtf/Vector.h" |
45 | 45 |
46 class SkCanvas; | 46 class SkCanvas; |
47 | 47 |
48 namespace WebKit { class WebLayer; } | 48 namespace WebKit { class WebLayer; } |
49 | 49 |
50 namespace WebCore { | 50 namespace WebCore { |
51 | 51 |
52 class Image; | 52 class Image; |
53 class ImageData; | |
54 class IntPoint; | 53 class IntPoint; |
55 class IntRect; | 54 class IntRect; |
56 class GraphicsContext3D; | 55 class GraphicsContext3D; |
57 | 56 |
58 enum Multiply { | 57 enum Multiply { |
59 Premultiplied, | 58 Premultiplied, |
60 Unmultiplied | 59 Unmultiplied |
61 }; | 60 }; |
62 | 61 |
63 enum RenderingMode { | 62 enum RenderingMode { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 RefPtr<SkCanvas> m_canvas; | 144 RefPtr<SkCanvas> m_canvas; |
146 OwnPtr<GraphicsContext> m_context; | 145 OwnPtr<GraphicsContext> m_context; |
147 Canvas2DLayerBridgePtr m_layerBridge; | 146 Canvas2DLayerBridgePtr m_layerBridge; |
148 | 147 |
149 // This constructor will place its success into the given out-variable | 148 // This constructor will place its success into the given out-variable |
150 // so that create() knows when it should return failure. | 149 // so that create() knows when it should return failure. |
151 ImageBuffer(const IntSize&, float resolutionScale, RenderingMode, OpacityMod
e, int acceleratedSampleCount, bool& success); | 150 ImageBuffer(const IntSize&, float resolutionScale, RenderingMode, OpacityMod
e, int acceleratedSampleCount, bool& success); |
152 ImageBuffer(const IntSize&, float resolutionScale, const GraphicsContext*, b
ool hasAlpha, bool& success); | 151 ImageBuffer(const IntSize&, float resolutionScale, const GraphicsContext*, b
ool hasAlpha, bool& success); |
153 }; | 152 }; |
154 | 153 |
155 String ImageDataToDataURL(const ImageData&, const String& mimeType, const double
* quality); | 154 struct ImageDataBuffer { |
| 155 ImageDataBuffer(const IntSize& size, PassRefPtr<Uint8ClampedArray> data) : m
_size(size), m_data(data) { } |
| 156 IntSize size() const { return m_size; } |
| 157 unsigned char* data() const { return m_data->data(); } |
| 158 |
| 159 IntSize m_size; |
| 160 RefPtr<Uint8ClampedArray> m_data; |
| 161 }; |
| 162 |
| 163 String ImageDataToDataURL(const ImageDataBuffer&, const String& mimeType, const
double* quality); |
156 | 164 |
157 } // namespace WebCore | 165 } // namespace WebCore |
158 | 166 |
159 #endif // ImageBuffer_h | 167 #endif // ImageBuffer_h |
OLD | NEW |