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

Unified Diff: cc/surfaces/display_compositor_lock_manager.h

Issue 2582823002: WIP: Surface Synchronization System
Patch Set: Only create ClientSurfaceEmbedder if window is visible. Trash it otherwise. 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
Index: cc/surfaces/display_compositor_lock_manager.h
diff --git a/cc/surfaces/display_compositor_lock_manager.h b/cc/surfaces/display_compositor_lock_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..2bf0636f2737291f048c8b7d8aa0f0763f9e81a9
--- /dev/null
+++ b/cc/surfaces/display_compositor_lock_manager.h
@@ -0,0 +1,73 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_SURFACES_DISPLAY_COMPOSITOR_LOCK_MANAGER_H_
+#define CC_SURFACES_DISPLAY_COMPOSITOR_LOCK_MANAGER_H_
+
+#include "cc/scheduler/begin_frame_source.h"
+#include "cc/surfaces/pending_surface_observer.h"
+#include "cc/surfaces/surface.h"
+#include "cc/surfaces/surface_observer.h"
+#include "cc/surfaces/surfaces_export.h"
+
+namespace cc {
+
+class SurfaceManager;
+
+class CC_SURFACES_EXPORT DisplayCompositorLockManager
+ : public BeginFrameObserver,
+ public PendingSurfaceObserver,
+ public SurfaceObserver {
+ public:
+ DisplayCompositorLockManager(SurfaceManager* surface_manager,
+ BeginFrameSource* begin_frame_source);
+ ~DisplayCompositorLockManager() override;
+
+ void RequestSurfaceResolution(Surface* pending_surface);
+
+ bool observing_begin_frames() const { return observing_begin_frames_; }
+
+ // BeginFrameObserver implementation.
+ void OnBeginFrame(const BeginFrameArgs& args) override;
+ const BeginFrameArgs& LastUsedBeginFrameArgs() const override;
+ void OnBeginFrameSourcePausedChanged(bool paused) override;
+
+ // PendingSurfaceObserver implementation:
+ void OnSurfaceActivated(Surface* pending_surface) override;
+ void OnSurfaceChanged(
+ Surface* pending_surface,
+ const SurfaceDependencies& added_dependencies,
+ const SurfaceDependencies& removed_dependencies) override;
+ void OnSurfaceDiscarded(Surface* pending_surface) override;
+
+ // SurfaceObserver implementation:
+ void OnSurfaceCreated(const SurfaceInfo& surface_info) override;
+ void OnSurfaceDamaged(const SurfaceId& surface_id, bool* changed) override;
+
+ private:
+ void ReportSurfaceIdAvailable(const SurfaceId& surface_id);
+
+ SurfaceManager* const surface_manager_;
+
+ // The last begin frame args generated by the begin frame source.
+ BeginFrameArgs last_begin_frame_args_;
+
+ BeginFrameSource* begin_frame_source_;
+
+ // Whether or not a rame observer has been added.
+ bool observing_begin_frames_ = false;
+
+ uint32_t begin_frame_count_ = 0;
+
+ std::unordered_map<SurfaceId, PendingSurfaceSet, SurfaceIdHash>
+ blocking_surfaces_;
+
+ PendingSurfaceSet pending_surfaces_;
+
+ DISALLOW_COPY_AND_ASSIGN(DisplayCompositorLockManager);
+};
+
+} // namespace cc
+
+#endif // CC_SURFACES_DISPLAY_COMPOSITOR_LOCK_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698