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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 void paint(GraphicsContext&, const LayoutRect&); | 125 void paint(GraphicsContext&, const LayoutRect&); |
126 | 126 |
127 SkCanvas* drawingCanvas() const; | 127 SkCanvas* drawingCanvas() const; |
128 void disableDeferral(DisableDeferralReason) const; | 128 void disableDeferral(DisableDeferralReason) const; |
129 SkCanvas* existingDrawingCanvas() const; | 129 SkCanvas* existingDrawingCanvas() const; |
130 | 130 |
131 CanvasRenderingContext* renderingContext() const { return m_context.get(); } | 131 CanvasRenderingContext* renderingContext() const { return m_context.get(); } |
132 | 132 |
133 void ensureUnacceleratedImageBuffer(); | 133 void ensureUnacceleratedImageBuffer(); |
134 ImageBuffer* buffer() const; | 134 ImageBuffer* buffer() const; |
135 PassRefPtr<Image> copiedImage(SourceDrawingBuffer, AccelerationHint) const; | 135 Image* copiedImage(SourceDrawingBuffer, AccelerationHint) const; |
136 void clearCopiedImage(); | 136 void clearCopiedImage(); |
137 | 137 |
138 SecurityOrigin* getSecurityOrigin() const; | 138 SecurityOrigin* getSecurityOrigin() const; |
139 bool originClean() const; | 139 bool originClean() const; |
140 void setOriginTainted() { m_originClean = false; } | 140 void setOriginTainted() { m_originClean = false; } |
141 | 141 |
142 AffineTransform baseTransform() const; | 142 AffineTransform baseTransform() const; |
143 | 143 |
144 bool is3D() const; | 144 bool is3D() const; |
145 bool isAnimated2D() const; | 145 bool isAnimated2D() const; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 bool shouldUseDisplayList(const IntSize& deviceSize); | 232 bool shouldUseDisplayList(const IntSize& deviceSize); |
233 | 233 |
234 void setSurfaceSize(const IntSize&); | 234 void setSurfaceSize(const IntSize&); |
235 | 235 |
236 bool paintsIntoCanvasBuffer() const; | 236 bool paintsIntoCanvasBuffer() const; |
237 | 237 |
238 ImageData* toImageData(SourceDrawingBuffer, SnapshotReason) const; | 238 ImageData* toImageData(SourceDrawingBuffer, SnapshotReason) const; |
239 | 239 |
240 String toDataURLInternal(const String& mimeType, const double& quality, Sour
ceDrawingBuffer) const; | 240 String toDataURLInternal(const String& mimeType, const double& quality, Sour
ceDrawingBuffer) const; |
241 | 241 |
| 242 Image* ensureTransparentImage() const; |
| 243 |
242 HeapHashSet<WeakMember<CanvasDrawListener>> m_listeners; | 244 HeapHashSet<WeakMember<CanvasDrawListener>> m_listeners; |
243 | 245 |
244 IntSize m_size; | 246 IntSize m_size; |
245 | 247 |
246 Member<CanvasRenderingContext> m_context; | 248 Member<CanvasRenderingContext> m_context; |
247 | 249 |
248 bool m_ignoreReset; | 250 bool m_ignoreReset; |
249 FloatRect m_dirtyRect; | 251 FloatRect m_dirtyRect; |
250 | 252 |
251 mutable intptr_t m_externallyAllocatedMemory; | 253 mutable intptr_t m_externallyAllocatedMemory; |
252 | 254 |
253 bool m_originClean; | 255 bool m_originClean; |
254 | 256 |
255 // It prevents HTMLCanvasElement::buffer() from continuously re-attempting t
o allocate an imageBuffer | 257 // It prevents HTMLCanvasElement::buffer() from continuously re-attempting t
o allocate an imageBuffer |
256 // after the first attempt failed. | 258 // after the first attempt failed. |
257 mutable bool m_didFailToCreateImageBuffer; | 259 mutable bool m_didFailToCreateImageBuffer; |
258 bool m_imageBufferIsClear; | 260 bool m_imageBufferIsClear; |
259 std::unique_ptr<ImageBuffer> m_imageBuffer; | 261 std::unique_ptr<ImageBuffer> m_imageBuffer; |
260 | 262 |
261 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor
ms that have to copy the image buffer to render (and for CSSCanvasValue). | 263 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor
ms that have to copy the image buffer to render (and for CSSCanvasValue). |
262 | 264 |
263 // Used for OffscreenCanvas that controls this HTML canvas element | 265 // Used for OffscreenCanvas that controls this HTML canvas element |
264 std::unique_ptr<CanvasSurfaceLayerBridge> m_surfaceLayerBridge; | 266 std::unique_ptr<CanvasSurfaceLayerBridge> m_surfaceLayerBridge; |
| 267 |
| 268 mutable RefPtr<Image> m_transparentImage; |
265 }; | 269 }; |
266 | 270 |
267 } // namespace blink | 271 } // namespace blink |
268 | 272 |
269 #endif // HTMLCanvasElement_h | 273 #endif // HTMLCanvasElement_h |
OLD | NEW |