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

Unified Diff: cc/trees/layer_tree_host_unittest_scroll.cc

Issue 18400003: cc: Consider scroll offset in CalcDrawProperties (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use a gyp variable Created 7 years, 5 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/trees/layer_tree_host_impl_unittest.cc ('k') | webkit/renderer/compositor_bindings/web_layer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest_scroll.cc
diff --git a/cc/trees/layer_tree_host_unittest_scroll.cc b/cc/trees/layer_tree_host_unittest_scroll.cc
index 47393f99f2904ac0c2909e62d43d1dab4ec64bb1..c4140afbe6c1d07c82c329f09e1379c0c17b6cf3 100644
--- a/cc/trees/layer_tree_host_unittest_scroll.cc
+++ b/cc/trees/layer_tree_host_unittest_scroll.cc
@@ -97,6 +97,7 @@ class LayerTreeHostScrollTestScrollMultipleRedraw
virtual void BeginTest() OVERRIDE {
layer_tree_host()->root_layer()->SetScrollable(true);
layer_tree_host()->root_layer()->SetScrollOffset(initial_scroll_);
+ layer_tree_host()->root_layer()->SetBounds(gfx::Size(200, 200));
PostSetNeedsCommitToMainThread();
}
@@ -238,7 +239,7 @@ class LayerTreeHostScrollTestCaseWithChild : public LayerTreeHostScrollTest {
root_scroll_layer_ = ContentLayer::Create(&fake_content_layer_client_);
root_scroll_layer_->SetBounds(gfx::Size(110, 110));
- root_scroll_layer_->SetPosition(gfx::Point(0, 0));
+ root_scroll_layer_->SetPosition(gfx::Point());
root_scroll_layer_->SetAnchorPoint(gfx::PointF());
root_scroll_layer_->SetIsDrawable(true);
@@ -252,10 +253,15 @@ class LayerTreeHostScrollTestCaseWithChild : public LayerTreeHostScrollTest {
base::Unretained(this)));
child_layer_->SetBounds(gfx::Size(110, 110));
- // Scrolls on the child layer will happen at 5, 5. If they are treated
- // like device pixels, and device scale factor is 2, then they will
- // be considered at 2.5, 2.5 in logical pixels, and will miss this layer.
- child_layer_->SetPosition(gfx::Point(5, 5));
+ if (scroll_child_layer_) {
+ // Scrolls on the child layer will happen at 5, 5. If they are treated
+ // like device pixels, and device scale factor is 2, then they will
+ // be considered at 2.5, 2.5 in logical pixels, and will miss this layer.
+ child_layer_->SetPosition(gfx::Point(5, 5));
+ } else {
+ // Adjust the child layer horizontally so that scrolls will never hit it.
+ child_layer_->SetPosition(gfx::Point(60, 5));
+ }
child_layer_->SetAnchorPoint(gfx::PointF());
child_layer_->SetIsDrawable(true);
@@ -346,7 +352,7 @@ class LayerTreeHostScrollTestCaseWithChild : public LayerTreeHostScrollTest {
case 0: {
// Gesture scroll on impl thread.
InputHandler::ScrollStatus status = impl->ScrollBegin(
- gfx::ToCeiledPoint(expected_scroll_layer_impl->position() +
+ gfx::ToCeiledPoint(expected_scroll_layer_impl->position() -
gfx::Vector2dF(0.5f, 0.5f)),
InputHandler::Gesture);
EXPECT_EQ(InputHandler::ScrollStarted, status);
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | webkit/renderer/compositor_bindings/web_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698