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

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

Issue 1836283002: Implement HTMLCanvasElement's transferControlToOffscreen (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update interface layout tests result Created 4 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 OffscreenCanvas_h 5 #ifndef OffscreenCanvas_h
6 #define OffscreenCanvas_h 6 #define OffscreenCanvas_h
7 7
8 #include "bindings/core/v8/ScriptPromise.h" 8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/ScriptState.h" 9 #include "bindings/core/v8/ScriptState.h"
10 #include "bindings/core/v8/ScriptWrappable.h" 10 #include "bindings/core/v8/ScriptWrappable.h"
11 #include "core/html/HTMLCanvasElement.h"
11 #include "modules/ModulesExport.h" 12 #include "modules/ModulesExport.h"
12 #include "platform/geometry/IntSize.h" 13 #include "platform/geometry/IntSize.h"
13 #include "platform/heap/Handle.h" 14 #include "platform/heap/Handle.h"
14 15
15 namespace blink { 16 namespace blink {
16 17
17 class CanvasContextCreationAttributes; 18 class CanvasContextCreationAttributes;
18 class ImageBitmap; 19 class ImageBitmap;
19 class OffscreenCanvasRenderingContext; 20 class OffscreenCanvasRenderingContext;
20 class OffscreenCanvasRenderingContext2D; 21 class OffscreenCanvasRenderingContext2D;
(...skipping 10 matching lines...) Expand all
31 unsigned height() const { return m_size.height(); } 32 unsigned height() const { return m_size.height(); }
32 void setWidth(unsigned); 33 void setWidth(unsigned);
33 void setHeight(unsigned); 34 void setHeight(unsigned);
34 35
35 // API Methods 36 // API Methods
36 OffscreenCanvasRenderingContext2D* getContext(const String&, const CanvasCon textCreationAttributes&); 37 OffscreenCanvasRenderingContext2D* getContext(const String&, const CanvasCon textCreationAttributes&);
37 PassRefPtrWillBeRawPtr<ImageBitmap> transferToImageBitmap(ExceptionState&); 38 PassRefPtrWillBeRawPtr<ImageBitmap> transferToImageBitmap(ExceptionState&);
38 39
39 IntSize size() const { return m_size; } 40 IntSize size() const { return m_size; }
40 OffscreenCanvasRenderingContext2D* renderingContext() const; 41 OffscreenCanvasRenderingContext2D* renderingContext() const;
42 void setAssociatedCanvas(HTMLCanvasElement* canvas) { m_canvas = canvas; }
43 HTMLCanvasElement* getAssociatedCanvas() const { return m_canvas; }
41 44
42 static void registerRenderingContextFactory(PassOwnPtr<OffscreenCanvasRender ingContextFactory>); 45 static void registerRenderingContextFactory(PassOwnPtr<OffscreenCanvasRender ingContextFactory>);
43 46
44 DECLARE_VIRTUAL_TRACE(); 47 DECLARE_VIRTUAL_TRACE();
45 48
46 private: 49 private:
47 OffscreenCanvas(const IntSize&); 50 OffscreenCanvas(const IntSize&);
48 51
49 using ContextFactoryVector = Vector<OwnPtr<OffscreenCanvasRenderingContextFa ctory>>; 52 using ContextFactoryVector = Vector<OwnPtr<OffscreenCanvasRenderingContextFa ctory>>;
50 static ContextFactoryVector& renderingContextFactories(); 53 static ContextFactoryVector& renderingContextFactories();
51 static OffscreenCanvasRenderingContextFactory* getRenderingContextFactory(in t); 54 static OffscreenCanvasRenderingContextFactory* getRenderingContextFactory(in t);
52 55
53 Member<OffscreenCanvasRenderingContext> m_context; 56 Member<OffscreenCanvasRenderingContext> m_context;
57 WeakMember<HTMLCanvasElement> m_canvas;
54 IntSize m_size; 58 IntSize m_size;
55 }; 59 };
56 60
57 } // namespace blink 61 } // namespace blink
58 62
59 #endif // OffscreenCanvas_h 63 #endif // OffscreenCanvas_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/modules.gypi ('k') | third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698