OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef InputEvent_h | 5 #ifndef OffscreenCanvasRenderingContext_h |
6 #define InputEvent_h | 6 #define OffscreenCanvasRenderingContext_h |
7 | 7 |
8 #include "core/events/InputEventInit.h" | 8 #include "modules/ModulesExport.h" |
9 #include "core/events/UIEvent.h" | 9 #include "modules/offscreencanvas/OffscreenCanvas.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 class InputEvent final : public UIEvent { | 13 class MODULES_EXPORT OffscreenCanvasRenderingContext : public GarbageCollectedFi
nalized<OffscreenCanvasRenderingContext>, public ScriptWrappable { |
14 DEFINE_WRAPPERTYPEINFO(); | 14 WTF_MAKE_NONCOPYABLE(OffscreenCanvasRenderingContext); |
| 15 public: |
| 16 virtual ~OffscreenCanvasRenderingContext() { } |
| 17 enum ContextType { |
| 18 Context2d = 0, |
| 19 ContextWebgl = 1, |
| 20 ContextWebgl2 = 2, |
| 21 ContextTypeCount |
| 22 }; |
| 23 static ContextType contextTypeFromId(const String& id); |
15 | 24 |
16 public: | 25 OffscreenCanvas* offscreenCanvas() const { return m_offscreenCanvas; } |
17 static PassRefPtrWillBeRawPtr<InputEvent> create() | 26 virtual ContextType contextType() const = 0; |
18 { | |
19 return adoptRefWillBeNoop(new InputEvent); | |
20 } | |
21 | 27 |
22 static PassRefPtrWillBeRawPtr<InputEvent> create(const AtomicString& type, c
onst InputEventInit& initializer) | 28 virtual bool is2d() const { return false; } |
23 { | |
24 return adoptRefWillBeNoop(new InputEvent(type, initializer)); | |
25 } | |
26 | 29 |
27 bool isInputEvent() const override; | 30 protected: |
28 | 31 OffscreenCanvasRenderingContext(OffscreenCanvas*); |
29 DECLARE_VIRTUAL_TRACE(); | 32 DECLARE_VIRTUAL_TRACE(); |
30 | 33 |
31 private: | 34 private: |
32 InputEvent(); | 35 Member<OffscreenCanvas> m_offscreenCanvas; |
33 InputEvent(const AtomicString&, const InputEventInit&); | |
34 }; | 36 }; |
35 | 37 |
36 DEFINE_EVENT_TYPE_CASTS(InputEvent); | |
37 | |
38 } // namespace blink | 38 } // namespace blink |
39 | 39 |
40 #endif // InputEvent_h | 40 #endif // OffscreenCanvasRenderingContext_h |
OLD | NEW |