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/ipc/mojo_compositor_frame_sink.mojom-blink.h" |
9 #include "cc/surfaces/surface_id.h" | 9 #include "cc/surfaces/surface_id.h" |
10 #include "mojo/public/cpp/bindings/binding.h" | 10 #include "mojo/public/cpp/bindings/binding.h" |
11 #include "platform/graphics/OffscreenCanvasFrameDispatcher.h" | 11 #include "platform/graphics/OffscreenCanvasFrameDispatcher.h" |
12 #include "platform/graphics/StaticBitmapImage.h" | 12 #include "platform/graphics/StaticBitmapImage.h" |
13 #include "wtf/Compiler.h" | 13 #include "wtf/Compiler.h" |
14 #include <memory> | 14 #include <memory> |
15 | 15 |
16 namespace blink { | 16 namespace blink { |
17 | 17 |
18 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) { | 19 , WTF_NON_EXPORTED_BASE(public cc::mojom::blink::MojoCompositorFrameSinkClie
nt) { |
20 public: | 20 public: |
21 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 nonceHigh, uint64_t nonceLow, int width, int height); |
22 | 22 |
23 // OffscreenCanvasFrameDispatcher implementation. | 23 // OffscreenCanvasFrameDispatcher implementation. |
24 ~OffscreenCanvasFrameDispatcherImpl() override {} | 24 ~OffscreenCanvasFrameDispatcherImpl() override {} |
25 void dispatchFrame(RefPtr<StaticBitmapImage>) override; | 25 void dispatchFrame(RefPtr<StaticBitmapImage>) override; |
26 | 26 |
27 // cc::mojom::blink::MojoCompositorFrameSinkClient implementation. | 27 // cc::mojom::blink::MojoCompositorFrameSinkClient implementation. |
28 void ReturnResources(Vector<cc::mojom::blink::ReturnedResourcePtr> resources
) override; | 28 void ReturnResources(Vector<cc::mojom::blink::ReturnedResourcePtr> resources
) override; |
29 | 29 |
30 private: | 30 private: |
31 const cc::SurfaceId m_surfaceId; | 31 const cc::SurfaceId m_surfaceId; |
32 const int m_width; | 32 const int m_width; |
33 const int m_height; | 33 const int m_height; |
34 | 34 |
35 unsigned m_nextResourceId; | 35 unsigned m_nextResourceId; |
36 HashMap<unsigned, RefPtr<StaticBitmapImage>> m_cachedImages; | 36 HashMap<unsigned, RefPtr<StaticBitmapImage>> m_cachedImages; |
37 | 37 |
38 bool verifyImageSize(const sk_sp<SkImage>&); | 38 bool verifyImageSize(const sk_sp<SkImage>&); |
39 | 39 |
40 cc::mojom::blink::MojoCompositorFrameSinkPtr m_sink; | 40 cc::mojom::blink::MojoCompositorFrameSinkPtr m_sink; |
41 mojo::Binding<cc::mojom::blink::MojoCompositorFrameSinkClient> m_binding; | 41 mojo::Binding<cc::mojom::blink::MojoCompositorFrameSinkClient> m_binding; |
42 }; | 42 }; |
43 | 43 |
44 } // namespace blink | 44 } // namespace blink |
45 | 45 |
46 #endif // OffscreenCanvasFrameDispatcherImpl_h | 46 #endif // OffscreenCanvasFrameDispatcherImpl_h |
OLD | NEW |