| 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 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 "wtf/RefPtr.h" | 9 #include "wtf/RefPtr.h" |
| 10 #include "wtf/WeakPtr.h" | 10 #include "wtf/WeakPtr.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class StaticBitmapImage; | 14 class StaticBitmapImage; |
| 15 | 15 |
| 16 class PLATFORM_EXPORT OffscreenCanvasFrameDispatcher { | 16 class PLATFORM_EXPORT OffscreenCanvasFrameDispatcher { |
| 17 public: | 17 public: |
| 18 OffscreenCanvasFrameDispatcher() : m_weakPtrFactory(this) {} | 18 OffscreenCanvasFrameDispatcher() : m_weakPtrFactory(this) {} |
| 19 virtual ~OffscreenCanvasFrameDispatcher() {} | 19 virtual ~OffscreenCanvasFrameDispatcher() {} |
| 20 virtual void dispatchFrame(RefPtr<StaticBitmapImage>, | 20 virtual void dispatchFrame(RefPtr<StaticBitmapImage>, |
| 21 double commitStartTime, | 21 double commitStartTime, |
| 22 bool isWebGLSoftwareRendering = false) = 0; | 22 bool isWebGLSoftwareRendering = false) = 0; |
| 23 virtual void reclaimResource(unsigned resourceId) = 0; | 23 virtual void reclaimResource(unsigned resourceId) = 0; |
| 24 | 24 |
| 25 virtual void reshape(unsigned width, unsigned height) = 0; |
| 26 |
| 25 WeakPtr<OffscreenCanvasFrameDispatcher> createWeakPtr() { | 27 WeakPtr<OffscreenCanvasFrameDispatcher> createWeakPtr() { |
| 26 return m_weakPtrFactory.createWeakPtr(); | 28 return m_weakPtrFactory.createWeakPtr(); |
| 27 } | 29 } |
| 28 | 30 |
| 29 private: | 31 private: |
| 30 WeakPtrFactory<OffscreenCanvasFrameDispatcher> m_weakPtrFactory; | 32 WeakPtrFactory<OffscreenCanvasFrameDispatcher> m_weakPtrFactory; |
| 31 }; | 33 }; |
| 32 | 34 |
| 33 } // namespace blink | 35 } // namespace blink |
| 34 | 36 |
| 35 #endif // OffscreenCanvasFrameDispatcher_h | 37 #endif // OffscreenCanvasFrameDispatcher_h |
| OLD | NEW |