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

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

Issue 12519006: cc:: Add RenderingStatsInstrumentation to manage collection of RenderingStats (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Updated all tests Created 7 years, 9 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/debug/rendering_stats_instrumentation.cc ('k') | cc/resources/raster_worker_pool.h » ('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 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/layers/delegated_renderer_layer_impl.h" 5 #include "cc/layers/delegated_renderer_layer_impl.h"
6 6
7 #include "cc/base/scoped_ptr_vector.h" 7 #include "cc/base/scoped_ptr_vector.h"
8 #include "cc/layers/append_quads_data.h" 8 #include "cc/layers/append_quads_data.h"
9 #include "cc/layers/quad_sink.h" 9 #include "cc/layers/quad_sink.h"
10 #include "cc/layers/solid_color_layer_impl.h" 10 #include "cc/layers/solid_color_layer_impl.h"
11 #include "cc/quads/render_pass_draw_quad.h" 11 #include "cc/quads/render_pass_draw_quad.h"
12 #include "cc/quads/solid_color_draw_quad.h" 12 #include "cc/quads/solid_color_draw_quad.h"
13 #include "cc/test/fake_delegated_renderer_layer_impl.h" 13 #include "cc/test/fake_delegated_renderer_layer_impl.h"
14 #include "cc/test/fake_layer_tree_host_impl.h" 14 #include "cc/test/fake_layer_tree_host_impl.h"
15 #include "cc/test/fake_layer_tree_host_impl_client.h" 15 #include "cc/test/fake_layer_tree_host_impl_client.h"
16 #include "cc/test/fake_output_surface.h" 16 #include "cc/test/fake_output_surface.h"
17 #include "cc/test/fake_proxy.h" 17 #include "cc/test/fake_proxy.h"
18 #include "cc/test/fake_rendering_stats_instrumentation.h"
18 #include "cc/test/geometry_test_utils.h" 19 #include "cc/test/geometry_test_utils.h"
19 #include "cc/test/mock_quad_culler.h" 20 #include "cc/test/mock_quad_culler.h"
20 #include "cc/test/render_pass_test_common.h" 21 #include "cc/test/render_pass_test_common.h"
21 #include "cc/test/render_pass_test_utils.h" 22 #include "cc/test/render_pass_test_utils.h"
22 #include "cc/test/test_web_graphics_context_3d.h" 23 #include "cc/test/test_web_graphics_context_3d.h"
23 #include "cc/trees/layer_tree_host_impl.h" 24 #include "cc/trees/layer_tree_host_impl.h"
24 #include "cc/trees/layer_tree_impl.h" 25 #include "cc/trees/layer_tree_impl.h"
25 #include "cc/trees/single_thread_proxy.h" 26 #include "cc/trees/single_thread_proxy.h"
26 #include "testing/gtest/include/gtest/gtest.h" 27 #include "testing/gtest/include/gtest/gtest.h"
27 #include "ui/gfx/transform.h" 28 #include "ui/gfx/transform.h"
28 29
29 namespace cc { 30 namespace cc {
30 namespace { 31 namespace {
31 32
32 class DelegatedRendererLayerImplTest : public testing::Test { 33 class DelegatedRendererLayerImplTest : public testing::Test {
33 public: 34 public:
34 DelegatedRendererLayerImplTest() 35 DelegatedRendererLayerImplTest()
35 : proxy_(scoped_ptr<Thread>(NULL)) 36 : proxy_(scoped_ptr<Thread>(NULL))
36 , always_impl_thread_and_main_thread_blocked_(&proxy_) { 37 , always_impl_thread_and_main_thread_blocked_(&proxy_) {
37 LayerTreeSettings settings; 38 LayerTreeSettings settings;
38 settings.minimum_occlusion_tracking_size = gfx::Size(); 39 settings.minimum_occlusion_tracking_size = gfx::Size();
39 40
40 host_impl_ = LayerTreeHostImpl::Create(settings, &client_, &proxy_); 41 host_impl_ = LayerTreeHostImpl::Create(settings,
42 &client_,
43 &proxy_,
44 &stats_instrumentation_);
41 host_impl_->InitializeRenderer(createFakeOutputSurface()); 45 host_impl_->InitializeRenderer(createFakeOutputSurface());
42 host_impl_->SetViewportSize(gfx::Size(10, 10), gfx::Size(10, 10)); 46 host_impl_->SetViewportSize(gfx::Size(10, 10), gfx::Size(10, 10));
43 } 47 }
44 48
45 protected: 49 protected:
46 FakeProxy proxy_; 50 FakeProxy proxy_;
47 FakeLayerTreeHostImplClient client_; 51 FakeLayerTreeHostImplClient client_;
48 DebugScopedSetImplThreadAndMainThreadBlocked 52 DebugScopedSetImplThreadAndMainThreadBlocked
49 always_impl_thread_and_main_thread_blocked_; 53 always_impl_thread_and_main_thread_blocked_;
54 FakeRenderingStatsInstrumentation stats_instrumentation_;
50 scoped_ptr<LayerTreeHostImpl> host_impl_; 55 scoped_ptr<LayerTreeHostImpl> host_impl_;
51 }; 56 };
52 57
53 class DelegatedRendererLayerImplTestSimple 58 class DelegatedRendererLayerImplTestSimple
54 : public DelegatedRendererLayerImplTest { 59 : public DelegatedRendererLayerImplTest {
55 public: 60 public:
56 DelegatedRendererLayerImplTestSimple() 61 DelegatedRendererLayerImplTestSimple()
57 : DelegatedRendererLayerImplTest() { 62 : DelegatedRendererLayerImplTest() {
58 scoped_ptr<LayerImpl> root_layer = SolidColorLayerImpl::Create( 63 scoped_ptr<LayerImpl> root_layer = SolidColorLayerImpl::Create(
59 host_impl_->active_tree(), 1).PassAs<LayerImpl>(); 64 host_impl_->active_tree(), 1).PassAs<LayerImpl>();
(...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1246 root_delegated_shared_quad_state->clip_rect.ToString()); 1251 root_delegated_shared_quad_state->clip_rect.ToString());
1247 // Quads came with a clip rect. 1252 // Quads came with a clip rect.
1248 EXPECT_TRUE(root_delegated_shared_quad_state->is_clipped); 1253 EXPECT_TRUE(root_delegated_shared_quad_state->is_clipped);
1249 1254
1250 host_impl_->DrawLayers(&frame, base::TimeTicks::Now()); 1255 host_impl_->DrawLayers(&frame, base::TimeTicks::Now());
1251 host_impl_->DidDrawAllLayers(frame); 1256 host_impl_->DidDrawAllLayers(frame);
1252 } 1257 }
1253 1258
1254 } // namespace 1259 } // namespace
1255 } // namespace cc 1260 } // namespace cc
OLDNEW
« no previous file with comments | « cc/debug/rendering_stats_instrumentation.cc ('k') | cc/resources/raster_worker_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698