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

Side by Side Diff: third_party/WebKit/Source/core/html/canvas/CanvasRenderingContextHost.h

Issue 2849463005: Refactor ImageBuffer to make OffscreenCanvas match HTMLCanvasElement (Closed)
Patch Set: x Created 3 years, 7 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 CanvasRenderingContextHost_h 5 #ifndef CanvasRenderingContextHost_h
6 #define CanvasRenderingContextHost_h 6 #define CanvasRenderingContextHost_h
7 7
8 #include "bindings/core/v8/ExceptionState.h" 8 #include "bindings/core/v8/ExceptionState.h"
9 #include "bindings/core/v8/ScriptPromise.h" 9 #include "bindings/core/v8/ScriptPromise.h"
10 #include "bindings/core/v8/ScriptState.h" 10 #include "bindings/core/v8/ScriptState.h"
11 #include "core/CoreExport.h" 11 #include "core/CoreExport.h"
12 #include "core/events/EventDispatcher.h" 12 #include "core/events/EventDispatcher.h"
13 #include "core/events/EventTarget.h" 13 #include "core/events/EventTarget.h"
14 #include "platform/geometry/FloatRect.h" 14 #include "platform/geometry/FloatRect.h"
15 #include "platform/geometry/IntSize.h" 15 #include "platform/geometry/IntSize.h"
16 #include "platform/graphics/ImageBuffer.h"
16 #include "platform/heap/GarbageCollected.h" 17 #include "platform/heap/GarbageCollected.h"
17 18
18 namespace blink { 19 namespace blink {
19 20
20 class StaticBitmapImage; 21 class StaticBitmapImage;
21 class KURL; 22 class KURL;
22 23
23 class CORE_EXPORT CanvasRenderingContextHost : public GarbageCollectedMixin { 24 class CORE_EXPORT CanvasRenderingContextHost : public GarbageCollectedMixin {
24 public: 25 public:
25 CanvasRenderingContextHost(); 26 CanvasRenderingContextHost();
(...skipping 11 matching lines...) Expand all
37 38
38 virtual ExecutionContext* GetTopExecutionContext() const = 0; 39 virtual ExecutionContext* GetTopExecutionContext() const = 0;
39 virtual DispatchEventResult HostDispatchEvent(Event*) = 0; 40 virtual DispatchEventResult HostDispatchEvent(Event*) = 0;
40 virtual const KURL& GetExecutionContextUrl() const = 0; 41 virtual const KURL& GetExecutionContextUrl() const = 0;
41 42
42 virtual ScriptPromise Commit(RefPtr<StaticBitmapImage>, 43 virtual ScriptPromise Commit(RefPtr<StaticBitmapImage>,
43 bool is_web_gl_software_rendering, 44 bool is_web_gl_software_rendering,
44 ScriptState*, 45 ScriptState*,
45 ExceptionState&); 46 ExceptionState&);
46 47
48 virtual void DiscardImageBuffer() = 0;
49 virtual ImageBuffer* GetImageBuffer() const = 0;
50 virtual ImageBuffer* GetOrCreateImageBuffer() = 0;
51
47 // TODO(fserb): remove this. 52 // TODO(fserb): remove this.
48 virtual bool IsOffscreenCanvas() const { return false; } 53 virtual bool IsOffscreenCanvas() const { return false; }
49 54
50 protected: 55 protected:
51 virtual ~CanvasRenderingContextHost() {} 56 virtual ~CanvasRenderingContextHost() {}
52 }; 57 };
53 58
54 } // namespace blink 59 } // namespace blink
55 60
56 #endif // CanvasRenderingContextHost_h 61 #endif // CanvasRenderingContextHost_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698