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

Unified Diff: services/ui/ws/frame_generator.h

Issue 2610063007: Separate client surface reference tracking from FrameGenerator. (Closed)
Patch Set: Rebase. 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/embedded_surface_tracker_unittest.cc ('k') | services/ui/ws/frame_generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/frame_generator.h
diff --git a/services/ui/ws/frame_generator.h b/services/ui/ws/frame_generator.h
index d60b8b29edc14bbe8f880095b9d4e5c5b1e623f6..db05f1fbd44d69e48149a3f111d435b97707db73 100644
--- a/services/ui/ws/frame_generator.h
+++ b/services/ui/ws/frame_generator.h
@@ -6,12 +6,11 @@
#define SERVICES_UI_WS_FRAME_GENERATOR_H_
#include <memory>
-#include <unordered_map>
-#include <vector>
#include "base/macros.h"
#include "base/timer/timer.h"
#include "cc/ipc/display_compositor.mojom.h"
+#include "cc/surfaces/embedded_surface_tracker.h"
#include "cc/surfaces/frame_sink_id.h"
#include "cc/surfaces/surface_id.h"
#include "cc/surfaces/surface_id_allocator.h"
@@ -77,6 +76,9 @@ class FrameGenerator : public ServerWindowTracker,
void ReclaimResources(const cc::ReturnedResourceArray& resources) override;
void WillDrawSurface() override;
+ // Updates the display surface SurfaceId using new value in |local_frame_id_|.
+ void UpdateDisplaySurfaceId();
+
// Generates the CompositorFrame.
cc::CompositorFrame GenerateCompositorFrame(const gfx::Rect& output_rect);
@@ -84,36 +86,6 @@ class FrameGenerator : public ServerWindowTracker,
// appends it to the provided cc::RenderPass.
void DrawWindow(cc::RenderPass* pass, ServerWindow* window);
- // Finds the parent surface id for |window|.
- cc::SurfaceId FindParentSurfaceId(ServerWindow* window);
-
- // Adds surface reference to local cache and surface manager.
- void AddSurfaceReference(const cc::SurfaceId& parent_id,
- const cc::SurfaceId& child_id);
-
- // Does work necessary for adding the first surface reference.
- void AddFirstReference(const cc::SurfaceId& surface_id, ServerWindow* window);
-
- // Finds all Surfaces with references from |old_surface_id| and adds a new
- // reference from |new_surface_id|. The caller should remove any references
- // to |old_surface_id| afterwards to finish cleanup.
- void AddNewParentReferences(const cc::SurfaceId& old_surface_id,
- const cc::SurfaceId& new_surface_id);
-
- // Sends IPC to add references in |references_to_add_|.
- void PerformAddSurfaceReferences();
-
- // Sends IPC to remove all references in |references_to_remove_|.
- void PerformRemoveSurfaceReferences();
-
- // Removes any retained references for |frame_sink_id_|.
- void RemoveFrameSinkReference(const cc::FrameSinkId& frame_sink_id);
-
- // Removes all retained references to surfaces.
- void RemoveAllSurfaceReferences();
-
- cc::mojom::DisplayCompositor* GetDisplayCompositor();
-
// ServerWindowObserver implementation.
void OnWindowDestroying(ServerWindow* window) override;
@@ -127,24 +99,8 @@ class FrameGenerator : public ServerWindowTracker,
cc::mojom::MojoCompositorFrameSinkPtr compositor_frame_sink_;
cc::mojom::DisplayPrivatePtr display_private_;
- // Active references held by this client to surfaces that could be embedded in
- // a CompositorFrame submitted from FrameGenerator.
- std::unordered_map<cc::FrameSinkId, cc::SurfaceReference, cc::FrameSinkIdHash>
- active_references_;
-
- // References to surfaces that should be removed after a CompositorFrame has
- // been submitted and the surfaces are not being used.
- std::vector<cc::SurfaceReference> references_to_remove_;
-
- // References that should be added before the next CompositorFrame is
- // submitted.
- std::vector<cc::SurfaceReference> references_to_add_;
-
- // If a CompositorFrame for a child surface is submitted before the first
- // display root CompositorFrame, we can't add a reference from the unknown
- // display root SurfaceId. Track the child SurfaceId here and add a reference
- // to it when the display root SurfaceId is available.
- std::vector<cc::SurfaceId> waiting_for_references_;
+ // Tracks surface references for embedded surfaces.
+ cc::EmbeddedSurfaceTracker surface_tracker_;
mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient> binding_;
« no previous file with comments | « cc/surfaces/embedded_surface_tracker_unittest.cc ('k') | services/ui/ws/frame_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698