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

Unified Diff: cc/surfaces/surface_dependency_tracker.h

Issue 2887453002: SurfaceDependencyTracker: Only observe BeginFrames if a deadline is needed (Closed)
Patch Set: Fixed an incorrect DCHECK Created 3 years, 7 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_dependency_deadline.cc ('k') | cc/surfaces/surface_dependency_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_dependency_tracker.h
diff --git a/cc/surfaces/surface_dependency_tracker.h b/cc/surfaces/surface_dependency_tracker.h
index f5bab833737be63610950307b0ea4d55125fc76f..45b543cd6fe2bf2970df025d20d1740ec59c00dd 100644
--- a/cc/surfaces/surface_dependency_tracker.h
+++ b/cc/surfaces/surface_dependency_tracker.h
@@ -5,12 +5,13 @@
#ifndef CC_SURFACES_SURFACE_DEPENDENCY_TRACKER_H_
#define CC_SURFACES_SURFACE_DEPENDENCY_TRACKER_H_
-#include "cc/scheduler/begin_frame_source.h"
#include "cc/surfaces/surface.h"
+#include "cc/surfaces/surface_dependency_deadline.h"
#include "cc/surfaces/surfaces_export.h"
namespace cc {
+class BeginFrameSource;
class SurfaceManager;
// SurfaceDependencyTracker tracks unresolved dependencies blocking
@@ -28,17 +29,19 @@ class SurfaceManager;
// TODO(fsamuel): Deadlines should not be global. They should be scoped to a
// surface subtree. However, that will not be possible until SurfaceReference
// work is complete.
-class CC_SURFACES_EXPORT SurfaceDependencyTracker : public BeginFrameObserver {
+class CC_SURFACES_EXPORT SurfaceDependencyTracker {
public:
SurfaceDependencyTracker(SurfaceManager* surface_manager,
BeginFrameSource* begin_frame_source);
- ~SurfaceDependencyTracker() override;
+ ~SurfaceDependencyTracker();
// Called when |surface| has a pending CompositorFrame and it wishes to be
// informed when that surface's dependencies are resolved.
void RequestSurfaceResolution(Surface* surface);
- bool has_deadline() const { return frames_since_deadline_set_.has_value(); }
+ bool has_deadline() const { return deadline_.has_deadline(); }
+
+ void OnDeadline();
void OnSurfaceActivated(Surface* surface);
void OnSurfaceDependenciesChanged(
@@ -47,11 +50,6 @@ class CC_SURFACES_EXPORT SurfaceDependencyTracker : public BeginFrameObserver {
const base::flat_set<SurfaceId>& removed_dependencies);
void OnSurfaceDiscarded(Surface* surface);
- // BeginFrameObserver implementation.
- void OnBeginFrame(const BeginFrameArgs& args) override;
- const BeginFrameArgs& LastUsedBeginFrameArgs() const override;
- void OnBeginFrameSourcePausedChanged(bool paused) override;
-
private:
// Informs all Surfaces with pending frames blocked on the provided
// |surface_id| that there is now an active frame available in Surface
@@ -60,15 +58,9 @@ class CC_SURFACES_EXPORT SurfaceDependencyTracker : public BeginFrameObserver {
SurfaceManager* const surface_manager_;
- // The last begin frame args generated by the begin frame source.
- BeginFrameArgs last_begin_frame_args_;
-
- // The BeginFrameSource used to set deadlines.
- BeginFrameSource* const begin_frame_source_;
-
- // The number of BeginFrames observed since a deadline was set. If
- // base::nullopt_t then a deadline is not set.
- base::Optional<uint32_t> frames_since_deadline_set_;
+ // This object tracks the deadline when all pending CompositorFrames in the
+ // system will be activated.
+ SurfaceDependencyDeadline deadline_;
// A map from a SurfaceId to the set of Surfaces blocked on that SurfaceId.
std::unordered_map<SurfaceId, base::flat_set<SurfaceId>, SurfaceIdHash>
« no previous file with comments | « cc/surfaces/surface_dependency_deadline.cc ('k') | cc/surfaces/surface_dependency_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698