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/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 virtual void CleanUpAndEndTest(LayerTreeHostImpl* host_impl) override { | 298 virtual void CleanUpAndEndTest(LayerTreeHostImpl* host_impl) override { |
299 clean_up_started_ = true; | 299 clean_up_started_ = true; |
300 MainThreadTaskRunner()->PostTask( | 300 MainThreadTaskRunner()->PostTask( |
301 FROM_HERE, | 301 FROM_HERE, |
302 base::Bind(&BrowserCompositorInvalidateLayerTreePerfTest:: | 302 base::Bind(&BrowserCompositorInvalidateLayerTreePerfTest:: |
303 CleanUpAndEndTestOnMainThread, | 303 CleanUpAndEndTestOnMainThread, |
304 base::Unretained(this))); | 304 base::Unretained(this))); |
305 } | 305 } |
306 | 306 |
307 void CleanUpAndEndTestOnMainThread() { | 307 void CleanUpAndEndTestOnMainThread() { |
308 tab_contents_->SetTextureMailbox(TextureMailbox(), | 308 tab_contents_->SetTextureMailbox(TextureMailbox(), nullptr); |
309 scoped_ptr<SingleReleaseCallback>()); | |
310 EndTest(); | 309 EndTest(); |
311 } | 310 } |
312 | 311 |
313 virtual bool CleanUpStarted() override { return clean_up_started_; } | 312 virtual bool CleanUpStarted() override { return clean_up_started_; } |
314 | 313 |
315 private: | 314 private: |
316 scoped_refptr<TextureLayer> tab_contents_; | 315 scoped_refptr<TextureLayer> tab_contents_; |
317 unsigned next_sync_point_; | 316 unsigned next_sync_point_; |
318 bool clean_up_started_; | 317 bool clean_up_started_; |
319 }; | 318 }; |
320 | 319 |
321 TEST_F(BrowserCompositorInvalidateLayerTreePerfTest, DenseBrowserUI) { | 320 TEST_F(BrowserCompositorInvalidateLayerTreePerfTest, DenseBrowserUI) { |
322 measure_commit_cost_ = true; | 321 measure_commit_cost_ = true; |
323 SetTestName("dense_layer_tree"); | 322 SetTestName("dense_layer_tree"); |
324 ReadTestFile("dense_layer_tree"); | 323 ReadTestFile("dense_layer_tree"); |
325 RunTestWithImplSidePainting(); | 324 RunTestWithImplSidePainting(); |
326 } | 325 } |
327 | 326 |
328 // Simulates a page with several large, transformed and animated layers. | 327 // Simulates a page with several large, transformed and animated layers. |
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 |