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

Side by Side Diff: cc/layer_tree_host_impl_unittest.cc

Issue 11882037: Activate LayerImpl tree with sync+push instead of pointer swap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 11 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/layer_tree_host_impl.cc ('k') | cc/layer_tree_impl.h » ('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/layer_tree_host_impl.h" 5 #include "cc/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 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after
1514 // When we try to scroll a non-scrollable child layer, the scroll delta 1514 // When we try to scroll a non-scrollable child layer, the scroll delta
1515 // should be applied to one of its ancestors if possible. 1515 // should be applied to one of its ancestors if possible.
1516 gfx::Size surfaceSize(10, 10); 1516 gfx::Size surfaceSize(10, 10);
1517 gfx::Size contentSize(20, 20); 1517 gfx::Size contentSize(20, 20);
1518 scoped_ptr<LayerImpl> root = createScrollableLayer(1, contentSize); 1518 scoped_ptr<LayerImpl> root = createScrollableLayer(1, contentSize);
1519 scoped_ptr<LayerImpl> child = createScrollableLayer(2, contentSize); 1519 scoped_ptr<LayerImpl> child = createScrollableLayer(2, contentSize);
1520 1520
1521 child->setScrollable(false); 1521 child->setScrollable(false);
1522 root->addChild(child.Pass()); 1522 root->addChild(child.Pass());
1523 1523
1524 m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
1524 m_hostImpl->activeTree()->SetRootLayer(root.Pass()); 1525 m_hostImpl->activeTree()->SetRootLayer(root.Pass());
1525 m_hostImpl->activeTree()->DidBecomeActive(); 1526 m_hostImpl->activeTree()->DidBecomeActive();
1526 m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
1527 initializeRendererAndDrawFrame(); 1527 initializeRendererAndDrawFrame();
1528 { 1528 {
1529 gfx::Vector2d scrollDelta(0, 4); 1529 gfx::Vector2d scrollDelta(0, 4);
1530 EXPECT_EQ(m_hostImpl->scrollBegin(gfx::Point(5, 5), InputHandlerClient:: Wheel), InputHandlerClient::ScrollStarted); 1530 EXPECT_EQ(m_hostImpl->scrollBegin(gfx::Point(5, 5), InputHandlerClient:: Wheel), InputHandlerClient::ScrollStarted);
1531 m_hostImpl->scrollBy(gfx::Point(), scrollDelta); 1531 m_hostImpl->scrollBy(gfx::Point(), scrollDelta);
1532 m_hostImpl->scrollEnd(); 1532 m_hostImpl->scrollEnd();
1533 1533
1534 scoped_ptr<ScrollAndScaleSet> scrollInfo = m_hostImpl->processScrollDelt as(); 1534 scoped_ptr<ScrollAndScaleSet> scrollInfo = m_hostImpl->processScrollDelt as();
1535 1535
1536 // Only the root should have scrolled. 1536 // Only the root should have scrolled.
(...skipping 3139 matching lines...) Expand 10 before | Expand all | Expand 10 after
4676 m_hostImpl->didDrawAllLayers(frame); 4676 m_hostImpl->didDrawAllLayers(frame);
4677 } 4677 }
4678 } 4678 }
4679 4679
4680 INSTANTIATE_TEST_CASE_P(LayerTreeHostImplTests, 4680 INSTANTIATE_TEST_CASE_P(LayerTreeHostImplTests,
4681 LayerTreeHostImplTest, 4681 LayerTreeHostImplTest,
4682 ::testing::Values(false, true)); 4682 ::testing::Values(false, true));
4683 4683
4684 } // namespace 4684 } // namespace
4685 } // namespace cc 4685 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer_tree_host_impl.cc ('k') | cc/layer_tree_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698