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

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: Added support for dependencies and tests. 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 cdf1f3d3b9fb8e6d8d789099fba73ff39bf22c6c..e11519c26d3921c13e72b2fd8ed05db6845a69ee 100644
--- a/cc/resources/tile_manager.h
+++ b/cc/resources/tile_manager.h
@@ -5,9 +5,7 @@
#ifndef CC_RESOURCES_TILE_MANAGER_H_
#define CC_RESOURCES_TILE_MANAGER_H_
-#include <list>
#include <queue>
-#include <set>
#include <vector>
#include "base/hash_tables.h"
@@ -61,6 +59,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;
+
static scoped_ptr<TileManager> Create(
TileManagerClient* client,
ResourceProvider* resource_provider,
@@ -113,7 +113,7 @@ class CC_EXPORT TileManager : public WorkerPoolClient {
}
// Virtual for test
- virtual void DispatchMoreTasks();
+ virtual void ScheduleTasks();
private:
// Data that is passed to raster tasks.
@@ -126,8 +126,6 @@ class CC_EXPORT TileManager : public WorkerPoolClient {
int source_frame_number;
};
- RasterTaskMetadata GetRasterTaskMetadata(const Tile& tile) const;
-
void AssignBinsToTiles();
void SortTiles();
void AssignGpuMemoryToTiles();
@@ -138,29 +136,32 @@ 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);
+ 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,
+ int layer_id,
+ 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,
@@ -178,16 +179,11 @@ class CC_EXPORT TileManager : public WorkerPoolClient {
const RasterTaskMetadata& metadata,
RenderingStatsInstrumentation* stats_instrumentation,
PicturePileImpl* picture_pile);
- static void RunImageDecodeTask(
- skia::LazyPixelRef* pixel_ref,
- int layer_id,
- RenderingStatsInstrumentation* stats_instrumentation);
TileManagerClient* client_;
scoped_ptr<ResourcePool> resource_pool_;
scoped_ptr<RasterWorkerPool> raster_worker_pool_;
bool manage_tiles_pending_;
- int manage_tiles_call_count_;
GlobalStateThatImpactsTilePriority global_state_;
@@ -195,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_;
@@ -210,7 +206,6 @@ class CC_EXPORT TileManager : public WorkerPoolClient {
bool use_color_estimator_;
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