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

Unified Diff: cc/resources/tile_manager.h

Issue 820743002: cc: GPU rasterize tiles synchronously in PrepareToDraw. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comments Created 6 years 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/resources/tile_manager.h
diff --git a/cc/resources/tile_manager.h b/cc/resources/tile_manager.h
index 2bf1e66dede4bec19fb00392578ed56029b0bfdd..e3fc03abf3e4bf73ee3634097d545941bca82bb6 100644
--- a/cc/resources/tile_manager.h
+++ b/cc/resources/tile_manager.h
@@ -34,6 +34,7 @@ class TracedValue;
namespace cc {
class PictureLayerImpl;
+class Rasterizer;
class ResourceProvider;
class CC_EXPORT TileManagerClient {
@@ -96,12 +97,12 @@ class CC_EXPORT TileManager : public TileTaskRunnerClient,
// rasterizer.h
};
- static scoped_ptr<TileManager> Create(
- TileManagerClient* client,
- base::SequencedTaskRunner* task_runner,
- ResourcePool* resource_pool,
- TileTaskRunner* tile_task_runner,
- size_t scheduled_raster_task_limit);
+ static scoped_ptr<TileManager> Create(TileManagerClient* client,
+ base::SequencedTaskRunner* task_runner,
+ ResourcePool* resource_pool,
+ TileTaskRunner* tile_task_runner,
+ Rasterizer* rasterizer,
+ size_t scheduled_raster_task_limit);
~TileManager() override;
// Assigns tile memory and schedules work to prepare tiles for drawing.
@@ -111,7 +112,7 @@ class CC_EXPORT TileManager : public TileTaskRunnerClient,
// prepared, or failed to prepare due to OOM.
void PrepareTiles(const GlobalStateThatImpactsTilePriority& state);
- void UpdateVisibleTiles();
+ void UpdateVisibleTiles(const GlobalStateThatImpactsTilePriority& state);
scoped_refptr<Tile> CreateTile(RasterSource* raster_source,
const gfx::Size& tile_size,
@@ -172,6 +173,7 @@ class CC_EXPORT TileManager : public TileTaskRunnerClient,
const scoped_refptr<base::SequencedTaskRunner>& task_runner,
ResourcePool* resource_pool,
TileTaskRunner* tile_task_runner,
+ Rasterizer* rasterizer,
size_t scheduled_raster_task_limit);
void FreeResourcesForReleasedTiles();
@@ -192,7 +194,11 @@ class CC_EXPORT TileManager : public TileTaskRunnerClient,
virtual void ScheduleTasks(
const TileVector& tiles_that_need_to_be_rasterized);
- void AssignGpuMemoryToTiles(TileVector* tiles_that_need_to_be_rasterized);
+ void AssignGpuMemoryToTiles(TileVector* tiles_that_need_to_be_rasterized,
+ size_t scheduled_raser_task_limit);
+
+ void SynchronouslyRasterizeTiles(
+ const GlobalStateThatImpactsTilePriority& state);
private:
class MemoryUsage {
@@ -222,6 +228,9 @@ class CC_EXPORT TileManager : public TileTaskRunnerClient,
scoped_ptr<ScopedResource> resource,
const RasterSource::SolidColorAnalysis& analysis,
bool was_canceled);
+ void UpdateTileDrawInfo(Tile* tile,
+ scoped_ptr<ScopedResource> resource,
+ const RasterSource::SolidColorAnalysis& analysis);
void FreeResourcesForTile(Tile* tile);
void FreeResourcesForTileAndNotifyClientIfTileWasReadyToDraw(Tile* tile);
@@ -239,6 +248,8 @@ class CC_EXPORT TileManager : public TileTaskRunnerClient,
bool TilePriorityViolatesMemoryPolicy(const TilePriority& priority);
bool IsReadyToActivate() const;
bool IsReadyToDraw() const;
+ void NotifyReadyToActivate();
+ void NotifyReadyToDraw();
void CheckIfReadyToActivate();
void CheckIfReadyToDraw();
void CheckIfMoreTilesNeedToBePrepared();
@@ -247,6 +258,7 @@ class CC_EXPORT TileManager : public TileTaskRunnerClient,
scoped_refptr<base::SequencedTaskRunner> task_runner_;
ResourcePool* resource_pool_;
TileTaskRunner* tile_task_runner_;
+ Rasterizer* rasterizer_;
GlobalStateThatImpactsTilePriority global_state_;
size_t scheduled_raster_task_limit_;
@@ -278,6 +290,8 @@ class CC_EXPORT TileManager : public TileTaskRunnerClient,
std::vector<scoped_refptr<RasterTask>> orphan_raster_tasks_;
+ UniqueNotifier ready_to_activate_notifier_;
+ UniqueNotifier ready_to_draw_notifier_;
UniqueNotifier ready_to_activate_check_notifier_;
UniqueNotifier ready_to_draw_check_notifier_;
UniqueNotifier more_tiles_need_prepare_check_notifier_;

Powered by Google App Engine
This is Rietveld 408576698