Index: cc/trees/layer_tree_impl.cc |
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc |
index 4093c425eb19541fc3a05651e0318a13c1313eed..b3efd3d547451564865bbcc5c2a9377eaf8dce57 100644 |
--- a/cc/trees/layer_tree_impl.cc |
+++ b/cc/trees/layer_tree_impl.cc |
@@ -81,6 +81,7 @@ LayerTreeImpl::LayerTreeImpl( |
scoped_refptr<SyncedElasticOverscroll> elastic_overscroll) |
: layer_tree_host_impl_(layer_tree_host_impl), |
source_frame_number_(-1), |
+ last_update_draw_properties_frame_number_(-1), |
hud_layer_(0), |
currently_scrolling_layer_(NULL), |
root_layer_scroll_offset_delegate_(NULL), |
@@ -582,6 +583,25 @@ bool LayerTreeImpl::UpdateDrawProperties() { |
occlusion_tracker.set_minimum_tracking_size( |
settings().minimum_occlusion_tracking_size); |
+ // It'd be ideal if this could be done earlier, but when the raster source |
danakj
2015/02/18 01:25:52
Can you move this out of the ::Occlusion {}? Maybe
enne (OOO)
2015/02/18 19:43:05
Done.
|
+ // is updated from the main thread during push properties, update draw |
+ // properties has not occurred yet and so it's not clear whether or not the |
+ // layer can or cannot use lcd text. So, this is the cleanup pass to |
+ // determine if the raster source needs to be replaced with a non-lcd |
+ // raster source due to draw properties. |
+ // |
+ // TODO(enne): Make LTHI::sync_tree return this value. |
+ LayerTreeImpl* sync_tree = |
+ layer_tree_host_impl_->proxy()->CommitToActiveTree() |
+ ? layer_tree_host_impl_->active_tree() |
+ : layer_tree_host_impl_->pending_tree(); |
+ if (this == sync_tree && |
+ source_frame_number_ != last_update_draw_properties_frame_number_) { |
+ for (const auto& layer : picture_layers_) |
+ layer->UpdateCanUseLCDText(); |
+ } |
+ last_update_draw_properties_frame_number_ = source_frame_number_; |
+ |
// LayerIterator is used here instead of CallFunctionForSubtree to only |
// UpdateTilePriorities on layers that will be visible (and thus have valid |
// draw properties) and not because any ordering is required. |