| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 class CanvasObserver : public WillBeGarbageCollectedMixin { | 60 class CanvasObserver : public WillBeGarbageCollectedMixin { |
| 61 DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(CanvasObserver); | 61 DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(CanvasObserver); |
| 62 public: | 62 public: |
| 63 virtual void canvasChanged(HTMLCanvasElement*, const FloatRect& changedRect)
= 0; | 63 virtual void canvasChanged(HTMLCanvasElement*, const FloatRect& changedRect)
= 0; |
| 64 virtual void canvasResized(HTMLCanvasElement*) = 0; | 64 virtual void canvasResized(HTMLCanvasElement*) = 0; |
| 65 #if !ENABLE(OILPAN) | 65 #if !ENABLE(OILPAN) |
| 66 virtual void canvasDestroyed(HTMLCanvasElement*) = 0; | 66 virtual void canvasDestroyed(HTMLCanvasElement*) = 0; |
| 67 #endif | 67 #endif |
| 68 | 68 |
| 69 virtual void trace(Visitor*) { } | 69 DEFINE_INLINE_VIRTUAL_TRACE() { } |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 class HTMLCanvasElement final : public HTMLElement, public DocumentVisibilityObs
erver, public CanvasImageSource, public ImageBufferClient { | 72 class HTMLCanvasElement final : public HTMLElement, public DocumentVisibilityObs
erver, public CanvasImageSource, public ImageBufferClient { |
| 73 DEFINE_WRAPPERTYPEINFO(); | 73 DEFINE_WRAPPERTYPEINFO(); |
| 74 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLCanvasElement); | 74 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLCanvasElement); |
| 75 public: | 75 public: |
| 76 DECLARE_NODE_FACTORY(HTMLCanvasElement); | 76 DECLARE_NODE_FACTORY(HTMLCanvasElement); |
| 77 virtual ~HTMLCanvasElement(); | 77 virtual ~HTMLCanvasElement(); |
| 78 | 78 |
| 79 void addObserver(CanvasObserver*); | 79 void addObserver(CanvasObserver*); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 virtual bool isOpaque() const override; | 157 virtual bool isOpaque() const override; |
| 158 | 158 |
| 159 // ImageBufferClient implementation | 159 // ImageBufferClient implementation |
| 160 virtual void notifySurfaceInvalid() override; | 160 virtual void notifySurfaceInvalid() override; |
| 161 virtual bool isDirty() override { return !m_dirtyRect.isEmpty(); } | 161 virtual bool isDirty() override { return !m_dirtyRect.isEmpty(); } |
| 162 virtual void didFinalizeFrame() override; | 162 virtual void didFinalizeFrame() override; |
| 163 virtual void restoreCanvasMatrixClipStack() override; | 163 virtual void restoreCanvasMatrixClipStack() override; |
| 164 | 164 |
| 165 void doDeferredPaintInvalidation(); | 165 void doDeferredPaintInvalidation(); |
| 166 | 166 |
| 167 virtual void trace(Visitor*) override; | 167 DECLARE_VIRTUAL_TRACE(); |
| 168 | 168 |
| 169 // Methods used for testing | 169 // Methods used for testing |
| 170 void createImageBufferUsingSurface(PassOwnPtr<ImageBufferSurface>); | 170 void createImageBufferUsingSurface(PassOwnPtr<ImageBufferSurface>); |
| 171 | 171 |
| 172 protected: | 172 protected: |
| 173 virtual void didMoveToNewDocument(Document& oldDocument) override; | 173 virtual void didMoveToNewDocument(Document& oldDocument) override; |
| 174 | 174 |
| 175 private: | 175 private: |
| 176 explicit HTMLCanvasElement(Document&); | 176 explicit HTMLCanvasElement(Document&); |
| 177 | 177 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 bool m_imageBufferIsClear; | 216 bool m_imageBufferIsClear; |
| 217 OwnPtr<ImageBuffer> m_imageBuffer; | 217 OwnPtr<ImageBuffer> m_imageBuffer; |
| 218 mutable OwnPtr<GraphicsContextStateSaver> m_contextStateSaver; | 218 mutable OwnPtr<GraphicsContextStateSaver> m_contextStateSaver; |
| 219 | 219 |
| 220 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor
ms that have to copy the image buffer to render (and for CSSCanvasValue). | 220 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor
ms that have to copy the image buffer to render (and for CSSCanvasValue). |
| 221 }; | 221 }; |
| 222 | 222 |
| 223 } // namespace blink | 223 } // namespace blink |
| 224 | 224 |
| 225 #endif // HTMLCanvasElement_h | 225 #endif // HTMLCanvasElement_h |
| OLD | NEW |