| 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 CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_FRAME_RECEIVER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_FRAME_RECEIVER_IMPL_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_FRAME_RECEIVER_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_FRAME_RECEIVER_IMPL_H_ |
| 7 | 7 |
| 8 #include "cc/surfaces/surface_factory.h" |
| 9 #include "cc/surfaces/surface_factory_client.h" |
| 8 #include "mojo/public/cpp/bindings/interface_request.h" | 10 #include "mojo/public/cpp/bindings/interface_request.h" |
| 9 #include "mojo/public/cpp/bindings/strong_binding.h" | 11 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 10 #include "third_party/WebKit/public/platform/modules/offscreencanvas/offscreen_c
anvas_surface.mojom.h" | 12 #include "third_party/WebKit/public/platform/modules/offscreencanvas/offscreen_c
anvas_surface.mojom.h" |
| 11 | 13 |
| 12 namespace content { | 14 namespace content { |
| 13 | 15 |
| 14 class OffscreenCanvasFrameReceiverImpl | 16 class OffscreenCanvasFrameReceiverImpl |
| 15 : public blink::mojom::OffscreenCanvasFrameReceiver { | 17 : public blink::mojom::OffscreenCanvasFrameReceiver, |
| 18 public cc::SurfaceFactoryClient { |
| 16 public: | 19 public: |
| 17 static void Create(mojo::InterfaceRequest< | 20 static void Create(mojo::InterfaceRequest< |
| 18 blink::mojom::OffscreenCanvasFrameReceiver> request); | 21 blink::mojom::OffscreenCanvasFrameReceiver> request); |
| 19 | 22 |
| 20 void SubmitCompositorFrame(const cc::SurfaceId& surface_id, | 23 void SubmitCompositorFrame(const cc::SurfaceId& surface_id, |
| 21 cc::CompositorFrame frame) override; | 24 cc::CompositorFrame frame) override; |
| 22 | 25 |
| 26 // cc::SurfaceFactoryClient implementation. |
| 27 void ReturnResources(const cc::ReturnedResourceArray& resources) override; |
| 28 void WillDrawSurface(const cc::SurfaceId& id, |
| 29 const gfx::Rect& damage_rect) override; |
| 30 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override; |
| 31 |
| 23 private: | 32 private: |
| 24 ~OffscreenCanvasFrameReceiverImpl() override; | 33 ~OffscreenCanvasFrameReceiverImpl() override; |
| 25 explicit OffscreenCanvasFrameReceiverImpl( | 34 explicit OffscreenCanvasFrameReceiverImpl( |
| 26 mojo::InterfaceRequest<blink::mojom::OffscreenCanvasFrameReceiver> | 35 mojo::InterfaceRequest<blink::mojom::OffscreenCanvasFrameReceiver> |
| 27 request); | 36 request); |
| 28 | 37 |
| 38 cc::SurfaceId surface_id_; |
| 39 std::unique_ptr<cc::SurfaceFactory> surface_factory_; |
| 29 mojo::StrongBinding<blink::mojom::OffscreenCanvasFrameReceiver> binding_; | 40 mojo::StrongBinding<blink::mojom::OffscreenCanvasFrameReceiver> binding_; |
| 30 | 41 |
| 31 DISALLOW_COPY_AND_ASSIGN(OffscreenCanvasFrameReceiverImpl); | 42 DISALLOW_COPY_AND_ASSIGN(OffscreenCanvasFrameReceiverImpl); |
| 32 }; | 43 }; |
| 33 | 44 |
| 34 } // namespace content | 45 } // namespace content |
| 35 | 46 |
| 36 #endif // CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_FRAME_RECEIVER_IMPL_H_ | 47 #endif // CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_FRAME_RECEIVER_IMPL_H_ |
| OLD | NEW |