| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/debug/lap_timer.h" | 5 #include "cc/debug/lap_timer.h" |
| 6 #include "cc/resources/picture_layer_tiling.h" | 6 #include "cc/resources/picture_layer_tiling.h" |
| 7 #include "cc/resources/resource_provider.h" | 7 #include "cc/resources/resource_provider.h" |
| 8 #include "cc/resources/scoped_resource.h" | 8 #include "cc/resources/scoped_resource.h" |
| 9 #include "cc/test/fake_output_surface.h" | 9 #include "cc/test/fake_output_surface.h" |
| 10 #include "cc/test/fake_output_surface_client.h" | 10 #include "cc/test/fake_output_surface_client.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 public: | 28 public: |
| 29 PictureLayerTilingPerfTest() | 29 PictureLayerTilingPerfTest() |
| 30 : timer_(kWarmupRuns, | 30 : timer_(kWarmupRuns, |
| 31 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), | 31 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), |
| 32 kTimeCheckInterval), | 32 kTimeCheckInterval), |
| 33 context_provider_(TestContextProvider::Create()) { | 33 context_provider_(TestContextProvider::Create()) { |
| 34 output_surface_ = FakeOutputSurface::Create3d(context_provider_).Pass(); | 34 output_surface_ = FakeOutputSurface::Create3d(context_provider_).Pass(); |
| 35 CHECK(output_surface_->BindToClient(&output_surface_client_)); | 35 CHECK(output_surface_->BindToClient(&output_surface_client_)); |
| 36 | 36 |
| 37 shared_bitmap_manager_.reset(new TestSharedBitmapManager()); | 37 shared_bitmap_manager_.reset(new TestSharedBitmapManager()); |
| 38 resource_provider_ = ResourceProvider::Create(output_surface_.get(), | 38 resource_provider_ = |
| 39 shared_bitmap_manager_.get(), | 39 ResourceProvider::Create(output_surface_.get(), |
| 40 NULL, | 40 shared_bitmap_manager_.get(), NULL, NULL, 0, |
| 41 NULL, | 41 false, false, 1).Pass(); |
| 42 0, | |
| 43 false, | |
| 44 1).Pass(); | |
| 45 } | 42 } |
| 46 | 43 |
| 47 void SetUp() override { | 44 void SetUp() override { |
| 48 LayerTreeSettings defaults; | 45 LayerTreeSettings defaults; |
| 49 picture_layer_tiling_client_.SetTileSize(gfx::Size(256, 256)); | 46 picture_layer_tiling_client_.SetTileSize(gfx::Size(256, 256)); |
| 50 picture_layer_tiling_client_.set_tree(PENDING_TREE); | 47 picture_layer_tiling_client_.set_tree(PENDING_TREE); |
| 51 scoped_refptr<FakePicturePileImpl> pile = | 48 scoped_refptr<FakePicturePileImpl> pile = |
| 52 FakePicturePileImpl::CreateFilledPileWithDefaultTileSize( | 49 FakePicturePileImpl::CreateFilledPileWithDefaultTileSize( |
| 53 gfx::Size(256 * 50, 256 * 50)); | 50 gfx::Size(256 * 50, 256 * 50)); |
| 54 picture_layer_tiling_ = PictureLayerTiling::Create( | 51 picture_layer_tiling_ = PictureLayerTiling::Create( |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 RunComputeTilePriorityRectsStationaryTest("rotation", transform); | 164 RunComputeTilePriorityRectsStationaryTest("rotation", transform); |
| 168 RunComputeTilePriorityRectsScrollingTest("rotation", transform); | 165 RunComputeTilePriorityRectsScrollingTest("rotation", transform); |
| 169 | 166 |
| 170 transform.ApplyPerspectiveDepth(10); | 167 transform.ApplyPerspectiveDepth(10); |
| 171 RunComputeTilePriorityRectsStationaryTest("perspective", transform); | 168 RunComputeTilePriorityRectsStationaryTest("perspective", transform); |
| 172 RunComputeTilePriorityRectsScrollingTest("perspective", transform); | 169 RunComputeTilePriorityRectsScrollingTest("perspective", transform); |
| 173 } | 170 } |
| 174 | 171 |
| 175 } // namespace | 172 } // namespace |
| 176 } // namespace cc | 173 } // namespace cc |
| OLD | NEW |