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

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: override added :( Created 5 years, 12 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/resources/software_rasterizer.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 7aa06da4091a6665f8e63d35ad129123615a71b5..08f981ee91fa5e02c7132817205d610b709e9123 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& desired_texture_size,
@@ -173,6 +174,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();
@@ -193,7 +195,12 @@ 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,
+ bool required_for_draw_only);
+
+ void SynchronouslyRasterizeTiles(
+ const GlobalStateThatImpactsTilePriority& state);
private:
class MemoryUsage {
@@ -223,6 +230,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);
@@ -240,6 +250,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();
@@ -248,6 +260,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_;
@@ -279,6 +292,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_;
« no previous file with comments | « cc/resources/software_rasterizer.cc ('k') | cc/resources/tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698