Chromium Code Reviews| 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 OffscreenCanvasRenderingContext_h | 5 #ifndef OffscreenCanvasRenderingContext_h |
| 6 #define OffscreenCanvasRenderingContext_h | 6 #define OffscreenCanvasRenderingContext_h |
| 7 | 7 |
| 8 #include "modules/ModulesExport.h" | 8 #include "modules/ModulesExport.h" |
| 9 #include "modules/offscreencanvas/OffscreenCanvas.h" | 9 #include "modules/offscreencanvas/OffscreenCanvas.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class ImageBitmap; | 13 class ImageBitmap; |
| 14 | 14 |
| 15 class MODULES_EXPORT OffscreenCanvasRenderingContext : public GarbageCollectedFi nalized<OffscreenCanvasRenderingContext>, public ScriptWrappable { | 15 class MODULES_EXPORT OffscreenCanvasRenderingContext : public GarbageCollectedMi xin { |
|
Justin Novosad
2016/04/20 20:07:27
Thanks for figuring this out.
| |
| 16 WTF_MAKE_NONCOPYABLE(OffscreenCanvasRenderingContext); | 16 WTF_MAKE_NONCOPYABLE(OffscreenCanvasRenderingContext); |
| 17 public: | 17 public: |
| 18 virtual ~OffscreenCanvasRenderingContext() { } | 18 virtual ~OffscreenCanvasRenderingContext() { } |
| 19 enum ContextType { | 19 enum ContextType { |
| 20 Context2d = 0, | 20 Context2d = 0, |
| 21 ContextWebgl = 1, | 21 ContextWebgl = 1, |
| 22 ContextWebgl2 = 2, | 22 ContextWebgl2 = 2, |
| 23 ContextTypeCount | 23 ContextTypeCount |
| 24 }; | 24 }; |
| 25 static ContextType contextTypeFromId(const String& id); | 25 static ContextType contextTypeFromId(const String& id); |
| 26 | 26 |
| 27 OffscreenCanvas* getOffscreenCanvas() const { return m_offscreenCanvas; } | 27 OffscreenCanvas* getOffscreenCanvas() const { return m_offscreenCanvas; } |
| 28 virtual ContextType getContextType() const = 0; | 28 virtual ContextType getOffscreenCanvasRenderingContextType() const = 0; |
|
Justin Novosad
2016/04/20 20:07:27
Why the name change?
xidachen
2016/04/20 20:52:09
CanvasRenderingContext also has a method getContex
| |
| 29 virtual ImageBitmap* transferToImageBitmap(ExceptionState&) = 0; | 29 virtual ImageBitmap* transferToImageBitmap(ExceptionState&) = 0; |
| 30 virtual void setOffscreenCanvasGetContextResult(OffscreenRenderingContext&) = 0; | |
| 30 | 31 |
| 31 virtual bool is2d() const { return false; } | 32 virtual bool is2d() const { return false; } |
| 32 | 33 |
| 33 protected: | 34 protected: |
| 34 OffscreenCanvasRenderingContext(OffscreenCanvas*); | 35 OffscreenCanvasRenderingContext(OffscreenCanvas*); |
| 35 DECLARE_VIRTUAL_TRACE(); | 36 DECLARE_VIRTUAL_TRACE(); |
| 36 | 37 |
| 37 private: | 38 private: |
| 38 Member<OffscreenCanvas> m_offscreenCanvas; | 39 Member<OffscreenCanvas> m_offscreenCanvas; |
| 39 }; | 40 }; |
| 40 | 41 |
| 41 } // namespace blink | 42 } // namespace blink |
| 42 | 43 |
| 43 #endif // OffscreenCanvasRenderingContext_h | 44 #endif // OffscreenCanvasRenderingContext_h |
| OLD | NEW |