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

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

Issue 2541683004: Add/remove surface references via MojoCompositorFrameSink. (Closed)
Patch Set: WIP 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
Index: services/ui/ws/frame_generator.h
diff --git a/services/ui/ws/frame_generator.h b/services/ui/ws/frame_generator.h
index c93e1220826edcaf3a49b64ad34c10ae9980409c..ee952d8d27fe1efde83a27babd38a9294f6c7f3a 100644
--- a/services/ui/ws/frame_generator.h
+++ b/services/ui/ws/frame_generator.h
@@ -7,13 +7,13 @@
#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/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,19 +22,10 @@
#include "ui/gfx/native_widget_types.h"
namespace cc {
-class CompositorFrame;
class RenderPass;
-class SurfaceId;
-}
-
-namespace gpu {
-class GpuChannelHost;
}
namespace ui {
-
-class DisplayCompositor;
-
namespace ws {
namespace test {
@@ -104,8 +95,11 @@ class FrameGenerator : public ServerWindowTracker,
void AddNewParentReferences(const cc::SurfaceId& old_surface_id,
const cc::SurfaceId& new_surface_id);
+ // Adds all references to surfaces in |new_references_|.
+ void SendAddSurfaceReferences();
+
// Removes all references to surfaces in |dead_references_|.
- void RemoveDeadSurfaceReferences();
+ void SendRemoveSurfaceReferences();
// Removes any retained references for the provided FrameSink.
void RemoveFrameSinkReference(const cc::FrameSinkId& frame_sink_id);
@@ -113,8 +107,6 @@ class FrameGenerator : public ServerWindowTracker,
// Removes all retained references to surfaces.
void RemoveAllSurfaceReferences();
- cc::mojom::DisplayCompositor* GetDisplayCompositor();
-
// ServerWindowObserver implementation.
void OnWindowDestroying(ServerWindow* window) override;
@@ -126,24 +118,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> dead_references_;
+
+ // References that should be added before the next CompositorFrame is
+ // submitted.
+ std::vector<cc::SurfaceReference> new_references_;
// If a CompositorFrame for a child surface is submitted before the first
// display root CompositorFrame, we can't add a reference from the unknown

Powered by Google App Engine
This is Rietveld 408576698