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

Unified Diff: cc/resources/tile_manager.h

Issue 839143002: Roll Chrome into Mojo. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Rebase Created 5 years, 11 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/tile_draw_info.h ('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 2bf1e66dede4bec19fb00392578ed56029b0bfdd..3ae97159828a35e11f9dcfb4f02521e663b79a3f 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 {
@@ -89,19 +90,23 @@ class CC_EXPORT TileManager : public TileTaskRunnerClient,
public RefCountedManager<Tile> {
public:
enum NamedTaskSet {
- ALL,
REQUIRED_FOR_ACTIVATION,
- REQUIRED_FOR_DRAW
+ REQUIRED_FOR_DRAW,
+ // PixelBufferTileTaskWorkerPool depends on ALL being last.
+ ALL
// Adding additional values requires increasing kNumberOfTaskSets in
// 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);
+ COMPILE_ASSERT(NamedTaskSet::ALL == (kNumberOfTaskSets - 1),
+ NamedTaskSet_ALL_not_kNumberOfTaskSets_minus_1);
+
+ 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,10 +116,10 @@ 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,
+ const gfx::Size& desired_texture_size,
const gfx::Rect& content_rect,
float contents_scale,
int layer_id,
@@ -131,7 +136,8 @@ class CC_EXPORT TileManager : public TileTaskRunnerClient,
void InitializeTilesWithResourcesForTesting(const std::vector<Tile*>& tiles) {
for (size_t i = 0; i < tiles.size(); ++i) {
TileDrawInfo& draw_info = tiles[i]->draw_info();
- draw_info.resource_ = resource_pool_->AcquireResource(tiles[i]->size());
+ draw_info.resource_ =
+ resource_pool_->AcquireResource(tiles[i]->desired_texture_size());
}
}
@@ -172,6 +178,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 +199,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 {
@@ -222,6 +234,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 +254,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 +264,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 +296,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/tile_draw_info.h ('k') | cc/resources/tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698