Commit c0af6167 authored by Victor Miura's avatar Victor Miura Committed by Commit Bot

Optimize PictureLayerTilingSet::visible_rect_history_ type.

Appending entries to visible_rect_history was a hotspot in profiling.
Changing to std::deque, and re-ordering the update code so the deque
only grows to 2 entries rather than 3.

BUG=879668

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I576ba0ae278a04a0e7336b3b1cd589fadd25b177
Reviewed-on: https://chromium-review.googlesource.com/1200466Reviewed-by: default avatarEric Karl <ericrk@chromium.org>
Commit-Queue: Victor Miura <vmiura@chromium.org>
Cr-Commit-Position: refs/heads/master@{#588238}
parent 8fce8ab1
...@@ -514,10 +514,10 @@ void PictureLayerTilingSet::UpdatePriorityRects( ...@@ -514,10 +514,10 @@ void PictureLayerTilingSet::UpdatePriorityRects(
// Finally, update our visible rect history. Note that we use the original // Finally, update our visible rect history. Note that we use the original
// visible rect here, since we want as accurate of a history as possible for // visible rect here, since we want as accurate of a history as possible for
// stable skewports. // stable skewports.
if (visible_rect_history_.size() == 2)
visible_rect_history_.pop_back();
visible_rect_history_.push_front(FrameVisibleRect( visible_rect_history_.push_front(FrameVisibleRect(
visible_rect_in_layer_space_, current_frame_time_in_seconds)); visible_rect_in_layer_space_, current_frame_time_in_seconds));
if (visible_rect_history_.size() > 2)
visible_rect_history_.pop_back();
} }
bool PictureLayerTilingSet::UpdateTilePriorities( bool PictureLayerTilingSet::UpdateTilePriorities(
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include <stddef.h> #include <stddef.h>
#include <list> #include <deque>
#include <set> #include <set>
#include <vector> #include <vector>
...@@ -250,8 +250,8 @@ class CC_EXPORT PictureLayerTilingSet { ...@@ -250,8 +250,8 @@ class CC_EXPORT PictureLayerTilingSet {
PictureLayerTilingClient* client_; PictureLayerTilingClient* client_;
const float max_preraster_distance_; const float max_preraster_distance_;
// State saved for computing velocities based on finite differences. // State saved for computing velocities based on finite differences.
// .front() of the list refers to the most recent FrameVisibleRect. // .front() of the deque refers to the most recent FrameVisibleRect.
std::list<FrameVisibleRect> visible_rect_history_; std::deque<FrameVisibleRect> visible_rect_history_;
StateSinceLastTilePriorityUpdate state_since_last_tile_priority_update_; StateSinceLastTilePriorityUpdate state_since_last_tile_priority_update_;
scoped_refptr<RasterSource> raster_source_; scoped_refptr<RasterSource> raster_source_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment