| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 class CanvasImageSource; | 41 class CanvasImageSource; |
| 42 class HTMLCanvasElement; | 42 class HTMLCanvasElement; |
| 43 class ImageData; | 43 class ImageData; |
| 44 | 44 |
| 45 class CORE_EXPORT CanvasRenderingContext : public NoBaseWillBeGarbageCollectedFi
nalized<CanvasRenderingContext>, public ActiveDOMObject, public ScriptWrappable
{ | 45 class CORE_EXPORT CanvasRenderingContext : public NoBaseWillBeGarbageCollectedFi
nalized<CanvasRenderingContext>, public ActiveDOMObject, public ScriptWrappable
{ |
| 46 WTF_MAKE_NONCOPYABLE(CanvasRenderingContext); | 46 WTF_MAKE_NONCOPYABLE(CanvasRenderingContext); |
| 47 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(CanvasRenderingContext); | 47 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(CanvasRenderingContext); |
| 48 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(CanvasRenderingContext); | 48 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(CanvasRenderingContext); |
| 49 public: | 49 public: |
| 50 virtual ~CanvasRenderingContext() { } | 50 ~CanvasRenderingContext() override { } |
| 51 | 51 |
| 52 // A Canvas can either be "2D" or "webgl" but never both. If you request a 2
D canvas and the existing | 52 // A Canvas can either be "2D" or "webgl" but never both. If you request a 2
D canvas and the existing |
| 53 // context is already 2D, just return that. If the existing context is WebGL
, then destroy it | 53 // context is already 2D, just return that. If the existing context is WebGL
, then destroy it |
| 54 // before creating a new 2D context. Vice versa when requesting a WebGL canv
as. Requesting a | 54 // before creating a new 2D context. Vice versa when requesting a WebGL canv
as. Requesting a |
| 55 // context with any other type string will destroy any existing context. | 55 // context with any other type string will destroy any existing context. |
| 56 enum ContextType { | 56 enum ContextType { |
| 57 // Do not change assigned numbers of existing items: add new features to
the end of the list. | 57 // Do not change assigned numbers of existing items: add new features to
the end of the list. |
| 58 Context2d = 0, | 58 Context2d = 0, |
| 59 ContextExperimentalWebgl = 2, | 59 ContextExperimentalWebgl = 2, |
| 60 ContextWebgl = 3, | 60 ContextWebgl = 3, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 virtual int externallyAllocatedBytesPerPixel() { ASSERT_NOT_REACHED(); retur
n 0; } | 95 virtual int externallyAllocatedBytesPerPixel() { ASSERT_NOT_REACHED(); retur
n 0; } |
| 96 | 96 |
| 97 bool wouldTaintOrigin(CanvasImageSource*); | 97 bool wouldTaintOrigin(CanvasImageSource*); |
| 98 void didMoveToNewDocument(Document*); | 98 void didMoveToNewDocument(Document*); |
| 99 | 99 |
| 100 protected: | 100 protected: |
| 101 CanvasRenderingContext(HTMLCanvasElement*); | 101 CanvasRenderingContext(HTMLCanvasElement*); |
| 102 DECLARE_VIRTUAL_TRACE(); | 102 DECLARE_VIRTUAL_TRACE(); |
| 103 | 103 |
| 104 // ActiveDOMObject notifications | 104 // ActiveDOMObject notifications |
| 105 bool hasPendingActivity() const override final; | 105 bool hasPendingActivity() const final; |
| 106 void stop() override = 0; | 106 void stop() override = 0; |
| 107 | 107 |
| 108 private: | 108 private: |
| 109 RawPtrWillBeMember<HTMLCanvasElement> m_canvas; | 109 RawPtrWillBeMember<HTMLCanvasElement> m_canvas; |
| 110 HashSet<String> m_cleanURLs; | 110 HashSet<String> m_cleanURLs; |
| 111 HashSet<String> m_dirtyURLs; | 111 HashSet<String> m_dirtyURLs; |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 } // namespace blink | 114 } // namespace blink |
| 115 | 115 |
| 116 #endif | 116 #endif |
| OLD | NEW |