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

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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 reduce_memory_result_(true) { 93 reduce_memory_result_(true) {
94 media::InitializeMediaLibrary(); 94 media::InitializeMediaLibrary();
95 } 95 }
96 96
97 LayerTreeSettings DefaultSettings() { 97 LayerTreeSettings DefaultSettings() {
98 LayerTreeSettings settings; 98 LayerTreeSettings settings;
99 settings.minimum_occlusion_tracking_size = gfx::Size(); 99 settings.minimum_occlusion_tracking_size = gfx::Size();
100 settings.renderer_settings.texture_id_allocation_chunk_size = 1; 100 settings.renderer_settings.texture_id_allocation_chunk_size = 1;
101 settings.gpu_rasterization_enabled = true; 101 settings.gpu_rasterization_enabled = true;
102 settings.verify_property_trees = true; 102 settings.verify_property_trees = true;
103 settings.use_property_trees = true;
ajuma 2015/11/19 01:52:04 I'd prefer removing this and leaving the settings
103 return settings; 104 return settings;
104 } 105 }
105 106
106 void SetUp() override { 107 void SetUp() override {
107 CreateHostImpl(DefaultSettings(), CreateOutputSurface()); 108 CreateHostImpl(DefaultSettings(), CreateOutputSurface());
108 } 109 }
109 110
110 void TearDown() override {} 111 void TearDown() override {}
111 112
112 void UpdateRendererCapabilitiesOnImplThread() override {} 113 void UpdateRendererCapabilitiesOnImplThread() override {}
(...skipping 4621 matching lines...) Expand 10 before | Expand all | Expand 10 after
4734 4735
4735 // The root scroll layer should not have scrolled, because the input delta 4736 // The root scroll layer should not have scrolled, because the input delta
4736 // was close to the layer's axis of movement. 4737 // was close to the layer's axis of movement.
4737 EXPECT_EQ(scroll_info->scrolls.size(), 1u); 4738 EXPECT_EQ(scroll_info->scrolls.size(), 1u);
4738 } 4739 }
4739 } 4740 }
4740 4741
4741 TEST_F(LayerTreeHostImplTest, ScrollScaledLayer) { 4742 TEST_F(LayerTreeHostImplTest, ScrollScaledLayer) {
4742 LayerImpl* scroll_layer = 4743 LayerImpl* scroll_layer =
4743 SetupScrollAndContentsLayers(gfx::Size(100, 100)); 4744 SetupScrollAndContentsLayers(gfx::Size(100, 100));
4744 scroll_layer->SetDrawsContent(true);
jaydasika 2015/11/19 01:10:11 We already have a lot of unit test coverage for th
4745 4745
4746 // Scale the layer to twice its normal size. 4746 // Scale the layer to twice its normal size.
4747 int scale = 2; 4747 int scale = 2;
4748 gfx::Transform scale_transform; 4748 gfx::Transform scale_transform;
4749 scale_transform.Scale(scale, scale); 4749 scale_transform.Scale(scale, scale);
4750 scroll_layer->parent()->SetTransform(scale_transform); 4750 scroll_layer->parent()->SetTransform(scale_transform);
4751 4751
4752 gfx::Size surface_size(50, 50); 4752 gfx::Size surface_size(50, 50);
4753 host_impl_->SetViewportSize(surface_size); 4753 host_impl_->SetViewportSize(surface_size);
4754 DrawFrame(); 4754 DrawFrame();
(...skipping 4324 matching lines...) Expand 10 before | Expand all | Expand 10 after
9079 host_impl_->active_tree()->SetPageScaleOnActiveTree(2.f); 9079 host_impl_->active_tree()->SetPageScaleOnActiveTree(2.f);
9080 DrawFrame(); 9080 DrawFrame();
9081 in_subtree_of_page_scale_layer = host_impl_->active_tree()->LayerById(100); 9081 in_subtree_of_page_scale_layer = host_impl_->active_tree()->LayerById(100);
9082 node = host_impl_->active_tree()->property_trees()->transform_tree.Node( 9082 node = host_impl_->active_tree()->property_trees()->transform_tree.Node(
9083 in_subtree_of_page_scale_layer->transform_tree_index()); 9083 in_subtree_of_page_scale_layer->transform_tree_index());
9084 EXPECT_EQ(node->data.sublayer_scale, gfx::Vector2dF(2.f, 2.f)); 9084 EXPECT_EQ(node->data.sublayer_scale, gfx::Vector2dF(2.f, 2.f));
9085 } 9085 }
9086 9086
9087 } // namespace 9087 } // namespace
9088 } // namespace cc 9088 } // 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