| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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].get()) { | 187 layer_to_invalidate_ = layer_to_invalidate_->children()[0].get()) { |
| 188 } | 188 } |
| 189 } | 189 } |
| 190 | 190 |
| 191 virtual void DidCommitAndDrawFrame() OVERRIDE { | 191 virtual void DidCommitAndDrawFrame() OVERRIDE { |
| 192 if (TestEnded()) | 192 if (TestEnded()) |
| 193 return; | 193 return; |
| 194 | 194 |
| 195 static bool flip = true; | 195 layer_to_invalidate_->SetOpacity( |
| 196 layer_to_invalidate_->SetOpacity(flip ? 1.f : 0.5f); | 196 layer_to_invalidate_->opacity() != 1.f ? 1.f : 0.5f); |
| 197 flip = !flip; | |
| 198 } | 197 } |
| 199 | 198 |
| 200 protected: | 199 protected: |
| 201 Layer* layer_to_invalidate_; | 200 Layer* layer_to_invalidate_; |
| 202 }; | 201 }; |
| 203 | 202 |
| 204 // Simulates a tab switcher scene with two stacks of 10 tabs each. Invalidate a | 203 // Simulates a tab switcher scene with two stacks of 10 tabs each. Invalidate a |
| 205 // property on a leaf layer in the tree every commit. | 204 // property on a leaf layer in the tree every commit. |
| 206 TEST_F(LayerTreeHostPerfTestLeafInvalidates, TenTenSingleThread) { | 205 TEST_F(LayerTreeHostPerfTestLeafInvalidates, TenTenSingleThread) { |
| 207 SetTestName("10_10_single_thread_leaf_invalidates"); | 206 SetTestName("10_10_single_thread_leaf_invalidates"); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 TEST_F(LayerTreeHostPerfTestJsonReader, HeavyPageThreadedImplSide) { | 328 TEST_F(LayerTreeHostPerfTestJsonReader, HeavyPageThreadedImplSide) { |
| 330 begin_frame_driven_drawing_ = true; | 329 begin_frame_driven_drawing_ = true; |
| 331 measure_commit_cost_ = true; | 330 measure_commit_cost_ = true; |
| 332 SetTestName("heavy_page"); | 331 SetTestName("heavy_page"); |
| 333 ReadTestFile("heavy_layer_tree"); | 332 ReadTestFile("heavy_layer_tree"); |
| 334 RunTestWithImplSidePainting(); | 333 RunTestWithImplSidePainting(); |
| 335 } | 334 } |
| 336 | 335 |
| 337 } // namespace | 336 } // namespace |
| 338 } // namespace cc | 337 } // namespace cc |
| OLD | NEW |