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

Unified Diff: cc/layers/layer_impl.cc

Issue 2026033002: cc: Remove can_use_lcd_text from draw properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 7 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
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/picture_layer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index c0badc3bd70ab98621bc2eec3dbb1ba0c42fdaef..8d1d2e4a10c28619e7e070757c649acd058f5b03 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -1192,7 +1192,7 @@ void LayerImpl::AsValueInto(base::trace_event::TracedValue* state) const {
state->EndDictionary();
}
- state->SetBoolean("can_use_lcd_text", can_use_lcd_text());
+ state->SetBoolean("can_use_lcd_text", CanUseLCDText());
state->SetBoolean("contents_opaque", contents_opaque());
state->SetBoolean("has_animation_bounds",
@@ -1268,6 +1268,33 @@ gfx::Transform LayerImpl::ScreenSpaceTransform() const {
return draw_properties().screen_space_transform;
}
+bool LayerImpl::CanUseLCDText() const {
+ if (layer_tree_impl()->settings().layers_always_allowed_lcd_text)
+ return true;
+ if (!layer_tree_impl()->settings().can_use_lcd_text)
+ return false;
+ if (!contents_opaque())
+ return false;
+
+ if (layer_tree_impl()
+ ->property_trees()
+ ->effect_tree.Node(effect_tree_index())
+ ->data.screen_space_opacity != 1.f)
+ return false;
+ if (!layer_tree_impl()
+ ->property_trees()
+ ->transform_tree.Node(transform_tree_index())
+ ->data.node_and_ancestors_have_only_integer_translation)
+ return false;
+ if (static_cast<int>(offset_to_transform_parent().x()) !=
+ offset_to_transform_parent().x())
+ return false;
+ if (static_cast<int>(offset_to_transform_parent().y()) !=
+ offset_to_transform_parent().y())
+ return false;
+ return true;
+}
+
Region LayerImpl::GetInvalidationRegionForDebugging() {
return Region(update_rect_);
}
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/picture_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698