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

Side by Side Diff: cc/trees/layer_tree_host_impl_unittest.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 unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 4723 matching lines...) Expand 10 before | Expand all | Expand 10 after
4734 4734
4735 // The root scroll layer should not have scrolled, because the input delta 4735 // The root scroll layer should not have scrolled, because the input delta
4736 // was close to the layer's axis of movement. 4736 // was close to the layer's axis of movement.
4737 EXPECT_EQ(scroll_info->scrolls.size(), 1u); 4737 EXPECT_EQ(scroll_info->scrolls.size(), 1u);
4738 } 4738 }
4739 } 4739 }
4740 4740
4741 TEST_F(LayerTreeHostImplTest, ScrollScaledLayer) { 4741 TEST_F(LayerTreeHostImplTest, ScrollScaledLayer) {
4742 LayerImpl* scroll_layer = 4742 LayerImpl* scroll_layer =
4743 SetupScrollAndContentsLayers(gfx::Size(100, 100)); 4743 SetupScrollAndContentsLayers(gfx::Size(100, 100));
4744 scroll_layer->SetDrawsContent(true);
4745 4744
4746 // Scale the layer to twice its normal size. 4745 // Scale the layer to twice its normal size.
4747 int scale = 2; 4746 int scale = 2;
4748 gfx::Transform scale_transform; 4747 gfx::Transform scale_transform;
4749 scale_transform.Scale(scale, scale); 4748 scale_transform.Scale(scale, scale);
4750 scroll_layer->parent()->SetTransform(scale_transform); 4749 scroll_layer->parent()->SetTransform(scale_transform);
4751 4750
4752 gfx::Size surface_size(50, 50); 4751 gfx::Size surface_size(50, 50);
4753 host_impl_->SetViewportSize(surface_size); 4752 host_impl_->SetViewportSize(surface_size);
4754 DrawFrame(); 4753 DrawFrame();
(...skipping 4324 matching lines...) Expand 10 before | Expand all | Expand 10 after
9079 host_impl_->active_tree()->SetPageScaleOnActiveTree(2.f); 9078 host_impl_->active_tree()->SetPageScaleOnActiveTree(2.f);
9080 DrawFrame(); 9079 DrawFrame();
9081 in_subtree_of_page_scale_layer = host_impl_->active_tree()->LayerById(100); 9080 in_subtree_of_page_scale_layer = host_impl_->active_tree()->LayerById(100);
9082 node = host_impl_->active_tree()->property_trees()->transform_tree.Node( 9081 node = host_impl_->active_tree()->property_trees()->transform_tree.Node(
9083 in_subtree_of_page_scale_layer->transform_tree_index()); 9082 in_subtree_of_page_scale_layer->transform_tree_index());
9084 EXPECT_EQ(node->data.sublayer_scale, gfx::Vector2dF(2.f, 2.f)); 9083 EXPECT_EQ(node->data.sublayer_scale, gfx::Vector2dF(2.f, 2.f));
9085 } 9084 }
9086 9085
9087 } // namespace 9086 } // namespace
9088 } // namespace cc 9087 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698