Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Side by Side Diff: content/browser/renderer_host/offscreen_canvas_surface_impl.h

Issue 2789753002: Convert offscreen canvas to use FrameSinkManagerHost. (Closed)
Patch Set: Lower similarity. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/ipc/display_compositor.mojom.h" 8 #include "cc/ipc/display_compositor.mojom.h"
9 #include "cc/surfaces/surface_id.h" 9 #include "cc/surfaces/surface_id.h"
10 #include "mojo/public/cpp/bindings/interface_request.h" 10 #include "mojo/public/cpp/bindings/interface_request.h"
11 #include "mojo/public/cpp/bindings/strong_binding.h" 11 #include "mojo/public/cpp/bindings/strong_binding.h"
12 #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"
13 13
14 namespace content { 14 namespace content {
15 15
16 class CONTENT_EXPORT OffscreenCanvasSurfaceImpl 16 class CONTENT_EXPORT OffscreenCanvasSurfaceImpl
17 : public blink::mojom::OffscreenCanvasSurface { 17 : public blink::mojom::OffscreenCanvasSurface {
18 public: 18 public:
19 OffscreenCanvasSurfaceImpl(const cc::FrameSinkId& parent_frame_sink_id, 19 OffscreenCanvasSurfaceImpl(const cc::FrameSinkId& parent_frame_sink_id,
20 const cc::FrameSinkId& frame_sink_id, 20 const cc::FrameSinkId& frame_sink_id,
21 cc::mojom::DisplayCompositorClientPtr client); 21 cc::mojom::DisplayCompositorClientPtr client);
22 ~OffscreenCanvasSurfaceImpl() override; 22 ~OffscreenCanvasSurfaceImpl() override;
23 23
24 static void Create(const cc::FrameSinkId& parent_frame_sink_id, 24 static void Create(const cc::FrameSinkId& parent_frame_sink_id,
25 const cc::FrameSinkId& frame_sink_id, 25 const cc::FrameSinkId& frame_sink_id,
26 cc::mojom::DisplayCompositorClientPtr client, 26 cc::mojom::DisplayCompositorClientPtr client,
27 blink::mojom::OffscreenCanvasSurfaceRequest request); 27 blink::mojom::OffscreenCanvasSurfaceRequest request);
28 28
29 void CreateCompositorFrameSink(
30 cc::mojom::MojoCompositorFrameSinkClientPtr client,
31 cc::mojom::MojoCompositorFrameSinkRequest request);
32
29 void OnSurfaceCreated(const cc::SurfaceInfo& surface_info); 33 void OnSurfaceCreated(const cc::SurfaceInfo& surface_info);
30 34
31 // blink::mojom::OffscreenCanvasSurface implementation. 35 // blink::mojom::OffscreenCanvasSurface implementation.
32 void Require(const cc::SurfaceId& surface_id, 36 void Require(const cc::SurfaceId& surface_id,
33 const cc::SurfaceSequence& sequence) override; 37 const cc::SurfaceSequence& sequence) override;
34 void Satisfy(const cc::SurfaceSequence& sequence) override; 38 void Satisfy(const cc::SurfaceSequence& sequence) override;
35 39
36 const cc::FrameSinkId& frame_sink_id() const { return frame_sink_id_; } 40 const cc::FrameSinkId& frame_sink_id() const { return frame_sink_id_; }
37 41
38 const cc::FrameSinkId& parent_frame_sink_id() const { 42 const cc::FrameSinkId& parent_frame_sink_id() const {
39 return parent_frame_sink_id_; 43 return parent_frame_sink_id_;
40 } 44 }
41 45
42 const cc::LocalSurfaceId& current_local_surface_id() const { 46 const cc::LocalSurfaceId& current_local_surface_id() const {
43 return current_local_surface_id_; 47 return current_local_surface_id_;
44 } 48 }
45 49
46 private: 50 private:
47 cc::mojom::DisplayCompositorClientPtr client_; 51 cc::mojom::DisplayCompositorClientPtr client_;
48 mojo::StrongBindingPtr<blink::mojom::OffscreenCanvasSurface> binding_; 52 mojo::StrongBindingPtr<blink::mojom::OffscreenCanvasSurface> binding_;
49 53
54 cc::mojom::MojoCompositorFrameSinkPrivatePtr compositor_frame_sink_private_;
55
50 // Surface-related state 56 // Surface-related state
51 const cc::FrameSinkId frame_sink_id_; 57 const cc::FrameSinkId frame_sink_id_;
52 cc::LocalSurfaceId current_local_surface_id_; 58 cc::LocalSurfaceId current_local_surface_id_;
53 const cc::FrameSinkId parent_frame_sink_id_; 59 const cc::FrameSinkId parent_frame_sink_id_;
54 60
61 bool has_registered_frame_sink_hierarchy_ = false;
62
55 DISALLOW_COPY_AND_ASSIGN(OffscreenCanvasSurfaceImpl); 63 DISALLOW_COPY_AND_ASSIGN(OffscreenCanvasSurfaceImpl);
56 }; 64 };
57 65
58 } // namespace content 66 } // namespace content
59 67
60 #endif // CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_IMPL_H_ 68 #endif // CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698