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

Side by Side Diff: cc/layer_tree_host_perftest.cc

Issue 12774006: cc: Chromify Layer and LayerImpl classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: MoreAndroidCompilings Created 7 years, 9 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_unittest.cc ('k') | cc/layer_tree_host_unittest.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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.h" 5 #include "cc/layer_tree_host.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/string_piece.h" 10 #include "base/string_piece.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 // Simulates main-thread scrolling on each frame. 105 // Simulates main-thread scrolling on each frame.
106 class ScrollingLayerTreePerfTest : public LayerTreeHostPerfTestJsonReader { 106 class ScrollingLayerTreePerfTest : public LayerTreeHostPerfTestJsonReader {
107 public: 107 public:
108 ScrollingLayerTreePerfTest() 108 ScrollingLayerTreePerfTest()
109 : LayerTreeHostPerfTestJsonReader() { 109 : LayerTreeHostPerfTestJsonReader() {
110 } 110 }
111 111
112 virtual void buildTree() OVERRIDE { 112 virtual void buildTree() OVERRIDE {
113 LayerTreeHostPerfTestJsonReader::buildTree(); 113 LayerTreeHostPerfTestJsonReader::buildTree();
114 m_scrollable = m_layerTreeHost->rootLayer()->children()[1]; 114 scrollable_ = m_layerTreeHost->rootLayer()->children()[1];
115 ASSERT_TRUE(m_scrollable); 115 ASSERT_TRUE(scrollable_);
116 } 116 }
117 117
118 virtual void layout() OVERRIDE { 118 virtual void layout() OVERRIDE {
119 static const gfx::Vector2d delta = gfx::Vector2d(0, 10); 119 static const gfx::Vector2d delta = gfx::Vector2d(0, 10);
120 m_scrollable->setScrollOffset(m_scrollable->scrollOffset() + delta); 120 scrollable_->SetScrollOffset(scrollable_->scroll_offset() + delta);
121 } 121 }
122 122
123 private: 123 private:
124 scoped_refptr<Layer> m_scrollable; 124 scoped_refptr<Layer> scrollable_;
125 }; 125 };
126 126
127 TEST_F(ScrollingLayerTreePerfTest, LongScrollablePage) { 127 TEST_F(ScrollingLayerTreePerfTest, LongScrollablePage) {
128 readTestFile("long_scrollable_page"); 128 readTestFile("long_scrollable_page");
129 runTest(false); 129 runTest(false);
130 } 130 }
131 131
132 } // namespace 132 } // namespace
133 } // namespace cc 133 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer_tree_host_impl_unittest.cc ('k') | cc/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698