diff options
author | whunt@chromium.org <whunt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-02 01:51:58 +0000 |
---|---|---|
committer | whunt@chromium.org <whunt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-02 01:51:58 +0000 |
commit | a3bca5f30e0148527b5a2268fb2b4457e3c3d88a (patch) | |
tree | 38f0ae322deb235be1a24ed0a4e9b9334e04cefa /cc/tile_manager.h | |
parent | dc6c55257f665c63e3fd10fa3610bd097ec1e880 (diff) | |
download | chromium_src-a3bca5f30e0148527b5a2268fb2b4457e3c3d88a.zip chromium_src-a3bca5f30e0148527b5a2268fb2b4457e3c3d88a.tar.gz chromium_src-a3bca5f30e0148527b5a2268fb2b4457e3c3d88a.tar.bz2 |
A host of micro-optimizations and a refactor of TimeForBoundsToIntersect
I used perf to profile the compositor thread and addressed performance problems
with the top fuctions. The result is about a 2.5x performance boost.
(~1.3ms -> ~.5ms) on List of Pokemon for UpdateTilePriorities.
Most of the optimizations are inlining small functions. The refactor of
TimeForBoundsToIntersect also eliminates many unnecessary float-double
conversions.
BUG=172406
NOTRY=true
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=179770
Review URL: https://chromiumcodereview.appspot.com/12084031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180229 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/tile_manager.h')
-rw-r--r-- | cc/tile_manager.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/cc/tile_manager.h b/cc/tile_manager.h index 46d374e..d537079 100644 --- a/cc/tile_manager.h +++ b/cc/tile_manager.h @@ -118,13 +118,22 @@ class CC_EXPORT TileManager { void RegisterTile(Tile* tile); void UnregisterTile(Tile* tile); void WillModifyTilePriority( - Tile* tile, WhichTree tree, const TilePriority& new_priority); + Tile* tile, WhichTree tree, const TilePriority& new_priority) { + // TODO(nduca): Do something smarter if reprioritization turns out to be + // costly. + ScheduleManageTiles(); + } private: void SortTiles(); void AssignGpuMemoryToTiles(); void FreeResourcesForTile(Tile* tile); - void ScheduleManageTiles(); + void ScheduleManageTiles() { + if (manage_tiles_pending_) + return; + client_->ScheduleManageTiles(); + manage_tiles_pending_ = true; + } void DispatchMoreTasks(); void GatherPixelRefsForTile(Tile* tile); void DispatchImageDecodeTasksForTile(Tile* tile); |