Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasRenderingContext.h

Issue 1775153002: Make OffscreenCanvasRenderingContext2D renderable on a worker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix non-oilpan build Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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;
14
13 class MODULES_EXPORT OffscreenCanvasRenderingContext : public GarbageCollectedFi nalized<OffscreenCanvasRenderingContext>, public ScriptWrappable { 15 class MODULES_EXPORT OffscreenCanvasRenderingContext : public GarbageCollectedFi nalized<OffscreenCanvasRenderingContext>, public ScriptWrappable {
14 WTF_MAKE_NONCOPYABLE(OffscreenCanvasRenderingContext); 16 WTF_MAKE_NONCOPYABLE(OffscreenCanvasRenderingContext);
15 public: 17 public:
16 virtual ~OffscreenCanvasRenderingContext() { } 18 virtual ~OffscreenCanvasRenderingContext() { }
17 enum ContextType { 19 enum ContextType {
18 Context2d = 0, 20 Context2d = 0,
19 ContextWebgl = 1, 21 ContextWebgl = 1,
20 ContextWebgl2 = 2, 22 ContextWebgl2 = 2,
21 ContextTypeCount 23 ContextTypeCount
22 }; 24 };
23 static ContextType contextTypeFromId(const String& id); 25 static ContextType contextTypeFromId(const String& id);
24 26
25 OffscreenCanvas* offscreenCanvas() const { return m_offscreenCanvas; } 27 OffscreenCanvas* offscreenCanvas() const { return m_offscreenCanvas; }
26 virtual ContextType contextType() const = 0; 28 virtual ContextType contextType() const = 0;
29 virtual PassRefPtrWillBeRawPtr<ImageBitmap> transferToImageBitmap(ExceptionS tate&) = 0;
27 30
28 virtual bool is2d() const { return false; } 31 virtual bool is2d() const { return false; }
29 32
30 protected: 33 protected:
31 OffscreenCanvasRenderingContext(OffscreenCanvas*); 34 OffscreenCanvasRenderingContext(OffscreenCanvas*);
32 DECLARE_VIRTUAL_TRACE(); 35 DECLARE_VIRTUAL_TRACE();
33 36
34 private: 37 private:
35 Member<OffscreenCanvas> m_offscreenCanvas; 38 Member<OffscreenCanvas> m_offscreenCanvas;
36 }; 39 };
37 40
38 } // namespace blink 41 } // namespace blink
39 42
40 #endif // OffscreenCanvasRenderingContext_h 43 #endif // OffscreenCanvasRenderingContext_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698