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

Unified Diff: cc/resources/tile_manager.h

Issue 287643004: Re-land: cc: Examine layers to determine if we're ready to activate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: init check_if_ready_to_activate_pending_ properly Created 6 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/layers/picture_layer_impl_unittest.cc ('k') | cc/resources/tile_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/tile_manager.h
diff --git a/cc/resources/tile_manager.h b/cc/resources/tile_manager.h
index cdc7d1edd10248265a4331702d93ca7d2767f789..0881e6f6ff1e4a4b556b7ce8830c276c1a8c5ae7 100644
--- a/cc/resources/tile_manager.h
+++ b/cc/resources/tile_manager.h
@@ -30,8 +30,15 @@ class ResourceProvider;
class CC_EXPORT TileManagerClient {
public:
+ // Called when all tiles marked as required for activation are ready to draw.
virtual void NotifyReadyToActivate() = 0;
- virtual void NotifyTileInitialized(const Tile* tile) = 0;
+
+ // Called when the visible representation of a tile might have changed. Some
+ // examples are:
+ // - Tile version initialized.
+ // - Tile resources freed.
+ // - Tile marked for on-demand raster.
+ virtual void NotifyTileStateChanged(const Tile* tile) = 0;
protected:
virtual ~TileManagerClient() {}
@@ -154,9 +161,9 @@ class CC_EXPORT TileManager : public RasterizerClient,
static scoped_ptr<TileManager> Create(
TileManagerClient* client,
+ base::SequencedTaskRunner* task_runner,
ResourcePool* resource_pool,
Rasterizer* rasterizer,
- bool use_rasterize_on_demand,
RenderingStatsInstrumentation* rendering_stats_instrumentation);
virtual ~TileManager();
@@ -228,9 +235,9 @@ class CC_EXPORT TileManager : public RasterizerClient,
protected:
TileManager(TileManagerClient* client,
+ base::SequencedTaskRunner* task_runner,
ResourcePool* resource_pool,
Rasterizer* rasterizer,
- bool use_rasterize_on_demand,
RenderingStatsInstrumentation* rendering_stats_instrumentation);
// Methods called by Tile
@@ -276,6 +283,7 @@ class CC_EXPORT TileManager : public RasterizerClient,
void FreeResourceForTile(Tile* tile, RasterMode mode);
void FreeResourcesForTile(Tile* tile);
void FreeUnusedResourcesForTile(Tile* tile);
+ void FreeResourcesForTileAndNotifyClientIfTileWasReadyToDraw(Tile* tile);
scoped_refptr<ImageDecodeTask> CreateImageDecodeTask(Tile* tile,
SkPixelRef* pixel_ref);
scoped_refptr<RasterTask> CreateRasterTask(Tile* tile);
@@ -283,7 +291,12 @@ class CC_EXPORT TileManager : public RasterizerClient,
void UpdatePrioritizedTileSetIfNeeded();
void CleanUpLayers();
+ bool IsReadyToActivate() const;
+ void ScheduleCheckIfReadyToActivate();
+ void CheckIfReadyToActivate();
+
TileManagerClient* client_;
+ scoped_refptr<base::SequencedTaskRunner> task_runner_;
ResourcePool* resource_pool_;
Rasterizer* rasterizer_;
GlobalStateThatImpactsTilePriority global_state_;
@@ -323,8 +336,6 @@ class CC_EXPORT TileManager : public RasterizerClient,
std::vector<Tile*> released_tiles_;
- bool use_rasterize_on_demand_;
-
ResourceFormat resource_format_;
// Queue used when scheduling raster tasks.
@@ -334,6 +345,10 @@ class CC_EXPORT TileManager : public RasterizerClient,
std::vector<PictureLayerImpl*> layers_;
+ bool check_if_ready_to_activate_pending_;
+
+ base::WeakPtrFactory<TileManager> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(TileManager);
};
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | cc/resources/tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698