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 OffscreenCanvasFrameDispatcherImpl_h | 5 #ifndef OffscreenCanvasFrameDispatcherImpl_h |
6 #define OffscreenCanvasFrameDispatcherImpl_h | 6 #define OffscreenCanvasFrameDispatcherImpl_h |
7 | 7 |
| 8 #include "cc/ipc/mojo_compositor_frame_sink.mojom-blink.h" |
8 #include "cc/surfaces/surface_id.h" | 9 #include "cc/surfaces/surface_id.h" |
| 10 #include "mojo/public/cpp/bindings/binding.h" |
9 #include "platform/graphics/OffscreenCanvasFrameDispatcher.h" | 11 #include "platform/graphics/OffscreenCanvasFrameDispatcher.h" |
10 #include "public/platform/modules/offscreencanvas/offscreen_canvas_surface.mojom
-blink.h" | 12 #include "platform/graphics/StaticBitmapImage.h" |
| 13 #include "wtf/Compiler.h" |
11 #include <memory> | 14 #include <memory> |
12 | 15 |
13 namespace blink { | 16 namespace blink { |
14 | 17 |
15 class PLATFORM_EXPORT OffscreenCanvasFrameDispatcherImpl final : public Offscree
nCanvasFrameDispatcher { | 18 class PLATFORM_EXPORT OffscreenCanvasFrameDispatcherImpl final : public Offscree
nCanvasFrameDispatcher |
| 19 , WTF_NON_EXPORTED_BASE(public cc::mojom::blink::MojoCompositorFrameSinkClie
nt) { |
16 public: | 20 public: |
17 explicit OffscreenCanvasFrameDispatcherImpl(uint32_t clientId, uint32_t loca
lId, uint64_t nonce, int width, int height); | 21 explicit OffscreenCanvasFrameDispatcherImpl(uint32_t clientId, uint32_t loca
lId, uint64_t nonce, int width, int height); |
18 | 22 |
19 // OffscreenCanvasFrameDispatcher implementation. | 23 // OffscreenCanvasFrameDispatcher implementation. |
20 ~OffscreenCanvasFrameDispatcherImpl() override {} | 24 ~OffscreenCanvasFrameDispatcherImpl() override {} |
21 void dispatchFrame() override; | 25 void dispatchFrame(RefPtr<StaticBitmapImage>) override; |
| 26 |
| 27 // OffscreenCanvasFrameReceiverClient implementation. |
| 28 void ReturnResources(Vector<cc::mojom::blink::ReturnedResourcePtr> resources
) override; |
22 | 29 |
23 private: | 30 private: |
24 const cc::SurfaceId m_surfaceId; | 31 const cc::SurfaceId m_surfaceId; |
25 const int m_width; | 32 const int m_width; |
26 const int m_height; | 33 const int m_height; |
27 mojom::blink::OffscreenCanvasFrameReceiverPtr m_service; | 34 cc::mojom::blink::MojoCompositorFrameSinkPtr m_sink; |
| 35 |
| 36 HashMap<unsigned, RefPtr<StaticBitmapImage>> m_cachedImages; |
| 37 mojo::Binding<cc::mojom::blink::MojoCompositorFrameSinkClient> m_binding; |
28 }; | 38 }; |
29 | 39 |
30 } // namespace blink | 40 } // namespace blink |
31 | 41 |
32 #endif // OffscreenCanvasFrameDispatcherImpl_h | 42 #endif // OffscreenCanvasFrameDispatcherImpl_h |
OLD | NEW |