OLD | NEW |
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/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 // Invalidates a leaf layer in the tree on the main thread after every commit. | 177 // Invalidates a leaf layer in the tree on the main thread after every commit. |
178 class LayerTreeHostPerfTestLeafInvalidates | 178 class LayerTreeHostPerfTestLeafInvalidates |
179 : public LayerTreeHostPerfTestJsonReader { | 179 : public LayerTreeHostPerfTestJsonReader { |
180 public: | 180 public: |
181 virtual void BuildTree() OVERRIDE { | 181 virtual void BuildTree() OVERRIDE { |
182 LayerTreeHostPerfTestJsonReader::BuildTree(); | 182 LayerTreeHostPerfTestJsonReader::BuildTree(); |
183 | 183 |
184 // Find a leaf layer. | 184 // Find a leaf layer. |
185 for (layer_to_invalidate_ = layer_tree_host()->root_layer(); | 185 for (layer_to_invalidate_ = layer_tree_host()->root_layer(); |
186 layer_to_invalidate_->children().size(); | 186 layer_to_invalidate_->children().size(); |
187 layer_to_invalidate_ = layer_to_invalidate_->children()[0]) {} | 187 layer_to_invalidate_ = layer_to_invalidate_->children()[0].get()) { |
| 188 } |
188 } | 189 } |
189 | 190 |
190 virtual void DidCommitAndDrawFrame() OVERRIDE { | 191 virtual void DidCommitAndDrawFrame() OVERRIDE { |
191 if (TestEnded()) | 192 if (TestEnded()) |
192 return; | 193 return; |
193 | 194 |
194 static bool flip = true; | 195 static bool flip = true; |
195 layer_to_invalidate_->SetOpacity(flip ? 1.f : 0.5f); | 196 layer_to_invalidate_->SetOpacity(flip ? 1.f : 0.5f); |
196 flip = !flip; | 197 flip = !flip; |
197 } | 198 } |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 TEST_F(LayerTreeHostPerfTestJsonReader, HeavyPageThreadedImplSide) { | 329 TEST_F(LayerTreeHostPerfTestJsonReader, HeavyPageThreadedImplSide) { |
329 begin_frame_driven_drawing_ = true; | 330 begin_frame_driven_drawing_ = true; |
330 measure_commit_cost_ = true; | 331 measure_commit_cost_ = true; |
331 SetTestName("heavy_page"); | 332 SetTestName("heavy_page"); |
332 ReadTestFile("heavy_layer_tree"); | 333 ReadTestFile("heavy_layer_tree"); |
333 RunTestWithImplSidePainting(); | 334 RunTestWithImplSidePainting(); |
334 } | 335 } |
335 | 336 |
336 } // namespace | 337 } // namespace |
337 } // namespace cc | 338 } // namespace cc |
OLD | NEW |