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

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: Param passed to UDP 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
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..583c412726b96ad2ffb08226d6997cebb304412b 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -534,7 +534,7 @@ void LayerTreeImpl::ClearViewportLayers() {
outer_viewport_scroll_layer_ = NULL;
}
-bool LayerTreeImpl::UpdateDrawProperties() {
+bool LayerTreeImpl::UpdateDrawProperties(bool update_lcd_text) {
if (!needs_update_draw_properties_)
return true;
@@ -647,6 +647,23 @@ 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 && update_lcd_text) {
danakj 2015/02/18 21:51:46 Can DCHECK this == sync_tree when update_lcd_text
enne (OOO) 2015/02/18 22:16:07 Done.
+ for (const auto& layer : picture_layers_)
+ layer->UpdateCanUseLCDTextAfterCommit();
+ }
+
{
TRACE_EVENT_BEGIN2("cc", "LayerTreeImpl::UpdateDrawProperties::UpdateTiles",
"IsActive", IsActiveTree(), "SourceFrameNumber",
@@ -859,6 +876,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)
@@ -1461,7 +1482,8 @@ LayerImpl* LayerTreeImpl::FindLayerThatIsHitByPoint(
const gfx::PointF& screen_space_point) {
if (!root_layer())
return NULL;
- if (!UpdateDrawProperties())
+ bool update_lcd_text = false;
+ if (!UpdateDrawProperties(update_lcd_text))
return NULL;
FindClosestMatchingLayerDataForRecursion data_for_recursion;
FindClosestMatchingLayer(screen_space_point,
@@ -1503,7 +1525,8 @@ LayerImpl* LayerTreeImpl::FindLayerWithWheelHandlerThatIsHitByPoint(
const gfx::PointF& screen_space_point) {
if (!root_layer())
return NULL;
- if (!UpdateDrawProperties())
+ bool update_lcd_text = false;
+ if (!UpdateDrawProperties(update_lcd_text))
return NULL;
FindWheelEventLayerFunctor func;
FindClosestMatchingLayerDataForRecursion data_for_recursion;
@@ -1523,7 +1546,8 @@ LayerImpl* LayerTreeImpl::FindLayerThatIsHitByPointInTouchHandlerRegion(
const gfx::PointF& screen_space_point) {
if (!root_layer())
return NULL;
- if (!UpdateDrawProperties())
+ bool update_lcd_text = false;
+ if (!UpdateDrawProperties(update_lcd_text))
return NULL;
FindTouchEventLayerFunctor func = {screen_space_point};
FindClosestMatchingLayerDataForRecursion data_for_recursion;

Powered by Google App Engine
This is Rietveld 408576698