diff options
author | reveman@google.com <reveman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-14 06:57:15 +0000 |
---|---|---|
committer | reveman@google.com <reveman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-14 06:57:15 +0000 |
commit | 150c970710a892e40ea148c6c8293e7b67650052 (patch) | |
tree | 355dc66aeea1eddc30293618013b24c77d1f1205 /cc/tile_manager.h | |
parent | 6e2a612da9dc1f5c6e814bef2461a8781f7390a9 (diff) | |
download | chromium_src-150c970710a892e40ea148c6c8293e7b67650052.zip chromium_src-150c970710a892e40ea148c6c8293e7b67650052.tar.gz chromium_src-150c970710a892e40ea148c6c8293e7b67650052.tar.bz2 |
cc: Check for completed raster tasks at interval.
This significantly reduces the context switching overhead for
impl-side painting.
Instead of posting reply task to the impl thread after completing
each raster job, post a reply only when worker pool becomes idle
and poll for completed tasks at a 6ms interval.
This doesn't just make rasterization more efficient but also
reduces the number of shallow flushes, which makes async uploads
more efficient.
BUG=173802
Review URL: https://codereview.chromium.org/12217105
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182404 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/tile_manager.h')
-rw-r--r-- | cc/tile_manager.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/cc/tile_manager.h b/cc/tile_manager.h index c031582..1e0de2e 100644 --- a/cc/tile_manager.h +++ b/cc/tile_manager.h @@ -17,6 +17,7 @@ #include "cc/rendering_stats.h" #include "cc/resource_pool.h" #include "cc/tile_priority.h" +#include "cc/worker_pool.h" namespace cc { class RasterWorkerPool; @@ -102,7 +103,7 @@ class CC_EXPORT ManagedTileState { // should no longer have any memory assigned to them. Tile objects are "owned" // by layers; they automatically register with the manager when they are // created, and unregister from the manager when they are deleted. -class CC_EXPORT TileManager { +class CC_EXPORT TileManager : public WorkerPoolClient { public: TileManager(TileManagerClient* client, ResourceProvider *resource_provider, @@ -128,7 +129,12 @@ class CC_EXPORT TileManager { void GetRenderingStats(RenderingStats* stats); bool HasPendingWorkScheduled(WhichTree tree) const; - const MemoryHistory::Entry& memory_stats_from_last_assign() const { return memory_stats_from_last_assign_; } + const MemoryHistory::Entry& memory_stats_from_last_assign() const { + return memory_stats_from_last_assign_; + } + + // Overridden from WorkerPoolClient: + virtual void DidFinishDispatchingWorkerPoolCompletionCallbacks() OVERRIDE; protected: // Methods called by Tile @@ -158,7 +164,8 @@ class CC_EXPORT TileManager { void DispatchOneImageDecodeTask( scoped_refptr<Tile> tile, skia::LazyPixelRef* pixel_ref); void OnImageDecodeTaskCompleted( - scoped_refptr<Tile> tile, uint32_t pixel_ref_id); + scoped_refptr<Tile> tile, + uint32_t pixel_ref_id); bool CanDispatchRasterTask(Tile* tile); scoped_ptr<ResourcePool::Resource> PrepareTileForRaster(Tile* tile); void DispatchOneRasterTask(scoped_refptr<Tile> tile); @@ -216,6 +223,7 @@ class CC_EXPORT TileManager { typedef std::queue<scoped_refptr<Tile> > TileQueue; TileQueue tiles_with_pending_set_pixels_; size_t bytes_pending_set_pixels_; + bool has_performed_uploads_since_last_flush_; bool ever_exceeded_memory_budget_; MemoryHistory::Entry memory_stats_from_last_assign_; |