| 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/output/begin_frame_args.h" |
| 9 #include "cc/resources/shared_bitmap.h" | 10 #include "cc/resources/shared_bitmap.h" |
| 10 #include "cc/surfaces/surface_id.h" | 11 #include "cc/surfaces/surface_id.h" |
| 11 #include "mojo/public/cpp/bindings/binding.h" | 12 #include "mojo/public/cpp/bindings/binding.h" |
| 12 #include "platform/graphics/OffscreenCanvasFrameDispatcher.h" | 13 #include "platform/graphics/OffscreenCanvasFrameDispatcher.h" |
| 13 #include "platform/graphics/StaticBitmapImage.h" | 14 #include "platform/graphics/StaticBitmapImage.h" |
| 14 #include <memory> | 15 #include <memory> |
| 15 | 16 |
| 16 namespace blink { | 17 namespace blink { |
| 17 | 18 |
| 18 class PLATFORM_EXPORT OffscreenCanvasFrameDispatcherImpl final | 19 class PLATFORM_EXPORT OffscreenCanvasFrameDispatcherImpl final |
| 19 : public OffscreenCanvasFrameDispatcher, | 20 : public OffscreenCanvasFrameDispatcher, |
| 20 WTF_NON_EXPORTED_BASE( | 21 WTF_NON_EXPORTED_BASE( |
| 21 public cc::mojom::blink::MojoCompositorFrameSinkClient) { | 22 public cc::mojom::blink::MojoCompositorFrameSinkClient) { |
| 22 public: | 23 public: |
| 23 OffscreenCanvasFrameDispatcherImpl(uint32_t clientId, | 24 OffscreenCanvasFrameDispatcherImpl(uint32_t clientId, |
| 24 uint32_t sinkId, | 25 uint32_t sinkId, |
| 25 uint32_t localId, | 26 uint32_t localId, |
| 26 uint64_t nonce, | 27 uint64_t nonce, |
| 27 int width, | 28 int width, |
| 28 int height); | 29 int height); |
| 29 | 30 |
| 30 // OffscreenCanvasFrameDispatcher implementation. | 31 // OffscreenCanvasFrameDispatcher implementation. |
| 31 ~OffscreenCanvasFrameDispatcherImpl() override {} | 32 ~OffscreenCanvasFrameDispatcherImpl() override {} |
| 32 void dispatchFrame(RefPtr<StaticBitmapImage>, | 33 void dispatchFrame(RefPtr<StaticBitmapImage>, |
| 33 double commitStartTime, | 34 double commitStartTime, |
| 34 bool isWebGLSoftwareRendering = false) override; | 35 bool isWebGLSoftwareRendering = false) override; |
| 35 | 36 |
| 36 // cc::mojom::blink::MojoCompositorFrameSinkClient implementation. | 37 // cc::mojom::blink::MojoCompositorFrameSinkClient implementation. |
| 37 void DidReceiveCompositorFrameAck() override; | 38 void DidReceiveCompositorFrameAck() override; |
| 39 void OnBeginFrame(const cc::BeginFrameArgs&) override; |
| 38 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; | 40 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; |
| 39 | 41 |
| 40 // This enum is used in histogram, so it should be append-only. | 42 // This enum is used in histogram, so it should be append-only. |
| 41 enum OffscreenCanvasCommitType { | 43 enum OffscreenCanvasCommitType { |
| 42 CommitGPUCanvasGPUCompositing = 0, | 44 CommitGPUCanvasGPUCompositing = 0, |
| 43 CommitGPUCanvasSoftwareCompositing = 1, | 45 CommitGPUCanvasSoftwareCompositing = 1, |
| 44 CommitSoftwareCanvasGPUCompositing = 2, | 46 CommitSoftwareCanvasGPUCompositing = 2, |
| 45 CommitSoftwareCanvasSoftwareCompositing = 3, | 47 CommitSoftwareCanvasSoftwareCompositing = 3, |
| 46 OffscreenCanvasCommitTypeCount, | 48 OffscreenCanvasCommitTypeCount, |
| 47 }; | 49 }; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 65 RefPtr<StaticBitmapImage>); | 67 RefPtr<StaticBitmapImage>); |
| 66 void setTransferableResourceToSharedGPUContext(cc::TransferableResource&, | 68 void setTransferableResourceToSharedGPUContext(cc::TransferableResource&, |
| 67 RefPtr<StaticBitmapImage>); | 69 RefPtr<StaticBitmapImage>); |
| 68 void setTransferableResourceToStaticBitmapImage(cc::TransferableResource&, | 70 void setTransferableResourceToStaticBitmapImage(cc::TransferableResource&, |
| 69 RefPtr<StaticBitmapImage>); | 71 RefPtr<StaticBitmapImage>); |
| 70 }; | 72 }; |
| 71 | 73 |
| 72 } // namespace blink | 74 } // namespace blink |
| 73 | 75 |
| 74 #endif // OffscreenCanvasFrameDispatcherImpl_h | 76 #endif // OffscreenCanvasFrameDispatcherImpl_h |
| OLD | NEW |