From c90f0d8d1fd4e95d6d26fc1454bf9c8094d51ecb Mon Sep 17 00:00:00 2001 From: "jbauman@chromium.org" Date: Sat, 16 Aug 2014 06:07:45 +0000 Subject: Enqueuing new frames in a Surface should cause Displays to reaggregate it Keep track of which Surfaces were included in a Display last frame, so if a new frame is enqueued in a Surface the Displays containing it will tell their clients to redraw. This way the browser compositor doesn't have to commit if only the renderer contents changed. BUG= Review URL: https://codereview.chromium.org/432093003 Cr-Commit-Position: refs/heads/master@{#290103} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290103 0039d316-1c4b-4281-b951-d872f2087c98 --- cc/surfaces/display.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'cc/surfaces/display.h') diff --git a/cc/surfaces/display.h b/cc/surfaces/display.h index 93606ba..8af18b57 100644 --- a/cc/surfaces/display.h +++ b/cc/surfaces/display.h @@ -11,6 +11,7 @@ #include "cc/resources/returned_resource.h" #include "cc/surfaces/surface_aggregator.h" #include "cc/surfaces/surface_id.h" +#include "cc/surfaces/surface_manager.h" #include "cc/surfaces/surfaces_export.h" namespace gfx { @@ -28,13 +29,13 @@ class Surface; class SurfaceAggregator; class SurfaceIdAllocator; class SurfaceFactory; -class SurfaceManager; // A Display produces a surface that can be used to draw to a physical display // (OutputSurface). The client is responsible for creating and sizing the // surface IDs used to draw into the display and deciding when to draw. class CC_SURFACES_EXPORT Display : public OutputSurfaceClient, - public RendererClient { + public RendererClient, + public SurfaceDamageObserver { public: Display(DisplayClient* client, SurfaceManager* manager, @@ -72,6 +73,9 @@ class CC_SURFACES_EXPORT Display : public OutputSurfaceClient, virtual void SetFullRootLayerDamage() OVERRIDE {} virtual void RunOnDemandRasterTask(Task* on_demand_raster_task) OVERRIDE {} + // SurfaceDamageObserver implementation. + virtual void OnSurfaceDamaged(SurfaceId surface) OVERRIDE; + private: void InitializeOutputSurface(); @@ -86,6 +90,8 @@ class CC_SURFACES_EXPORT Display : public OutputSurfaceClient, scoped_ptr aggregator_; scoped_ptr renderer_; + std::set contained_surfaces_; + DISALLOW_COPY_AND_ASSIGN(Display); }; -- cgit v1.1