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

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

Issue 2541683004: Add/remove surface references via MojoCompositorFrameSink. (Closed)
Patch Set: Cleanup. Created 4 years 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/gpu_compositor_frame_sink.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 a9e822e4f7d8f9d0e698bd042d6c5e2e6f33aa05..0e872bf7a1ff1341b3ad95fe05b387c2d57d3996 100644
--- a/services/ui/ws/frame_generator.h
+++ b/services/ui/ws/frame_generator.h
@@ -7,6 +7,7 @@
#include <memory>
#include <unordered_map>
+#include <vector>
#include "base/macros.h"
#include "base/timer/timer.h"
@@ -14,6 +15,7 @@
#include "cc/surfaces/frame_sink_id.h"
#include "cc/surfaces/surface_id.h"
#include "cc/surfaces/surface_id_allocator.h"
+#include "cc/surfaces/surface_reference.h"
#include "services/ui/public/interfaces/window_tree_constants.mojom.h"
#include "services/ui/ws/ids.h"
#include "services/ui/ws/server_window_delegate.h"
@@ -22,15 +24,11 @@
#include "ui/gfx/native_widget_types.h"
namespace cc {
-class CompositorFrame;
class RenderPass;
class SurfaceId;
}
namespace ui {
-
-class DisplayCompositor;
-
namespace ws {
namespace test {
@@ -101,10 +99,13 @@ class FrameGenerator : public ServerWindowTracker,
void AddNewParentReferences(const cc::SurfaceId& old_surface_id,
const cc::SurfaceId& new_surface_id);
- // Removes all references to surfaces in |dead_references_|.
- void RemoveDeadSurfaceReferences();
+ // 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 the provided FrameSink.
+ // Removes any retained references for |frame_sink_id_|.
void RemoveFrameSinkReference(const cc::FrameSinkId& frame_sink_id);
// Removes all retained references to surfaces.
@@ -123,24 +124,18 @@ class FrameGenerator : public ServerWindowTracker,
cc::SurfaceIdAllocator id_allocator_;
cc::mojom::MojoCompositorFrameSinkPtr compositor_frame_sink_;
- // Represents the top level root surface id that should reference the display
- // root surface. We don't know the actual value, because it's generated in
- // another process, this is used internally as a placeholder.
- const cc::SurfaceId top_level_root_surface_id_;
-
- struct SurfaceReference {
- cc::SurfaceId parent_id;
- cc::SurfaceId child_id;
- };
-
// Active references held by this client to surfaces that could be embedded in
// a CompositorFrame submitted from FrameGenerator.
- std::unordered_map<cc::FrameSinkId, SurfaceReference, cc::FrameSinkIdHash>
+ 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<SurfaceReference> dead_references_;
+ 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
« no previous file with comments | « services/ui/surfaces/gpu_compositor_frame_sink.cc ('k') | services/ui/ws/frame_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698