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

Unified Diff: cc/surfaces/display_scheduler.h

Issue 2854163003: [cc] Plumb BeginFrameAcks through SurfaceManager to DisplayScheduler. (Closed)
Patch Set: Track state per surface. 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
Index: cc/surfaces/display_scheduler.h
diff --git a/cc/surfaces/display_scheduler.h b/cc/surfaces/display_scheduler.h
index 76d21b8b260474a61d14312dfcb6c8c8574dd74f..ce03054987e2c56d4afc1406433c251b2cce2491 100644
--- a/cc/surfaces/display_scheduler.h
+++ b/cc/surfaces/display_scheduler.h
@@ -13,18 +13,22 @@
#include "base/single_thread_task_runner.h"
#include "cc/output/renderer_settings.h"
#include "cc/scheduler/begin_frame_source.h"
+#include "cc/surfaces/surface_aggregator.h"
#include "cc/surfaces/surface_id.h"
#include "cc/surfaces/surfaces_export.h"
namespace cc {
class BeginFrameSource;
+class SurfaceManager;
class CC_SURFACES_EXPORT DisplaySchedulerClient {
public:
virtual ~DisplaySchedulerClient() {}
virtual bool DrawAndSwap() = 0;
+ virtual const SurfaceAggregator::SurfaceIndexMap&
+ GetPreviousContainedSurfaces() = 0;
};
class CC_SURFACES_EXPORT DisplayScheduler : public BeginFrameObserverBase {
@@ -35,6 +39,7 @@ class CC_SURFACES_EXPORT DisplayScheduler : public BeginFrameObserverBase {
void SetClient(DisplaySchedulerClient* client);
void SetBeginFrameSource(BeginFrameSource* begin_frame_source);
+ void SetSurfaceManager(SurfaceManager* surface_manager);
void SetVisible(bool visible);
void SetRootSurfaceResourcesLocked(bool locked);
@@ -42,6 +47,7 @@ class CC_SURFACES_EXPORT DisplayScheduler : public BeginFrameObserverBase {
virtual void DisplayResized();
virtual void SetNewRootSurface(const SurfaceId& root_surface_id);
virtual void SurfaceDamaged(const SurfaceId& surface_id);
+ void OnSurfaceProducerStateChanged(const SurfaceId& surface_id);
virtual void DidSwapBuffers();
void DidReceiveSwapBuffersAck();
@@ -62,9 +68,11 @@ class CC_SURFACES_EXPORT DisplayScheduler : public BeginFrameObserverBase {
void StopObservingBeginFrames();
bool ShouldDraw();
void DidFinishFrame(bool did_draw);
+ void UpdateHasPendingSurfaces();
DisplaySchedulerClient* client_;
BeginFrameSource* begin_frame_source_;
+ SurfaceManager* surface_manager_;
base::SingleThreadTaskRunner* task_runner_;
BeginFrameArgs current_begin_frame_args_;
@@ -82,7 +90,7 @@ class CC_SURFACES_EXPORT DisplayScheduler : public BeginFrameObserverBase {
bool inside_begin_frame_deadline_interval_;
bool needs_draw_;
bool expecting_root_surface_damage_because_of_resize_;
sunnyps 2017/05/19 03:46:34 DisplayScheduler needs a map<SurfaceId, BeginFrame
Eric Seckler 2017/05/19 14:11:42 I'm not sure whether you were suggesting this, but
- bool all_active_child_surfaces_ready_to_draw_;
+ bool has_pending_surfaces_;
int next_swap_id_;
int pending_swaps_;
@@ -91,12 +99,6 @@ class CC_SURFACES_EXPORT DisplayScheduler : public BeginFrameObserverBase {
bool observing_begin_frame_source_;
SurfaceId root_surface_id_;
- bool root_surface_damaged_;
- bool expect_damage_from_root_surface_;
-
- std::set<SurfaceId> child_surface_ids_damaged_;
- std::set<SurfaceId> child_surface_ids_damaged_prev_;
- std::vector<SurfaceId> child_surface_ids_to_expect_damage_from_;
base::WeakPtrFactory<DisplayScheduler> weak_ptr_factory_;

Powered by Google App Engine
This is Rietveld 408576698