| Index: cc/surfaces/display_scheduler.h
|
| diff --git a/cc/surfaces/display_scheduler.h b/cc/surfaces/display_scheduler.h
|
| index 76d21b8b260474a61d14312dfcb6c8c8574dd74f..6bc977f5c1f57e36a3620e1cd9f0989841567678 100644
|
| --- a/cc/surfaces/display_scheduler.h
|
| +++ b/cc/surfaces/display_scheduler.h
|
| @@ -8,23 +8,29 @@
|
| #include <memory>
|
|
|
| #include "base/cancelable_callback.h"
|
| +#include "base/containers/flat_map.h"
|
| #include "base/macros.h"
|
| #include "base/memory/ref_counted.h"
|
| #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 SurfaceInfo;
|
| +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 +41,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 +49,12 @@ 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 SurfaceCreated(const SurfaceInfo& surface_info);
|
| + void SurfaceDestroyed(const SurfaceId& surface_id);
|
| + void SurfaceReceivedBeginFrame(const SurfaceId& surface_id,
|
| + const BeginFrameArgs& args);
|
| + void SurfaceFinishedBeginFrame(const SurfaceId& surface_id,
|
| + const BeginFrameAck& ack);
|
|
|
| virtual void DidSwapBuffers();
|
| void DidReceiveSwapBuffersAck();
|
| @@ -62,9 +75,12 @@ class CC_SURFACES_EXPORT DisplayScheduler : public BeginFrameObserverBase {
|
| void StopObservingBeginFrames();
|
| bool ShouldDraw();
|
| void DidFinishFrame(bool did_draw);
|
| + // Updates |has_pending_surfaces_| and returns whether its value changed.
|
| + bool UpdateHasPendingSurfaces(const SurfaceId& changed_surface_id);
|
|
|
| DisplaySchedulerClient* client_;
|
| BeginFrameSource* begin_frame_source_;
|
| + SurfaceManager* surface_manager_;
|
| base::SingleThreadTaskRunner* task_runner_;
|
|
|
| BeginFrameArgs current_begin_frame_args_;
|
| @@ -82,7 +98,13 @@ class CC_SURFACES_EXPORT DisplayScheduler : public BeginFrameObserverBase {
|
| bool inside_begin_frame_deadline_interval_;
|
| bool needs_draw_;
|
| bool expecting_root_surface_damage_because_of_resize_;
|
| - bool all_active_child_surfaces_ready_to_draw_;
|
| + bool has_pending_surfaces_;
|
| +
|
| + struct SurfaceBeginFrameState {
|
| + BeginFrameArgs last_args;
|
| + BeginFrameAck last_ack;
|
| + };
|
| + base::flat_map<SurfaceId, SurfaceBeginFrameState> surface_states_;
|
|
|
| int next_swap_id_;
|
| int pending_swaps_;
|
| @@ -91,12 +113,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_;
|
|
|
|
|