Chromium Code Reviews| Index: services/ui/public/cpp/display_client_compositor_frame_sink.h |
| diff --git a/services/ui/public/cpp/display_client_compositor_frame_sink.h b/services/ui/public/cpp/display_client_compositor_frame_sink.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a462bf03125d050fb4a26065931c6aed31d315d6 |
| --- /dev/null |
| +++ b/services/ui/public/cpp/display_client_compositor_frame_sink.h |
| @@ -0,0 +1,75 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef SERVICES_UI_PUBLIC_CPP_DISPLAY_CLIENT_COMPOSITOR_FRAME_SINK_H_ |
| +#define SERVICES_UI_PUBLIC_CPP_DISPLAY_CLIENT_COMPOSITOR_FRAME_SINK_H_ |
| + |
| +#include "cc/ipc/display_compositor.mojom.h" |
| +#include "cc/ipc/mojo_compositor_frame_sink.mojom.h" |
| +#include "cc/output/compositor_frame_sink.h" |
| +#include "cc/scheduler/begin_frame_source.h" |
| +#include "cc/surfaces/local_surface_id.h" |
| +#include "cc/surfaces/local_surface_id_allocator.h" |
| +#include "mojo/public/cpp/bindings/binding.h" |
| +#include "ui/gfx/geometry/rect.h" |
| +#include "ui/gfx/native_widget_types.h" |
| + |
| +namespace base { |
| +class ThreadChecker; |
| +} // namespace base |
| + |
| +namespace ui { |
| + |
| +class DisplayClientCompositorFrameSink |
|
Fady Samuel
2017/03/09 18:50:10
Put this in the window server: services/ui/ws as t
Alex Z.
2017/03/09 18:56:08
Done.
|
| + : public cc::CompositorFrameSink, |
| + public cc::mojom::MojoCompositorFrameSinkClient, |
| + public cc::ExternalBeginFrameSourceClient { |
| + public: |
| + DisplayClientCompositorFrameSink( |
| + const cc::FrameSinkId& frame_sink_id, |
| + cc::mojom::MojoCompositorFrameSinkAssociatedPtrInfo |
| + compositor_frame_sink_info, |
| + cc::mojom::DisplayPrivateAssociatedPtrInfo display_private_info, |
| + cc::mojom::MojoCompositorFrameSinkClientRequest client_request); |
| + |
| + ~DisplayClientCompositorFrameSink() override; |
| + |
| + // cc::CompositorFrameSink implementation. |
| + bool BindToClient(cc::CompositorFrameSinkClient* client) override; |
| + void DetachFromClient() override; |
| + void SubmitCompositorFrame(cc::CompositorFrame frame) override; |
| + |
| + private: |
| + // cc::mojom::MojoCompositorFrameSinkClient implementation: |
| + void DidReceiveCompositorFrameAck() override; |
| + void OnBeginFrame(const cc::BeginFrameArgs& begin_frame_args) override; |
| + void ReclaimResources(const cc::ReturnedResourceArray& resources) override; |
| + void WillDrawSurface(const cc::LocalSurfaceId& local_surface_id, |
| + const gfx::Rect& damage_rect) override; |
| + |
| + // cc::ExternalBeginFrameSourceClient implementation: |
| + void OnNeedsBeginFrames(bool needs_begin_frame) override; |
| + void OnDidFinishFrame(const cc::BeginFrameAck& ack) override; |
| + |
| + gfx::Size last_submitted_frame_size_; |
| + cc::LocalSurfaceId local_surface_id_; |
| + cc::LocalSurfaceIdAllocator id_allocator_; |
| + cc::mojom::MojoCompositorFrameSinkAssociatedPtrInfo |
| + compositor_frame_sink_info_; |
| + cc::mojom::MojoCompositorFrameSinkClientRequest client_request_; |
| + cc::mojom::MojoCompositorFrameSinkAssociatedPtr compositor_frame_sink_; |
| + std::unique_ptr<mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient>> |
| + client_binding_; |
| + cc::mojom::DisplayPrivateAssociatedPtrInfo display_private_info_; |
| + cc::mojom::DisplayPrivateAssociatedPtr display_private_; |
| + std::unique_ptr<base::ThreadChecker> thread_checker_; |
| + std::unique_ptr<cc::ExternalBeginFrameSource> begin_frame_source_; |
| + const cc::FrameSinkId frame_sink_id_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(DisplayClientCompositorFrameSink); |
| +}; |
| + |
| +} // namespace ui |
| + |
| +#endif // SERVICES_UI_PUBLIC_CPP_DISPLAY_CLIENT_COMPOSITOR_FRAME_SINK_H_ |