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

Unified Diff: services/ui/ws/display_client_compositor_frame_sink.h

Issue 2738923002: Add DisplayClientCompositorFrameSink (Closed)
Patch Set: addressed nits Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/ws/BUILD.gn ('k') | services/ui/ws/display_client_compositor_frame_sink.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/display_client_compositor_frame_sink.h
diff --git a/services/ui/ws/display_client_compositor_frame_sink.h b/services/ui/ws/display_client_compositor_frame_sink.h
new file mode 100644
index 0000000000000000000000000000000000000000..90846896b495536c82d2350598c75afee45c2388
--- /dev/null
+++ b/services/ui/ws/display_client_compositor_frame_sink.h
@@ -0,0 +1,71 @@
+// 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/size.h"
+
+namespace base {
+class ThreadChecker;
+} // namespace base
+
+namespace ui {
+namespace ws {
+
+class DisplayClientCompositorFrameSink
+ : public cc::CompositorFrameSink,
+ public cc::mojom::MojoCompositorFrameSinkClient,
+ public cc::ExternalBeginFrameSourceClient {
+ public:
+ DisplayClientCompositorFrameSink(
+ const cc::FrameSinkId& frame_sink_id,
+ cc::mojom::MojoCompositorFrameSinkAssociatedPtr compositor_frame_sink,
+ cc::mojom::DisplayPrivateAssociatedPtr display_private,
+ 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::MojoCompositorFrameSinkClientRequest client_request_;
+ cc::mojom::MojoCompositorFrameSinkAssociatedPtr compositor_frame_sink_;
+ mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient> client_binding_;
+ 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);
+};
+
+} // namspace ws
+} // namespace ui
+
+#endif // SERVICES_UI_PUBLIC_CPP_DISPLAY_CLIENT_COMPOSITOR_FRAME_SINK_H_
« no previous file with comments | « services/ui/ws/BUILD.gn ('k') | services/ui/ws/display_client_compositor_frame_sink.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698