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

Unified Diff: services/ui/surfaces/gpu_display_compositor_frame_sink.cc

Issue 2651213004: Revert of Decouple GpuCompositorFrameSink from DisplayCompositor (Closed)
Patch Set: Created 3 years, 11 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
Index: services/ui/surfaces/gpu_display_compositor_frame_sink.cc
diff --git a/services/ui/surfaces/gpu_display_compositor_frame_sink.cc b/services/ui/surfaces/gpu_display_compositor_frame_sink.cc
new file mode 100644
index 0000000000000000000000000000000000000000..229779c63734ff8807257450ac2841bf6ab20003
--- /dev/null
+++ b/services/ui/surfaces/gpu_display_compositor_frame_sink.cc
@@ -0,0 +1,55 @@
+// 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.
+
+#include "services/ui/surfaces/gpu_display_compositor_frame_sink.h"
+
+namespace ui {
+
+GpuDisplayCompositorFrameSink::GpuDisplayCompositorFrameSink(
+ DisplayCompositor* display_compositor,
+ const cc::FrameSinkId& frame_sink_id,
+ std::unique_ptr<cc::Display> display,
+ std::unique_ptr<cc::BeginFrameSource> begin_frame_source,
+ cc::mojom::MojoCompositorFrameSinkAssociatedRequest request,
+ cc::mojom::MojoCompositorFrameSinkPrivateRequest
+ compositor_frame_sink_private_request,
+ cc::mojom::MojoCompositorFrameSinkClientPtr client,
+ cc::mojom::DisplayPrivateAssociatedRequest display_private_request)
+ : GpuCompositorFrameSink(display_compositor,
+ frame_sink_id,
+ std::move(display),
+ std::move(begin_frame_source),
+ std::move(compositor_frame_sink_private_request),
+ std::move(client)),
+ binding_(this, std::move(request)),
+ display_private_binding_(this, std::move(display_private_request)) {
+ binding_.set_connection_error_handler(
+ base::Bind(&GpuDisplayCompositorFrameSink::OnClientConnectionLost,
+ base::Unretained(this)));
+}
+
+GpuDisplayCompositorFrameSink::~GpuDisplayCompositorFrameSink() = default;
+
+void GpuDisplayCompositorFrameSink::SetDisplayVisible(bool visible) {
+ DCHECK(support_.display());
+ support_.display()->SetVisible(visible);
+}
+
+void GpuDisplayCompositorFrameSink::ResizeDisplay(const gfx::Size& size) {
+ DCHECK(support_.display());
+ support_.display()->Resize(size);
+}
+
+void GpuDisplayCompositorFrameSink::SetDisplayColorSpace(
+ const gfx::ColorSpace& color_space) {
+ DCHECK(support_.display());
+ support_.display()->SetColorSpace(color_space);
+}
+
+void GpuDisplayCompositorFrameSink::SetOutputIsSecure(bool secure) {
+ DCHECK(support_.display());
+ support_.display()->SetOutputIsSecure(secure);
+}
+
+} // namespace ui
« no previous file with comments | « services/ui/surfaces/gpu_display_compositor_frame_sink.h ('k') | services/ui/surfaces/gpu_offscreen_compositor_frame_sink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698