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

Unified Diff: cc/resources/tile_manager.h

Issue 14689004: Re-land: cc: Cancel and re-prioritize worker pool tasks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move alignment check to RP Created 7 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
Index: cc/resources/tile_manager.h
diff --git a/cc/resources/tile_manager.h b/cc/resources/tile_manager.h
index 125dd8ad6c33b01a4538dc56d0ea5ef0b3b388a0..5bcf09be187bc4d55677ffdca6b7645bf045bbc7 100644
--- a/cc/resources/tile_manager.h
+++ b/cc/resources/tile_manager.h
@@ -61,6 +61,8 @@ scoped_ptr<base::Value> TileManagerBinPriorityAsValue(
// created, and unregister from the manager when they are deleted.
class CC_EXPORT TileManager : public WorkerPoolClient {
public:
+ typedef base::hash_set<uint32_t> PixelRefSet;
+
TileManager(TileManagerClient* client,
ResourceProvider *resource_provider,
size_t num_raster_threads,
@@ -105,7 +107,7 @@ class CC_EXPORT TileManager : public WorkerPoolClient {
}
// Virtual for test
- virtual void DispatchMoreTasks();
+ virtual void ScheduleTasks();
private:
// Data that is passed to raster tasks.
@@ -116,8 +118,6 @@ class CC_EXPORT TileManager : public WorkerPoolClient {
int layer_id;
};
- RasterTaskMetadata GetRasterTaskMetadata(const Tile& tile) const;
-
void AssignBinsToTiles();
void SortTiles();
void AssignGpuMemoryToTiles();
@@ -128,29 +128,35 @@ class CC_EXPORT TileManager : public WorkerPoolClient {
client_->ScheduleManageTiles();
manage_tiles_pending_ = true;
}
- bool DispatchImageDecodeTasksForTile(Tile* tile);
- void DispatchOneImageDecodeTask(
- scoped_refptr<Tile> tile, skia::LazyPixelRef* pixel_ref);
+ bool ScheduleImageDecodeTasks(
+ RasterWorkerPool::Task::Queue* task_queue,
+ PixelRefSet* decode_tasks,
+ Tile* tile);
+ RasterWorkerPool::Task CreateImageDecodeTask(
+ Tile* tile, skia::LazyPixelRef* pixel_ref);
void OnImageDecodeTaskCompleted(
scoped_refptr<Tile> tile,
- uint32_t pixel_ref_id);
- bool CanDispatchRasterTask(Tile* tile) const;
- scoped_ptr<ResourcePool::Resource> PrepareTileForRaster(Tile* tile);
- void DispatchOneRasterTask(scoped_refptr<Tile> tile);
+ uint32_t pixel_ref_id,
+ bool was_cancelled);
+ RasterTaskMetadata GetRasterTaskMetadata(const Tile& tile) const;
+ RasterWorkerPool::Task CreateRasterTask(Tile* tile);
void OnRasterTaskCompleted(
scoped_refptr<Tile> tile,
scoped_ptr<ResourcePool::Resource> resource,
PicturePileImpl::Analysis* analysis,
- int manage_tiles_call_count_when_dispatched);
+ bool was_cancelled);
void DidFinishTileInitialization(Tile* tile);
void DidTileTreeBinChange(Tile* tile,
TileManagerBin new_tree_bin,
WhichTree tree);
scoped_ptr<Value> GetMemoryRequirementsAsValue() const;
+ static void RunImageDecodeTask(
+ skia::LazyPixelRef* pixel_ref,
+ RenderingStatsInstrumentation* stats_instrumentation);
static void RunAnalyzeAndRasterTask(
- const RasterWorkerPool::RasterCallback& analyze_task,
- const RasterWorkerPool::RasterCallback& raster_task,
+ const RasterWorkerPool::PictureTask::Callback& analyze_task,
+ const RasterWorkerPool::PictureTask::Callback& raster_task,
PicturePileImpl* picture_pile);
static void RunAnalyzeTask(
PicturePileImpl::Analysis* analysis,
@@ -168,9 +174,6 @@ class CC_EXPORT TileManager : public WorkerPoolClient {
const RasterTaskMetadata& metadata,
RenderingStatsInstrumentation* stats_instrumentation,
PicturePileImpl* picture_pile);
- static void RunImageDecodeTask(
- skia::LazyPixelRef* pixel_ref,
- RenderingStatsInstrumentation* stats_instrumentation);
static void RecordSolidColorPredictorResults(const SkPMColor* actual_colors,
size_t color_count,
@@ -181,7 +184,6 @@ class CC_EXPORT TileManager : public WorkerPoolClient {
scoped_ptr<ResourcePool> resource_pool_;
scoped_ptr<RasterWorkerPool> raster_worker_pool_;
bool manage_tiles_pending_;
- int manage_tiles_call_count_;
GlobalStateThatImpactsTilePriority global_state_;
@@ -189,8 +191,8 @@ class CC_EXPORT TileManager : public WorkerPoolClient {
TileVector tiles_;
TileVector tiles_that_need_to_be_rasterized_;
- typedef base::hash_set<uint32_t> PixelRefSet;
- PixelRefSet pending_decode_tasks_;
+ typedef base::hash_map<uint32_t, RasterWorkerPool::Task> PixelRefMap;
+ PixelRefMap pending_decode_tasks_;
typedef std::queue<scoped_refptr<Tile> > TileQueue;
TileQueue tiles_with_pending_upload_;
@@ -205,7 +207,6 @@ class CC_EXPORT TileManager : public WorkerPoolClient {
bool prediction_benchmarking_;
bool did_initialize_visible_tile_;
- size_t pending_tasks_;
size_t max_pending_tasks_;
DISALLOW_COPY_AND_ASSIGN(TileManager);

Powered by Google App Engine
This is Rietveld 408576698