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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 913203006: cc: Calculate "can use lcd text" on the compositor thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/trees/layer_tree_host.cc ('K') | « cc/trees/layer_tree_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_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.
« cc/trees/layer_tree_host.cc ('K') | « cc/trees/layer_tree_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698