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

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

Issue 2369793002: WIP: Propagate SurfaceID up window tree hierarchy
Patch Set: Fix input events: EventDispatcher ignores container windows Created 4 years, 3 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/surfaces/compositor_frame_sink.h ('k') | services/ui/surfaces/display_compositor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/surfaces/compositor_frame_sink.cc
diff --git a/services/ui/surfaces/display_compositor.cc b/services/ui/surfaces/compositor_frame_sink.cc
similarity index 75%
copy from services/ui/surfaces/display_compositor.cc
copy to services/ui/surfaces/compositor_frame_sink.cc
index e5b9d9e68f41008a3a77352fd08394b61ba60636..74bfd46b708743b0e099c571ad95466623f80b17 100644
--- a/services/ui/surfaces/display_compositor.cc
+++ b/services/ui/surfaces/compositor_frame_sink.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "services/ui/surfaces/display_compositor.h"
+#include "services/ui/surfaces/compositor_frame_sink.h"
#include "cc/output/copy_output_request.h"
#include "cc/output/output_surface.h"
@@ -22,19 +22,22 @@
#endif
namespace ui {
+namespace surfaces {
-DisplayCompositor::DisplayCompositor(
+CompositorFrameSink::CompositorFrameSink(
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
gfx::AcceleratedWidget widget,
scoped_refptr<gpu::GpuChannelHost> gpu_channel,
- const scoped_refptr<SurfacesState>& surfaces_state)
+ const scoped_refptr<DisplayCompositor>& display_compositor)
: task_runner_(task_runner),
- surfaces_state_(surfaces_state),
- factory_(surfaces_state->manager(), this),
- allocator_(surfaces_state->next_client_id()) {
- surfaces_state_->manager()->RegisterSurfaceClientId(allocator_.client_id());
- surfaces_state_->manager()->RegisterSurfaceFactoryClient(
- allocator_.client_id(), this);
+ display_compositor_(display_compositor),
+ factory_(display_compositor->manager(), this),
+ // TODO(fsamuel): Use the WindowId as the FrameSinkId
+ allocator_(cc::FrameSinkId(display_compositor->next_client_id(), 0)) {
+ display_compositor_->manager()->RegisterFrameSinkId(
+ allocator_.frame_sink_id());
+ display_compositor_->manager()->RegisterSurfaceFactoryClient(
+ allocator_.frame_sink_id(), this);
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager =
gpu_channel->gpu_memory_buffer_manager();
@@ -74,18 +77,19 @@ DisplayCompositor::DisplayCompositor(
cc::RendererSettings(), std::move(synthetic_begin_frame_source),
std::move(display_output_surface), std::move(scheduler),
base::MakeUnique<cc::TextureMailboxDeleter>(task_runner_.get())));
- display_->Initialize(this, surfaces_state_->manager(),
- allocator_.client_id());
+ display_->Initialize(this, display_compositor_->manager(),
+ allocator_.frame_sink_id());
display_->SetVisible(true);
}
-DisplayCompositor::~DisplayCompositor() {
- surfaces_state_->manager()->UnregisterSurfaceFactoryClient(
- allocator_.client_id());
- surfaces_state_->manager()->InvalidateSurfaceClientId(allocator_.client_id());
+CompositorFrameSink::~CompositorFrameSink() {
+ display_compositor_->manager()->UnregisterSurfaceFactoryClient(
+ allocator_.frame_sink_id());
+ display_compositor_->manager()->InvalidateFrameSinkId(
+ allocator_.frame_sink_id());
}
-void DisplayCompositor::SubmitCompositorFrame(
+void CompositorFrameSink::SubmitCompositorFrame(
cc::CompositorFrame frame,
const base::Callback<void()>& callback) {
gfx::Size frame_size =
@@ -102,37 +106,38 @@ void DisplayCompositor::SubmitCompositorFrame(
factory_.SubmitCompositorFrame(surface_id_, std::move(frame), callback);
}
-void DisplayCompositor::RequestCopyOfOutput(
+void CompositorFrameSink::RequestCopyOfOutput(
std::unique_ptr<cc::CopyOutputRequest> output_request) {
factory_.RequestCopyOfSurface(surface_id_, std::move(output_request));
}
-void DisplayCompositor::ReturnResources(
+void CompositorFrameSink::ReturnResources(
const cc::ReturnedResourceArray& resources) {
// TODO(fsamuel): Implement this.
}
-void DisplayCompositor::SetBeginFrameSource(
+void CompositorFrameSink::SetBeginFrameSource(
cc::BeginFrameSource* begin_frame_source) {
// TODO(fsamuel): Implement this.
}
-void DisplayCompositor::DisplayOutputSurfaceLost() {
+void CompositorFrameSink::DisplayOutputSurfaceLost() {
// TODO(fsamuel): This looks like it would crash if a frame was in flight and
// will be submitted.
display_.reset();
}
-void DisplayCompositor::DisplayWillDrawAndSwap(
+void CompositorFrameSink::DisplayWillDrawAndSwap(
bool will_draw_and_swap,
const cc::RenderPassList& render_passes) {
// This notification is not relevant to our client outside of tests.
}
-void DisplayCompositor::DisplayDidDrawAndSwap() {
+void CompositorFrameSink::DisplayDidDrawAndSwap() {
// This notification is not relevant to our client outside of tests. We
// unblock the client from the DrawCallback when the surface is going to
// be drawn.
}
+} // namespace surfaces
} // namespace ui
« no previous file with comments | « services/ui/surfaces/compositor_frame_sink.h ('k') | services/ui/surfaces/display_compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698