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

Unified Diff: cc/tiles/tile_manager.h

Issue 2726343004: cc: Optimize decode scheduling for checker-images. (Closed)
Patch Set: rebase Created 3 years, 8 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/tiles/tile_draw_info.cc ('k') | cc/tiles/tile_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/tile_manager.h
diff --git a/cc/tiles/tile_manager.h b/cc/tiles/tile_manager.h
index 6db6cd74a7dcc93964ba79afb93b6674377abacd..cfff719c320c0cf681315b178277bfd63636844e 100644
--- a/cc/tiles/tile_manager.h
+++ b/cc/tiles/tile_manager.h
@@ -164,10 +164,12 @@ class CC_EXPORT TileManager : CheckerImageTrackerClient {
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.set_resource(resource_pool_->AcquireResource(
- tiles[i]->desired_texture_size(),
- raster_buffer_provider_->GetResourceFormat(false),
- client_->GetRasterColorSpace()));
+ draw_info.set_resource(
+ resource_pool_->AcquireResource(
+ tiles[i]->desired_texture_size(),
+ raster_buffer_provider_->GetResourceFormat(false),
+ client_->GetRasterColorSpace()),
+ false);
draw_info.set_resource_ready_for_draw();
}
}
@@ -235,6 +237,9 @@ class CC_EXPORT TileManager : CheckerImageTrackerClient {
ActivationStateAsValue();
void ActivationStateAsValueInto(base::trace_event::TracedValue* state);
+ int num_of_tiles_with_checker_images() const {
+ return num_of_tiles_with_checker_images_;
+ }
protected:
friend class Tile;
@@ -283,13 +288,15 @@ class CC_EXPORT TileManager : CheckerImageTrackerClient {
std::vector<PrioritizedTile> tiles_to_raster;
std::vector<PrioritizedTile> tiles_to_process_for_images;
+ CheckerImageTracker::ImageDecodeQueue checker_image_decode_queue;
};
void FreeResourcesForTile(Tile* tile);
void FreeResourcesForTileAndNotifyClientIfTileWasReadyToDraw(Tile* tile);
scoped_refptr<TileTask> CreateRasterTask(
const PrioritizedTile& prioritized_tile,
- const gfx::ColorSpace& color_space);
+ const gfx::ColorSpace& color_space,
+ CheckerImageTracker::ImageDecodeQueue* checker_image_decode_queue);
std::unique_ptr<EvictionTilePriorityQueue>
FreeTileResourcesUntilUsageIsWithinLimit(
@@ -321,6 +328,16 @@ class CC_EXPORT TileManager : CheckerImageTrackerClient {
PrioritizedWorkToSchedule AssignGpuMemoryToTiles();
void ScheduleTasks(const PrioritizedWorkToSchedule& work_to_schedule);
+ void PartitionImagesForCheckering(
+ const PrioritizedTile& prioritized_tile,
+ const gfx::ColorSpace& raster_color_space,
+ std::vector<DrawImage>* sync_decoded_images,
+ std::vector<sk_sp<const SkImage>>* checkered_images);
+ void AddCheckeredImagesToDecodeQueue(
+ const PrioritizedTile& prioritized_tile,
+ const gfx::ColorSpace& raster_color_space,
+ CheckerImageTracker::ImageDecodeQueue* image_decode_queue);
+
std::unique_ptr<base::trace_event::ConvertableToTraceFormat>
ScheduledTasksStateAsValue() const;
@@ -375,6 +392,10 @@ class CC_EXPORT TileManager : CheckerImageTrackerClient {
std::unordered_map<Tile::Id, std::vector<DrawImage>> scheduled_draw_images_;
std::vector<scoped_refptr<TileTask>> locked_image_tasks_;
+ // Number of tiles with a checker-imaged resource or active raster tasks which
+ // will create a checker-imaged resource.
+ int num_of_tiles_with_checker_images_ = 0;
+
// We need two WeakPtrFactory objects as the invalidation pattern of each is
// different. The |task_set_finished_weak_ptr_factory_| is invalidated any
// time new tasks are scheduled, preventing a race when the callback has
« no previous file with comments | « cc/tiles/tile_draw_info.cc ('k') | cc/tiles/tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698