| 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 | 125 |
| 126 SkCanvas* drawingCanvas() const; | 126 SkCanvas* drawingCanvas() const; |
| 127 void disableDeferral() const; | 127 void disableDeferral() const; |
| 128 SkCanvas* existingDrawingCanvas() const; | 128 SkCanvas* existingDrawingCanvas() const; |
| 129 | 129 |
| 130 void setRenderingContext(PassOwnPtrWillBeRawPtr<CanvasRenderingContext>); | 130 void setRenderingContext(PassOwnPtrWillBeRawPtr<CanvasRenderingContext>); |
| 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) const; | 135 PassRefPtr<Image> copiedImage(SourceDrawingBuffer, AccelerationHint) const; |
| 136 void clearCopiedImage(); | 136 void clearCopiedImage(); |
| 137 | 137 |
| 138 SecurityOrigin* securityOrigin() const; | 138 SecurityOrigin* securityOrigin() 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; |
| 146 | 146 |
| 147 bool hasImageBuffer() const { return m_imageBuffer; } | 147 bool hasImageBuffer() const { return m_imageBuffer; } |
| 148 void discardImageBuffer(); | 148 void discardImageBuffer(); |
| 149 | 149 |
| 150 bool shouldAccelerate(const IntSize&) const; | 150 bool shouldAccelerate(const IntSize&) const; |
| 151 | 151 |
| 152 bool shouldBeDirectComposited() const; | 152 bool shouldBeDirectComposited() const; |
| 153 | 153 |
| 154 void prepareSurfaceForPaintingIfNeeded() const; |
| 155 |
| 154 const AtomicString imageSourceURL() const override; | 156 const AtomicString imageSourceURL() const override; |
| 155 | 157 |
| 156 InsertionNotificationRequest insertedInto(ContainerNode*) override; | 158 InsertionNotificationRequest insertedInto(ContainerNode*) override; |
| 157 | 159 |
| 158 // DocumentVisibilityObserver implementation | 160 // DocumentVisibilityObserver implementation |
| 159 void didChangeVisibilityState(PageVisibilityState) override; | 161 void didChangeVisibilityState(PageVisibilityState) override; |
| 160 | 162 |
| 161 // CanvasImageSource implementation | 163 // CanvasImageSource implementation |
| 162 PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*) const override
; | 164 PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*, AccelerationHi
nt) const override; |
| 163 bool wouldTaintOrigin(SecurityOrigin*) const override; | 165 bool wouldTaintOrigin(SecurityOrigin*) const override; |
| 164 FloatSize elementSize() const override; | 166 FloatSize elementSize() const override; |
| 165 bool isCanvasElement() const override { return true; } | 167 bool isCanvasElement() const override { return true; } |
| 166 bool isOpaque() const override; | 168 bool isOpaque() const override; |
| 167 | 169 |
| 168 // ImageBufferClient implementation | 170 // ImageBufferClient implementation |
| 169 void notifySurfaceInvalid() override; | 171 void notifySurfaceInvalid() override; |
| 170 bool isDirty() override { return !m_dirtyRect.isEmpty(); } | 172 bool isDirty() override { return !m_dirtyRect.isEmpty(); } |
| 171 void didFinalizeFrame() override; | 173 void didFinalizeFrame() override; |
| 172 void restoreCanvasMatrixClipStack(SkCanvas*) const override; | 174 void restoreCanvasMatrixClipStack(SkCanvas*) const override; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 mutable bool m_didFailToCreateImageBuffer; | 232 mutable bool m_didFailToCreateImageBuffer; |
| 231 bool m_imageBufferIsClear; | 233 bool m_imageBufferIsClear; |
| 232 OwnPtr<ImageBuffer> m_imageBuffer; | 234 OwnPtr<ImageBuffer> m_imageBuffer; |
| 233 | 235 |
| 234 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor
ms that have to copy the image buffer to render (and for CSSCanvasValue). | 236 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor
ms that have to copy the image buffer to render (and for CSSCanvasValue). |
| 235 }; | 237 }; |
| 236 | 238 |
| 237 } // namespace blink | 239 } // namespace blink |
| 238 | 240 |
| 239 #endif // HTMLCanvasElement_h | 241 #endif // HTMLCanvasElement_h |
| OLD | NEW |