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

Side by Side Diff: components/display_compositor/gpu_display_compositor_frame_sink.h

Issue 2683583005: Move display_ From CompositorFrameSinkSupport To GpuDisplayCompositorFrameSink (Closed)
Patch Set: rebase Created 3 years, 10 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 COMPONENTS_DISPLAY_COMPOSITOR_GPU_DISPLAY_COMPOSITOR_FRAME_SINK_H_ 5 #ifndef COMPONENTS_DISPLAY_COMPOSITOR_GPU_DISPLAY_COMPOSITOR_FRAME_SINK_H_
6 #define COMPONENTS_DISPLAY_COMPOSITOR_GPU_DISPLAY_COMPOSITOR_FRAME_SINK_H_ 6 #define COMPONENTS_DISPLAY_COMPOSITOR_GPU_DISPLAY_COMPOSITOR_FRAME_SINK_H_
7 7
8 #include "cc/surfaces/display.h"
9 #include "cc/surfaces/display_client.h"
8 #include "components/display_compositor/gpu_compositor_frame_sink.h" 10 #include "components/display_compositor/gpu_compositor_frame_sink.h"
9 #include "components/display_compositor/gpu_compositor_frame_sink_delegate.h" 11 #include "components/display_compositor/gpu_compositor_frame_sink_delegate.h"
10 #include "mojo/public/cpp/bindings/associated_binding.h" 12 #include "mojo/public/cpp/bindings/associated_binding.h"
11 13
12 namespace display_compositor { 14 namespace display_compositor {
13 15
14 class DISPLAY_COMPOSITOR_EXPORT GpuDisplayCompositorFrameSink 16 class DISPLAY_COMPOSITOR_EXPORT GpuDisplayCompositorFrameSink
15 : public GpuCompositorFrameSink, 17 : public GpuCompositorFrameSink,
16 public NON_EXPORTED_BASE(cc::mojom::DisplayPrivate) { 18 public NON_EXPORTED_BASE(cc::mojom::DisplayPrivate),
19 public NON_EXPORTED_BASE(cc::DisplayClient) {
17 public: 20 public:
18 GpuDisplayCompositorFrameSink( 21 GpuDisplayCompositorFrameSink(
19 GpuCompositorFrameSinkDelegate* delegate, 22 GpuCompositorFrameSinkDelegate* delegate,
20 cc::SurfaceManager* surface_manager, 23 cc::SurfaceManager* surface_manager,
21 const cc::FrameSinkId& frame_sink_id, 24 const cc::FrameSinkId& frame_sink_id,
22 std::unique_ptr<cc::Display> display, 25 std::unique_ptr<cc::Display> display,
23 std::unique_ptr<cc::BeginFrameSource> begin_frame_source, 26 std::unique_ptr<cc::BeginFrameSource> begin_frame_source,
24 cc::mojom::MojoCompositorFrameSinkAssociatedRequest request, 27 cc::mojom::MojoCompositorFrameSinkAssociatedRequest request,
25 cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request, 28 cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request,
26 cc::mojom::MojoCompositorFrameSinkClientPtr client, 29 cc::mojom::MojoCompositorFrameSinkClientPtr client,
27 cc::mojom::DisplayPrivateAssociatedRequest display_private_request); 30 cc::mojom::DisplayPrivateAssociatedRequest display_private_request);
28 31
29 ~GpuDisplayCompositorFrameSink() override; 32 ~GpuDisplayCompositorFrameSink() override;
30 33
31 // cc::mojom::DisplayPrivate: 34 // cc::mojom::DisplayPrivate:
32 void SetDisplayVisible(bool visible) override; 35 void SetDisplayVisible(bool visible) override;
33 void ResizeDisplay(const gfx::Size& size) override; 36 void ResizeDisplay(const gfx::Size& size) override;
34 void SetDisplayColorSpace(const gfx::ColorSpace& color_space) override; 37 void SetDisplayColorSpace(const gfx::ColorSpace& color_space) override;
35 void SetOutputIsSecure(bool secure) override; 38 void SetOutputIsSecure(bool secure) override;
39 void SetLocalSurfaceId(const cc::LocalSurfaceId& local_surface_id,
40 float scale_factor) override;
36 41
37 private: 42 private:
43 // cc::DisplayClient:
44 void DisplayOutputSurfaceLost() override;
45 void DisplayWillDrawAndSwap(bool will_draw_and_swap,
46 const cc::RenderPassList& render_passes) override;
47 void DisplayDidDrawAndSwap() override;
48
38 mojo::AssociatedBinding<cc::mojom::MojoCompositorFrameSink> binding_; 49 mojo::AssociatedBinding<cc::mojom::MojoCompositorFrameSink> binding_;
39 mojo::AssociatedBinding<cc::mojom::DisplayPrivate> display_private_binding_; 50 mojo::AssociatedBinding<cc::mojom::DisplayPrivate> display_private_binding_;
40 51
52 // GpuDisplayCompositorFrameSink holds a Display and its BeginFrameSource if
53 // it created with non-null gpu::SurfaceHandle. In the window server, the
54 // display root window's CompositorFrameSink will have a valid
55 // gpu::SurfaceHandle.
56 std::unique_ptr<cc::BeginFrameSource> display_begin_frame_source_;
57 std::unique_ptr<cc::Display> display_;
58
41 DISALLOW_COPY_AND_ASSIGN(GpuDisplayCompositorFrameSink); 59 DISALLOW_COPY_AND_ASSIGN(GpuDisplayCompositorFrameSink);
42 }; 60 };
43 61
44 } // namespace display_compositor 62 } // namespace display_compositor
45 63
46 #endif // COMPONENTS_DISPLAY_COMPOSITOR_GPU_DISPLAY_COMPOSITOR_FRAME_SINK_H_ 64 #endif // COMPONENTS_DISPLAY_COMPOSITOR_GPU_DISPLAY_COMPOSITOR_FRAME_SINK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698