| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_DISPLAY_COMPOSITOR_GPU_DISPLAY_COMPOSITOR_FRAME_SINK_H_ | |
| 6 #define COMPONENTS_DISPLAY_COMPOSITOR_GPU_DISPLAY_COMPOSITOR_FRAME_SINK_H_ | |
| 7 | |
| 8 #include "cc/surfaces/display.h" | |
| 9 #include "cc/surfaces/display_client.h" | |
| 10 #include "components/display_compositor/gpu_compositor_frame_sink.h" | |
| 11 #include "components/display_compositor/gpu_compositor_frame_sink_delegate.h" | |
| 12 #include "mojo/public/cpp/bindings/associated_binding.h" | |
| 13 | |
| 14 namespace display_compositor { | |
| 15 | |
| 16 class DISPLAY_COMPOSITOR_EXPORT GpuDisplayCompositorFrameSink | |
| 17 : public GpuCompositorFrameSink, | |
| 18 public NON_EXPORTED_BASE(cc::mojom::DisplayPrivate), | |
| 19 public NON_EXPORTED_BASE(cc::DisplayClient) { | |
| 20 public: | |
| 21 GpuDisplayCompositorFrameSink( | |
| 22 GpuCompositorFrameSinkDelegate* delegate, | |
| 23 cc::SurfaceManager* surface_manager, | |
| 24 const cc::FrameSinkId& frame_sink_id, | |
| 25 std::unique_ptr<cc::Display> display, | |
| 26 std::unique_ptr<cc::BeginFrameSource> begin_frame_source, | |
| 27 cc::mojom::MojoCompositorFrameSinkAssociatedRequest request, | |
| 28 cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request, | |
| 29 cc::mojom::MojoCompositorFrameSinkClientPtr client, | |
| 30 cc::mojom::DisplayPrivateAssociatedRequest display_private_request); | |
| 31 | |
| 32 ~GpuDisplayCompositorFrameSink() override; | |
| 33 | |
| 34 // cc::mojom::DisplayPrivate: | |
| 35 void SetDisplayVisible(bool visible) override; | |
| 36 void ResizeDisplay(const gfx::Size& size) override; | |
| 37 void SetDisplayColorSpace(const gfx::ColorSpace& color_space) override; | |
| 38 void SetOutputIsSecure(bool secure) override; | |
| 39 void SetLocalSurfaceId(const cc::LocalSurfaceId& local_surface_id, | |
| 40 float scale_factor) override; | |
| 41 | |
| 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 | |
| 49 mojo::AssociatedBinding<cc::mojom::MojoCompositorFrameSink> binding_; | |
| 50 mojo::AssociatedBinding<cc::mojom::DisplayPrivate> display_private_binding_; | |
| 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 | |
| 59 DISALLOW_COPY_AND_ASSIGN(GpuDisplayCompositorFrameSink); | |
| 60 }; | |
| 61 | |
| 62 } // namespace display_compositor | |
| 63 | |
| 64 #endif // COMPONENTS_DISPLAY_COMPOSITOR_GPU_DISPLAY_COMPOSITOR_FRAME_SINK_H_ | |
| OLD | NEW |