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

Unified Diff: components/display_compositor/gpu_compositor_frame_sink.cc

Issue 2687433002: Move surface reference code to CompositorFrameSinkSupport. (Closed)
Patch Set: Revert to patch 2 to reland. Created 3 years, 10 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 | « components/display_compositor/gpu_compositor_frame_sink.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/display_compositor/gpu_compositor_frame_sink.cc
diff --git a/components/display_compositor/gpu_compositor_frame_sink.cc b/components/display_compositor/gpu_compositor_frame_sink.cc
index 9a6347f146602e13ddc0e7a36ba5759fb34f825f..9e98a3b76af42dd16277bcf65b51c428e2afc9d6 100644
--- a/components/display_compositor/gpu_compositor_frame_sink.cc
+++ b/components/display_compositor/gpu_compositor_frame_sink.cc
@@ -24,7 +24,6 @@ GpuCompositorFrameSink::GpuCompositorFrameSink(
std::move(display),
std::move(begin_frame_source)),
surface_manager_(surface_manager),
- surface_tracker_(frame_sink_id),
client_(std::move(client)),
compositor_frame_sink_private_binding_(
this,
@@ -34,17 +33,7 @@ GpuCompositorFrameSink::GpuCompositorFrameSink(
base::Unretained(this)));
}
-GpuCompositorFrameSink::~GpuCompositorFrameSink() {
- // For display root surfaces, remove the reference from top level root to
- // indicate the display root surface is no longer visible.
- if (support_.display() && surface_tracker_.current_surface_id().is_valid()) {
- const cc::SurfaceId top_level_root_surface_id =
- surface_manager_->GetRootSurfaceId();
- std::vector<cc::SurfaceReference> references_to_remove{cc::SurfaceReference(
- top_level_root_surface_id, surface_tracker_.current_surface_id())};
- surface_manager_->RemoveSurfaceReferences(references_to_remove);
- }
-}
+GpuCompositorFrameSink::~GpuCompositorFrameSink() {}
void GpuCompositorFrameSink::EvictFrame() {
support_.EvictFrame();
@@ -57,43 +46,7 @@ void GpuCompositorFrameSink::SetNeedsBeginFrame(bool needs_begin_frame) {
void GpuCompositorFrameSink::SubmitCompositorFrame(
const cc::LocalSurfaceId& local_surface_id,
cc::CompositorFrame frame) {
- cc::SurfaceId start_surface_id = surface_tracker_.current_surface_id();
- surface_tracker_.UpdateReferences(local_surface_id,
- frame.metadata.referenced_surfaces);
- // TODO(kylechar): Move adding top-level root references to
- // GpuDisplayCompositorFrameSink.
-
support_.SubmitCompositorFrame(local_surface_id, std::move(frame));
-
- // Get the list of surfaces to add/remove from |surface_tracker_| so we can
- // append to them before adding/removing.
- std::vector<cc::SurfaceReference>& references_to_add =
- surface_tracker_.references_to_add();
- std::vector<cc::SurfaceReference>& references_to_remove =
- surface_tracker_.references_to_remove();
-
- // Append TLR references for the display root surfaces when display root
- // surface changes.
- if (support_.display() &&
- start_surface_id != surface_tracker_.current_surface_id()) {
- const cc::SurfaceId top_level_root_surface_id =
- surface_manager_->GetRootSurfaceId();
-
- // The first frame will not have a valid |start_surface_id| and there will
- // be no surface to remove.
- if (start_surface_id.local_surface_id().is_valid()) {
- references_to_remove.push_back(
- cc::SurfaceReference(top_level_root_surface_id, start_surface_id));
- }
-
- references_to_add.push_back(cc::SurfaceReference(
- top_level_root_surface_id, surface_tracker_.current_surface_id()));
- }
-
- if (!references_to_add.empty())
- surface_manager_->AddSurfaceReferences(references_to_add);
- if (!references_to_remove.empty())
- surface_manager_->RemoveSurfaceReferences(references_to_remove);
}
void GpuCompositorFrameSink::Require(const cc::LocalSurfaceId& local_surface_id,
« no previous file with comments | « components/display_compositor/gpu_compositor_frame_sink.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698