| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 class CanvasRenderingContext; | 50 class CanvasRenderingContext; |
| 51 class GraphicsContext; | 51 class GraphicsContext; |
| 52 class GraphicsContextStateSaver; | 52 class GraphicsContextStateSaver; |
| 53 class HTMLCanvasElement; | 53 class HTMLCanvasElement; |
| 54 class Image; | 54 class Image; |
| 55 class ImageData; | 55 class ImageData; |
| 56 class ImageBuffer; | 56 class ImageBuffer; |
| 57 class ImageBufferSurface; | 57 class ImageBufferSurface; |
| 58 class IntSize; | 58 class IntSize; |
| 59 | 59 |
| 60 class CanvasObserver : public DummyBase<void> { | 60 class CanvasObserver { |
| 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 | 69 |
| 70 class HTMLCanvasElement final : public HTMLElement, public DocumentVisibilityObs
erver, public CanvasImageSource, public ImageBufferClient { | 70 class HTMLCanvasElement final : public HTMLElement, public DocumentVisibilityObs
erver, public CanvasImageSource, public ImageBufferClient { |
| 71 DEFINE_WRAPPERTYPEINFO(); | 71 DEFINE_WRAPPERTYPEINFO(); |
| 72 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLCanvasElement); | |
| 73 public: | 72 public: |
| 74 DECLARE_NODE_FACTORY(HTMLCanvasElement); | 73 DECLARE_NODE_FACTORY(HTMLCanvasElement); |
| 75 virtual ~HTMLCanvasElement(); | 74 virtual ~HTMLCanvasElement(); |
| 76 | 75 |
| 77 void addObserver(CanvasObserver*); | 76 void addObserver(CanvasObserver*); |
| 78 void removeObserver(CanvasObserver*); | 77 void removeObserver(CanvasObserver*); |
| 79 | 78 |
| 80 // Attributes and functions exposed to script | 79 // Attributes and functions exposed to script |
| 81 int width() const { return size().width(); } | 80 int width() const { return size().width(); } |
| 82 int height() const { return size().height(); } | 81 int height() const { return size().height(); } |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 OwnPtr<ImageBuffer> m_imageBuffer; | 195 OwnPtr<ImageBuffer> m_imageBuffer; |
| 197 mutable OwnPtr<GraphicsContextStateSaver> m_contextStateSaver; | 196 mutable OwnPtr<GraphicsContextStateSaver> m_contextStateSaver; |
| 198 | 197 |
| 199 mutable RefPtr<Image> m_presentedImage; | 198 mutable RefPtr<Image> m_presentedImage; |
| 200 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor
ms that have to copy the image buffer to render (and for CSSCanvasValue). | 199 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor
ms that have to copy the image buffer to render (and for CSSCanvasValue). |
| 201 }; | 200 }; |
| 202 | 201 |
| 203 } // namespace blink | 202 } // namespace blink |
| 204 | 203 |
| 205 #endif // HTMLCanvasElement_h | 204 #endif // HTMLCanvasElement_h |
| OLD | NEW |