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

Unified Diff: cc/surfaces/compositor_frame_sink_support.h

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 | « no previous file | cc/surfaces/compositor_frame_sink_support.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/compositor_frame_sink_support.h
diff --git a/cc/surfaces/compositor_frame_sink_support.h b/cc/surfaces/compositor_frame_sink_support.h
index 8471bbd15c6b186b1c4678f6f64a7246ab41fd18..7351723319fccb67e73d47f9d2ab912e0f7d0dc0 100644
--- a/cc/surfaces/compositor_frame_sink_support.h
+++ b/cc/surfaces/compositor_frame_sink_support.h
@@ -5,14 +5,19 @@
#ifndef CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_
#define CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_
+#include <memory>
+#include <unordered_set>
+
#include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h"
#include "cc/output/compositor_frame.h"
#include "cc/scheduler/begin_frame_source.h"
#include "cc/surfaces/display.h"
#include "cc/surfaces/display_client.h"
+#include "cc/surfaces/referenced_surface_tracker.h"
#include "cc/surfaces/surface_factory.h"
#include "cc/surfaces/surface_factory_client.h"
+#include "cc/surfaces/surface_id.h"
#include "cc/surfaces/surfaces_export.h"
namespace cc {
@@ -50,6 +55,16 @@ class CC_SURFACES_EXPORT CompositorFrameSinkSupport
Display* display() { return display_.get(); }
private:
+ // Update surface references with SurfaceManager for current CompositorFrame
+ // that has |local_surface_id|. UpdateReferences() must be called on
+ // |reference_tracker_| before calling this. Will add and remove top-level
+ // root references if |display_| is not null.
+ void UpdateSurfaceReferences(const SurfaceId& last_surface_id,
+ const LocalSurfaceId& local_surface_id);
+
+ void AddTopLevelRootReference(const SurfaceId& surface_id);
+ void RemoveTopLevelRootReference(const SurfaceId& surface_id);
+
void DidReceiveCompositorFrameAck();
// DisplayClient implementation.
@@ -101,6 +116,10 @@ class CC_SURFACES_EXPORT CompositorFrameSinkSupport
// Whether or not a frame observer has been added.
bool added_frame_observer_ = false;
+ // Track the surface references for the surface corresponding to this
+ // compositor frame sink.
+ ReferencedSurfaceTracker reference_tracker_;
+
// The set of BeginFrame children of this CompositorFrameSink.
std::unordered_set<FrameSinkId, FrameSinkIdHash> child_frame_sinks_;
« no previous file with comments | « no previous file | cc/surfaces/compositor_frame_sink_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698