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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcher.h

Issue 2644653003: Make OffscreenCanvas animation in sync with its placeholder canvas's parent frame rate (Closed)
Patch Set: fix based on fsamuel's feedback Created 3 years, 11 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 OffscreenCanvasFrameDispatcher_h 5 #ifndef OffscreenCanvasFrameDispatcher_h
6 #define OffscreenCanvasFrameDispatcher_h 6 #define OffscreenCanvasFrameDispatcher_h
7 7
8 #include "platform/PlatformExport.h" 8 #include "platform/PlatformExport.h"
9 #include "platform/WebTaskRunner.h" 9 #include "platform/WebTaskRunner.h"
10 #include "wtf/RefPtr.h" 10 #include "wtf/RefPtr.h"
11 #include "wtf/WeakPtr.h" 11 #include "wtf/WeakPtr.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 class StaticBitmapImage; 15 class StaticBitmapImage;
16 16
17 class OffscreenCanvasFrameDispatcherClient { 17 class OffscreenCanvasFrameDispatcherClient {
18 public: 18 public:
19 virtual void beginFrame() = 0; 19 virtual void beginFrame() = 0;
20 }; 20 };
21 21
22 class PLATFORM_EXPORT OffscreenCanvasFrameDispatcher { 22 class PLATFORM_EXPORT OffscreenCanvasFrameDispatcher {
23 public: 23 public:
24 virtual ~OffscreenCanvasFrameDispatcher() {} 24 virtual ~OffscreenCanvasFrameDispatcher() {}
25 virtual void dispatchFrame(RefPtr<StaticBitmapImage>, 25 virtual void dispatchFrame(RefPtr<StaticBitmapImage>,
26 double commitStartTime, 26 double commitStartTime,
27 bool isWebGLSoftwareRendering) = 0; 27 bool isWebGLSoftwareRendering) = 0;
28 virtual void setNeedsBeginFrame(bool doesNeedBeginFrame) = 0;
Justin Novosad 2017/01/19 18:06:49 No need to name the argument here (name adds no in
xlai (Olivia) 2017/01/19 19:14:34 Done.
28 virtual void reclaimResource(unsigned resourceId) = 0; 29 virtual void reclaimResource(unsigned resourceId) = 0;
29 30
30 virtual void reshape(int width, int height) = 0; 31 virtual void reshape(int width, int height) = 0;
31 32
32 WeakPtr<OffscreenCanvasFrameDispatcher> createWeakPtr() { 33 WeakPtr<OffscreenCanvasFrameDispatcher> createWeakPtr() {
33 return m_weakPtrFactory.createWeakPtr(); 34 return m_weakPtrFactory.createWeakPtr();
34 } 35 }
35 36
36 OffscreenCanvasFrameDispatcherClient* client() { return m_client; } 37 OffscreenCanvasFrameDispatcherClient* client() { return m_client; }
37 38
38 protected: 39 protected:
39 OffscreenCanvasFrameDispatcher(OffscreenCanvasFrameDispatcherClient* client) 40 OffscreenCanvasFrameDispatcher(OffscreenCanvasFrameDispatcherClient* client)
40 : m_weakPtrFactory(this), m_client(client) {} 41 : m_weakPtrFactory(this), m_client(client) {}
41 42
42 private: 43 private:
43 WeakPtrFactory<OffscreenCanvasFrameDispatcher> m_weakPtrFactory; 44 WeakPtrFactory<OffscreenCanvasFrameDispatcher> m_weakPtrFactory;
44 OffscreenCanvasFrameDispatcherClient* m_client; 45 OffscreenCanvasFrameDispatcherClient* m_client;
45 }; 46 };
46 47
47 } // namespace blink 48 } // namespace blink
48 49
49 #endif // OffscreenCanvasFrameDispatcher_h 50 #endif // OffscreenCanvasFrameDispatcher_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698