OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2006, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2009, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> | 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> |
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 void paint(GraphicsContext*, const LayoutRect&); | 114 void paint(GraphicsContext*, const LayoutRect&); |
115 | 115 |
116 GraphicsContext* drawingContext() const; | 116 GraphicsContext* drawingContext() const; |
117 GraphicsContext* existingDrawingContext() const; | 117 GraphicsContext* existingDrawingContext() const; |
118 | 118 |
119 CanvasRenderingContext* renderingContext() const { return m_context.get(); } | 119 CanvasRenderingContext* renderingContext() const { return m_context.get(); } |
120 | 120 |
121 void ensureUnacceleratedImageBuffer(); | 121 void ensureUnacceleratedImageBuffer(); |
122 ImageBuffer* buffer() const; | 122 ImageBuffer* buffer() const; |
123 Image* copiedImage() const; | 123 enum SourceBuffer { Front, Back }; |
| 124 Image* copiedImage(SourceBuffer) const; |
124 void clearCopiedImage(); | 125 void clearCopiedImage(); |
125 PassRefPtrWillBeRawPtr<ImageData> getImageData() const; | |
126 | 126 |
127 SecurityOrigin* securityOrigin() const; | 127 SecurityOrigin* securityOrigin() const; |
128 bool originClean() const { return m_originClean; } | 128 bool originClean() const { return m_originClean; } |
129 void setOriginTainted() { m_originClean = false; } | 129 void setOriginTainted() { m_originClean = false; } |
130 | 130 |
131 AffineTransform baseTransform() const; | 131 AffineTransform baseTransform() const; |
132 | 132 |
133 bool is3D() const; | 133 bool is3D() const; |
134 | 134 |
135 bool hasImageBuffer() const { return m_imageBuffer; } | 135 bool hasImageBuffer() const { return m_imageBuffer; } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 bool shouldUseDisplayList(const IntSize& deviceSize); | 181 bool shouldUseDisplayList(const IntSize& deviceSize); |
182 | 182 |
183 void resetDirtyRect(); | 183 void resetDirtyRect(); |
184 | 184 |
185 void setSurfaceSize(const IntSize&); | 185 void setSurfaceSize(const IntSize&); |
186 | 186 |
187 bool paintsIntoCanvasBuffer() const; | 187 bool paintsIntoCanvasBuffer() const; |
188 | 188 |
189 void updateExternallyAllocatedMemory() const; | 189 void updateExternallyAllocatedMemory() const; |
190 | 190 |
191 String toDataURLInternal(const String& mimeType, const double* quality, bool
isSaving = false) const; | 191 String toDataURLInternal(const String& mimeType, const double* quality, Sour
ceBuffer) const; |
192 | 192 |
193 WillBeHeapHashSet<RawPtrWillBeWeakMember<CanvasObserver>> m_observers; | 193 WillBeHeapHashSet<RawPtrWillBeWeakMember<CanvasObserver>> m_observers; |
194 | 194 |
195 IntSize m_size; | 195 IntSize m_size; |
196 | 196 |
197 OwnPtrWillBeMember<CanvasRenderingContext> m_context; | 197 OwnPtrWillBeMember<CanvasRenderingContext> m_context; |
198 | 198 |
199 bool m_ignoreReset; | 199 bool m_ignoreReset; |
200 bool m_accelerationDisabled; | 200 bool m_accelerationDisabled; |
201 FloatRect m_dirtyRect; | 201 FloatRect m_dirtyRect; |
202 | 202 |
203 mutable intptr_t m_externallyAllocatedMemory; | 203 mutable intptr_t m_externallyAllocatedMemory; |
204 | 204 |
205 bool m_originClean; | 205 bool m_originClean; |
206 | 206 |
207 // It prevents HTMLCanvasElement::buffer() from continuously re-attempting t
o allocate an imageBuffer | 207 // It prevents HTMLCanvasElement::buffer() from continuously re-attempting t
o allocate an imageBuffer |
208 // after the first attempt failed. | 208 // after the first attempt failed. |
209 mutable bool m_didFailToCreateImageBuffer; | 209 mutable bool m_didFailToCreateImageBuffer; |
210 mutable bool m_didClearImageBuffer; | 210 mutable bool m_didClearImageBuffer; |
211 OwnPtr<ImageBuffer> m_imageBuffer; | 211 OwnPtr<ImageBuffer> m_imageBuffer; |
212 mutable OwnPtr<GraphicsContextStateSaver> m_contextStateSaver; | 212 mutable OwnPtr<GraphicsContextStateSaver> m_contextStateSaver; |
213 | 213 |
214 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor
ms that have to copy the image buffer to render (and for CSSCanvasValue). | 214 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor
ms that have to copy the image buffer to render (and for CSSCanvasValue). |
215 }; | 215 }; |
216 | 216 |
217 } // namespace blink | 217 } // namespace blink |
218 | 218 |
219 #endif // HTMLCanvasElement_h | 219 #endif // HTMLCanvasElement_h |
OLD | NEW |