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_SURFACE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_IMPL_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_IMPL_H_ |
7 | 7 |
8 #include "cc/surfaces/surface_factory.h" | |
9 #include "cc/surfaces/surface_factory_client.h" | |
10 #include "cc/surfaces/surface_id.h" | 8 #include "cc/surfaces/surface_id.h" |
11 #include "cc/surfaces/surface_id_allocator.h" | 9 #include "cc/surfaces/surface_id_allocator.h" |
12 #include "mojo/public/cpp/bindings/interface_request.h" | 10 #include "mojo/public/cpp/bindings/interface_request.h" |
13 #include "mojo/public/cpp/bindings/string.h" | 11 #include "mojo/public/cpp/bindings/string.h" |
14 #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" |
15 | 13 |
16 namespace content { | 14 namespace content { |
17 | 15 |
18 class OffscreenCanvasSurfaceImpl : public blink::mojom::OffscreenCanvasSurface, | 16 class OffscreenCanvasSurfaceImpl : public blink::mojom::OffscreenCanvasSurface { |
19 public cc::SurfaceFactoryClient { | |
20 public: | 17 public: |
21 OffscreenCanvasSurfaceImpl(); | 18 OffscreenCanvasSurfaceImpl(); |
22 ~OffscreenCanvasSurfaceImpl() override; | 19 ~OffscreenCanvasSurfaceImpl() override; |
23 | 20 |
24 static void Create(blink::mojom::OffscreenCanvasSurfaceRequest request); | 21 static void Create(blink::mojom::OffscreenCanvasSurfaceRequest request); |
25 | 22 |
26 // blink::mojom::OffscreenCanvasSurface implementation. | 23 // blink::mojom::OffscreenCanvasSurface implementation. |
27 void GetSurfaceId(const GetSurfaceIdCallback& callback) override; | 24 void GetSurfaceId(const GetSurfaceIdCallback& callback) override; |
28 void RequestSurfaceCreation(const cc::SurfaceId& surface_id) override; | |
29 void Require(const cc::SurfaceId& surface_id, | 25 void Require(const cc::SurfaceId& surface_id, |
30 const cc::SurfaceSequence& sequence) override; | 26 const cc::SurfaceSequence& sequence) override; |
31 void Satisfy(const cc::SurfaceSequence& sequence) override; | 27 void Satisfy(const cc::SurfaceSequence& sequence) override; |
32 | 28 |
33 // cc::SurfaceFactoryClient implementation. | |
34 void ReturnResources(const cc::ReturnedResourceArray& resources) override; | |
35 void WillDrawSurface(const cc::SurfaceId& id, | |
36 const gfx::Rect& damage_rect) override; | |
37 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override; | |
38 | |
39 private: | 29 private: |
40 // Surface-related state | 30 // Surface-related state |
41 std::unique_ptr<cc::SurfaceIdAllocator> id_allocator_; | 31 std::unique_ptr<cc::SurfaceIdAllocator> id_allocator_; |
42 cc::SurfaceId surface_id_; | 32 cc::SurfaceId surface_id_; |
43 std::unique_ptr<cc::SurfaceFactory> surface_factory_; | |
44 | 33 |
45 DISALLOW_COPY_AND_ASSIGN(OffscreenCanvasSurfaceImpl); | 34 DISALLOW_COPY_AND_ASSIGN(OffscreenCanvasSurfaceImpl); |
46 }; | 35 }; |
47 | 36 |
48 } // namespace content | 37 } // namespace content |
49 | 38 |
50 #endif // CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_IMPL_H_ | 39 #endif // CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_IMPL_H_ |
OLD | NEW |