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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 1457803003: cc:: Don't use cached screen space transform for layers not in RSLL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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_impl.cc ('K') | « cc/trees/layer_tree_host_impl.cc ('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 25ec5dbda5e46e7767f11469d800dab8c9a1e306..596476081d1b175e64dcaf8246c6b47f83d837ad 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -548,6 +548,20 @@ gfx::SizeF LayerTreeImpl::ScrollableViewportSize() const {
1.0f / current_page_scale_factor());
}
+static const gfx::Transform LayerScreenSpaceTransform(
+ const LayerImpl* layer,
+ const TransformTree& transform_tree,
+ const bool use_property_trees) {
+ if (!use_property_trees)
+ return layer->screen_space_transform();
+ // When we use property trees, UpdateDrawProperties does not update the draw
+ // properties of a layer that is not in render surface layer list, so we need
+ // to compute the screen space transform.
+ return layer->IsDrawnRenderSurfaceLayerListMember()
+ ? layer->screen_space_transform()
+ : ScreenSpaceTransformFromPropertyTrees(layer, transform_tree);
+}
+
gfx::Rect LayerTreeImpl::RootScrollLayerDeviceViewportBounds() const {
LayerImpl* root_scroll_layer = OuterViewportScrollLayer()
? OuterViewportScrollLayer()
@@ -555,8 +569,12 @@ gfx::Rect LayerTreeImpl::RootScrollLayerDeviceViewportBounds() const {
if (!root_scroll_layer || root_scroll_layer->children().empty())
return gfx::Rect();
LayerImpl* layer = root_scroll_layer->children()[0].get();
- return MathUtil::MapEnclosingClippedRect(layer->screen_space_transform(),
- gfx::Rect(layer->bounds()));
+ bool use_property_trees =
+ settings().verify_property_trees || settings().use_property_trees;
+ return MathUtil::MapEnclosingClippedRect(
+ LayerScreenSpaceTransform(layer, property_trees_.transform_tree,
+ use_property_trees),
+ gfx::Rect(layer->bounds()));
}
void LayerTreeImpl::ApplySentScrollAndScaleDeltasFromAbortedCommit() {
@@ -1390,20 +1408,6 @@ static const LayerImpl* GetNextClippingLayer(const LayerImpl* layer) {
return layer->parent();
}
-static const gfx::Transform LayerScreenSpaceTransform(
- const LayerImpl* layer,
- const TransformTree& transform_tree,
- const bool use_property_trees) {
- if (!use_property_trees)
- return layer->screen_space_transform();
- // When we use property trees, UpdateDrawProperties does not update the draw
- // properties of a layer that is not in render surface layer list, so we need
- // to compute the screen space transform.
- return layer->IsDrawnRenderSurfaceLayerListMember()
- ? layer->screen_space_transform()
- : ScreenSpaceTransformFromPropertyTrees(layer, transform_tree);
-}
-
static const gfx::Transform SurfaceScreenSpaceTransform(
const LayerImpl* layer,
const TransformTree& transform_tree,
« cc/trees/layer_tree_host_impl.cc ('K') | « cc/trees/layer_tree_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698