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

Side by Side Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 21323002: Bring back setting visible viewport size based on cliprect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« 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 <cmath> 7 #include <cmath>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 private: 1048 private:
1049 base::TimeTicks fake_current_physical_time_; 1049 base::TimeTicks fake_current_physical_time_;
1050 }; 1050 };
1051 1051
1052 TEST_F(LayerTreeHostImplTest, ScrollbarLinearFadeScheduling) { 1052 TEST_F(LayerTreeHostImplTest, ScrollbarLinearFadeScheduling) {
1053 LayerTreeSettings settings; 1053 LayerTreeSettings settings;
1054 settings.use_linear_fade_scrollbar_animator = true; 1054 settings.use_linear_fade_scrollbar_animator = true;
1055 settings.scrollbar_linear_fade_delay_ms = 20; 1055 settings.scrollbar_linear_fade_delay_ms = 20;
1056 settings.scrollbar_linear_fade_length_ms = 20; 1056 settings.scrollbar_linear_fade_length_ms = 20;
1057 1057
1058 gfx::Size viewport_size(10, 10);
1059 gfx::Size content_size(100, 100);
1060
1058 LayerTreeHostImplOverridePhysicalTime* host_impl_override_time = 1061 LayerTreeHostImplOverridePhysicalTime* host_impl_override_time =
1059 new LayerTreeHostImplOverridePhysicalTime( 1062 new LayerTreeHostImplOverridePhysicalTime(
1060 settings, this, &proxy_, &stats_instrumentation_); 1063 settings, this, &proxy_, &stats_instrumentation_);
1061 host_impl_ = make_scoped_ptr<LayerTreeHostImpl>(host_impl_override_time); 1064 host_impl_ = make_scoped_ptr<LayerTreeHostImpl>(host_impl_override_time);
1062 host_impl_->InitializeRenderer(CreateOutputSurface()); 1065 host_impl_->InitializeRenderer(CreateOutputSurface());
1063 host_impl_->SetViewportSize(gfx::Size(10, 10)); 1066 host_impl_->SetViewportSize(viewport_size);
1064 1067
1065 gfx::Size content_size(100, 100);
1066 scoped_ptr<LayerImpl> root = 1068 scoped_ptr<LayerImpl> root =
1067 LayerImpl::Create(host_impl_->active_tree(), 1); 1069 LayerImpl::Create(host_impl_->active_tree(), 1);
1068 root->SetBounds(content_size); 1070 root->SetBounds(viewport_size);
1069 root->SetContentBounds(content_size);
1070 1071
1071 scoped_ptr<LayerImpl> scroll = 1072 scoped_ptr<LayerImpl> scroll =
1072 LayerImpl::Create(host_impl_->active_tree(), 2); 1073 LayerImpl::Create(host_impl_->active_tree(), 2);
1073 scroll->SetScrollable(true); 1074 scroll->SetScrollable(true);
1074 scroll->SetScrollOffset(gfx::Vector2d()); 1075 scroll->SetScrollOffset(gfx::Vector2d());
1075 scroll->SetMaxScrollOffset(gfx::Vector2d(content_size.width(), 1076 scroll->SetMaxScrollOffset(gfx::Vector2d(content_size.width(),
1076 content_size.height())); 1077 content_size.height()));
1077 scroll->SetBounds(content_size); 1078 scroll->SetBounds(content_size);
1078 scroll->SetContentBounds(content_size); 1079 scroll->SetContentBounds(content_size);
1079 1080
(...skipping 5153 matching lines...) Expand 10 before | Expand all | Expand 10 after
6233 EXPECT_EQ(actual_policy, host_impl_->ActualManagedMemoryPolicy()); 6234 EXPECT_EQ(actual_policy, host_impl_->ActualManagedMemoryPolicy());
6234 EXPECT_EQ(policy1.bytes_limit_when_visible, current_limit_bytes_); 6235 EXPECT_EQ(policy1.bytes_limit_when_visible, current_limit_bytes_);
6235 EXPECT_EQ(visible_cutoff_value, current_priority_cutoff_value_); 6236 EXPECT_EQ(visible_cutoff_value, current_priority_cutoff_value_);
6236 host_impl_->SetVisible(false); 6237 host_impl_->SetVisible(false);
6237 EXPECT_EQ(policy1.bytes_limit_when_not_visible, current_limit_bytes_); 6238 EXPECT_EQ(policy1.bytes_limit_when_not_visible, current_limit_bytes_);
6238 EXPECT_EQ(not_visible_cutoff_value, current_priority_cutoff_value_); 6239 EXPECT_EQ(not_visible_cutoff_value, current_priority_cutoff_value_);
6239 } 6240 }
6240 6241
6241 } // namespace 6242 } // namespace
6242 } // namespace cc 6243 } // 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