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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 880693002: cc: Refactor additional code from BuildRasterQueue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« cc/resources/tile_manager.cc ('K') | « cc/trees/layer_tree_host_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 43513e79f4d9b370bcd386e9ab86c7493c888fee..4742dc1826230fadf8e37067e024535ff1c2a9af 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -229,7 +229,7 @@ LayerTreeHostImpl::LayerTreeHostImpl(
gpu_memory_buffer_manager_(gpu_memory_buffer_manager),
id_(id),
requires_high_res_to_draw_(false),
- required_for_draw_tile_is_top_of_raster_queue_(false) {
+ is_likely_to_require_a_draw_(false) {
DCHECK(proxy_->IsImplThread());
DidVisibilityChange(this, visible_);
animation_registrar_->set_supports_scroll_animations(
@@ -1202,20 +1202,6 @@ scoped_ptr<RasterTilePriorityQueue> LayerTreeHostImpl::BuildRasterQueue(
GetPictureLayerImplPairs(&picture_layer_pairs_, true);
scoped_ptr<RasterTilePriorityQueue> queue(RasterTilePriorityQueue::Create(
picture_layer_pairs_, tree_priority, type));
-
- if (!queue->IsEmpty()) {
- // Only checking the Top() tile here isn't a definite answer that there is
- // or isn't something required for draw in this raster queue. It's just a
- // heuristic to let us hit the common case and proactively tell the
- // scheduler that we expect to draw within each vsync until we get all the
- // tiles ready to draw. If we happen to miss a required for draw tile here,
- // then we will miss telling the scheduler each frame that we intend to draw
- // so it may make worse scheduling decisions.
- required_for_draw_tile_is_top_of_raster_queue_ =
- queue->Top()->required_for_draw();
- } else {
- required_for_draw_tile_is_top_of_raster_queue_ = false;
- }
return queue;
}
@@ -1229,6 +1215,15 @@ scoped_ptr<EvictionTilePriorityQueue> LayerTreeHostImpl::BuildEvictionQueue(
return queue;
}
+void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
+ bool is_likely_to_require_a_draw) {
+ // Proactively tell the scheduler that we expect to draw within each vsync
+ // until we get all the tiles ready to draw. If we happen to miss a required
+ // for draw tile here, then we will miss telling the scheduler each frame that
+ // we intend to draw so it may make worse scheduling decisions.
+ is_likely_to_require_a_draw_ = is_likely_to_require_a_draw;
+}
+
const std::vector<PictureLayerImpl*>& LayerTreeHostImpl::GetPictureLayers()
const {
return picture_layers_;
@@ -1242,7 +1237,7 @@ void LayerTreeHostImpl::NotifyReadyToDraw() {
// Tiles that are ready will cause NotifyTileStateChanged() to be called so we
// don't need to schedule a draw here. Just stop WillBeginImplFrame() from
// causing optimistic requests to draw a frame.
- required_for_draw_tile_is_top_of_raster_queue_ = false;
+ is_likely_to_require_a_draw_ = false;
client_->NotifyReadyToDraw();
}
@@ -1612,7 +1607,7 @@ void LayerTreeHostImpl::WillBeginImplFrame(const BeginFrameArgs& args) {
// Cache the begin impl frame interval
begin_impl_frame_interval_ = args.interval;
- if (required_for_draw_tile_is_top_of_raster_queue_) {
+ if (is_likely_to_require_a_draw_) {
// Optimistically schedule a draw, as a tile required for draw is at the top
// of the current raster queue. This will let us expect the tile to complete
// and draw it within the impl frame we are beginning now.
« cc/resources/tile_manager.cc ('K') | « cc/trees/layer_tree_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698