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 "third_party/WebKit/public/platform/modules/offscreencanvas/offscreen_c
anvas_surface.mojom.h" | 10 #include "third_party/WebKit/public/platform/modules/offscreencanvas/offscreen_c
anvas_surface.mojom.h" |
9 | 11 |
10 namespace content { | 12 namespace content { |
11 | 13 |
12 class OffscreenCanvasFrameReceiverImpl | 14 class OffscreenCanvasFrameReceiverImpl |
13 : public blink::mojom::OffscreenCanvasFrameReceiver { | 15 : public blink::mojom::OffscreenCanvasFrameReceiver, |
| 16 public cc::SurfaceFactoryClient { |
14 public: | 17 public: |
15 OffscreenCanvasFrameReceiverImpl(); | 18 OffscreenCanvasFrameReceiverImpl(); |
16 ~OffscreenCanvasFrameReceiverImpl() override; | 19 ~OffscreenCanvasFrameReceiverImpl() override; |
17 | 20 |
18 static void Create(blink::mojom::OffscreenCanvasFrameReceiverRequest request); | 21 static void Create(blink::mojom::OffscreenCanvasFrameReceiverRequest 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: |
| 33 cc::SurfaceId surface_id_; |
| 34 std::unique_ptr<cc::SurfaceFactory> surface_factory_; |
| 35 |
24 DISALLOW_COPY_AND_ASSIGN(OffscreenCanvasFrameReceiverImpl); | 36 DISALLOW_COPY_AND_ASSIGN(OffscreenCanvasFrameReceiverImpl); |
25 }; | 37 }; |
26 | 38 |
27 } // namespace content | 39 } // namespace content |
28 | 40 |
29 #endif // CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_FRAME_RECEIVER_IMPL_H_ | 41 #endif // CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_FRAME_RECEIVER_IMPL_H_ |
OLD | NEW |