Chromium Code Reviews| 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..258a5725a0cbc6ce33110e7b0c8b79571a6e2549 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), |
| @@ -647,6 +648,25 @@ bool LayerTreeImpl::UpdateDrawProperties() { |
| occlusion_tracker.ComputeVisibleRegionInScreen(); |
| } |
| + // It'd be ideal if this could be done earlier, but when the raster source |
| + // 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_) { |
|
danakj
2015/02/18 19:54:47
Mmmmmmh. What if we instead pass a bool to UDP() t
enne (OOO)
2015/02/18 19:59:05
Since there's UDP called at different times on dif
|
| + for (const auto& layer : picture_layers_) |
| + layer->UpdateCanUseLCDTextAfterCommit(); |
| + } |
| + last_update_draw_properties_frame_number_ = source_frame_number_; |
| + |
| { |
| TRACE_EVENT_BEGIN2("cc", "LayerTreeImpl::UpdateDrawProperties::UpdateTiles", |
| "IsActive", IsActiveTree(), "SourceFrameNumber", |
| @@ -859,6 +879,10 @@ bool LayerTreeImpl::IsRecycleTree() const { |
| return layer_tree_host_impl_->recycle_tree() == this; |
| } |
| +bool LayerTreeImpl::IsSyncTree() const { |
| + return layer_tree_host_impl_->sync_tree() == this; |
| +} |
| + |
| LayerImpl* LayerTreeImpl::FindActiveTreeLayerById(int id) { |
| LayerTreeImpl* tree = layer_tree_host_impl_->active_tree(); |
| if (!tree) |