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

Side by Side Diff: cc/layers/picture_layer_impl_perftest.cc

Issue 608503005: Revert of cc: Remove use of PassAs() and constructor-casting with scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/layers/picture_layer_impl_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/layers/picture_layer_impl.h" 5 #include "cc/layers/picture_layer_impl.h"
6 6
7 #include "cc/debug/lap_timer.h" 7 #include "cc/debug/lap_timer.h"
8 #include "cc/test/fake_impl_proxy.h" 8 #include "cc/test/fake_impl_proxy.h"
9 #include "cc/test/fake_layer_tree_host_impl.h" 9 #include "cc/test/fake_layer_tree_host_impl.h"
10 #include "cc/test/fake_output_surface.h" 10 #include "cc/test/fake_output_surface.h"
(...skipping 28 matching lines...) Expand all
39 PictureLayerImplPerfTest() 39 PictureLayerImplPerfTest()
40 : proxy_(base::MessageLoopProxy::current()), 40 : proxy_(base::MessageLoopProxy::current()),
41 host_impl_(ImplSidePaintingSettings(), 41 host_impl_(ImplSidePaintingSettings(),
42 &proxy_, 42 &proxy_,
43 &shared_bitmap_manager_), 43 &shared_bitmap_manager_),
44 timer_(kWarmupRuns, 44 timer_(kWarmupRuns,
45 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), 45 base::TimeDelta::FromMilliseconds(kTimeLimitMillis),
46 kTimeCheckInterval) {} 46 kTimeCheckInterval) {}
47 47
48 virtual void SetUp() OVERRIDE { 48 virtual void SetUp() OVERRIDE {
49 host_impl_.InitializeRenderer(FakeOutputSurface::Create3d()); 49 host_impl_.InitializeRenderer(
50 FakeOutputSurface::Create3d().PassAs<OutputSurface>());
50 } 51 }
51 52
52 void SetupPendingTree(const gfx::Size& layer_bounds, 53 void SetupPendingTree(const gfx::Size& layer_bounds,
53 const gfx::Size& tile_size) { 54 const gfx::Size& tile_size) {
54 scoped_refptr<FakePicturePileImpl> pile = 55 scoped_refptr<FakePicturePileImpl> pile =
55 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); 56 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds);
56 host_impl_.CreatePendingTree(); 57 host_impl_.CreatePendingTree();
57 LayerTreeImpl* pending_tree = host_impl_.pending_tree(); 58 LayerTreeImpl* pending_tree = host_impl_.pending_tree();
58 pending_tree->DetachLayerTree(); 59 pending_tree->DetachLayerTree();
59 60
60 scoped_ptr<FakePictureLayerImpl> pending_layer = 61 scoped_ptr<FakePictureLayerImpl> pending_layer =
61 FakePictureLayerImpl::CreateWithPile(pending_tree, 7, pile); 62 FakePictureLayerImpl::CreateWithPile(pending_tree, 7, pile);
62 pending_layer->SetDrawsContent(true); 63 pending_layer->SetDrawsContent(true);
63 pending_tree->SetRootLayer(pending_layer.Pass()); 64 pending_tree->SetRootLayer(pending_layer.PassAs<LayerImpl>());
64 65
65 pending_layer_ = static_cast<FakePictureLayerImpl*>( 66 pending_layer_ = static_cast<FakePictureLayerImpl*>(
66 host_impl_.pending_tree()->LayerById(7)); 67 host_impl_.pending_tree()->LayerById(7));
67 pending_layer_->DoPostCommitInitializationIfNeeded(); 68 pending_layer_->DoPostCommitInitializationIfNeeded();
68 } 69 }
69 70
70 void RunRasterIteratorConstructAndIterateTest( 71 void RunRasterIteratorConstructAndIterateTest(
71 const std::string& test_name, 72 const std::string& test_name,
72 int num_tiles, 73 int num_tiles,
73 const gfx::Size& viewport_size) { 74 const gfx::Size& viewport_size) {
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 266
266 RunEvictionIteratorConstructTest("0_0_100x100", gfx::Rect(0, 0, 100, 100)); 267 RunEvictionIteratorConstructTest("0_0_100x100", gfx::Rect(0, 0, 100, 100));
267 RunEvictionIteratorConstructTest("5000_0_100x100", 268 RunEvictionIteratorConstructTest("5000_0_100x100",
268 gfx::Rect(5000, 0, 100, 100)); 269 gfx::Rect(5000, 0, 100, 100));
269 RunEvictionIteratorConstructTest("9999_0_100x100", 270 RunEvictionIteratorConstructTest("9999_0_100x100",
270 gfx::Rect(9999, 0, 100, 100)); 271 gfx::Rect(9999, 0, 100, 100));
271 } 272 }
272 273
273 } // namespace 274 } // namespace
274 } // namespace cc 275 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698