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

Unified Diff: cc/surfaces/surface_manager.cc

Issue 2651283004: Reland 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
« no previous file with comments | « cc/surfaces/surface_manager.h ('k') | cc/surfaces/surface_reference_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_manager.cc
diff --git a/cc/surfaces/surface_manager.cc b/cc/surfaces/surface_manager.cc
index b290726c18478eae63b932d2db4eab7fbab66582..cfdc7a112a4776136bad76d3166f31ca6023a496 100644
--- a/cc/surfaces/surface_manager.cc
+++ b/cc/surfaces/surface_manager.cc
@@ -219,6 +219,24 @@ void SurfaceManager::RemoveSurfaceReference(const SurfaceId& parent_id,
GarbageCollectSurfaces();
}
+void SurfaceManager::AddSurfaceReferences(
+ const std::vector<SurfaceReference>& references) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+
+ for (const auto& reference : references)
+ AddSurfaceReference(reference.parent_id(), reference.child_id());
+}
+
+void SurfaceManager::RemoveSurfaceReferences(
+ const std::vector<SurfaceReference>& references) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+
+ // TODO(kylechar): Each remove reference can trigger GC, it would be better if
+ // we GC only once if removing multiple references.
+ for (const auto& reference : references)
+ RemoveSurfaceReference(reference.parent_id(), reference.child_id());
+}
+
size_t SurfaceManager::GetSurfaceReferenceCount(
const SurfaceId& surface_id) const {
auto iter = child_to_parent_refs_.find(surface_id);
« no previous file with comments | « cc/surfaces/surface_manager.h ('k') | cc/surfaces/surface_reference_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698