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/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/debug/test_web_graphics_context_3d.h" | 8 #include "cc/debug/test_web_graphics_context_3d.h" |
9 #include "cc/layers/append_quads_data.h" | 9 #include "cc/layers/append_quads_data.h" |
10 #include "cc/layers/quad_sink.h" | 10 #include "cc/layers/quad_sink.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 namespace { | 31 namespace { |
32 | 32 |
33 class DelegatedRendererLayerImplTest : public testing::Test { | 33 class DelegatedRendererLayerImplTest : public testing::Test { |
34 public: | 34 public: |
35 DelegatedRendererLayerImplTest() | 35 DelegatedRendererLayerImplTest() |
36 : proxy_(), | 36 : proxy_(), |
37 always_impl_thread_and_main_thread_blocked_(&proxy_) { | 37 always_impl_thread_and_main_thread_blocked_(&proxy_) { |
38 LayerTreeSettings settings; | 38 LayerTreeSettings settings; |
39 settings.minimum_occlusion_tracking_size = gfx::Size(); | 39 settings.minimum_occlusion_tracking_size = gfx::Size(); |
40 | 40 |
41 host_impl_ = LayerTreeHostImpl::Create(settings, | 41 host_impl_.reset(new FakeLayerTreeHostImpl(settings, &proxy_)); |
42 &client_, | |
43 &proxy_, | |
44 &stats_instrumentation_); | |
45 host_impl_->InitializeRenderer(CreateFakeOutputSurface()); | 42 host_impl_->InitializeRenderer(CreateFakeOutputSurface()); |
46 host_impl_->SetViewportSize(gfx::Size(10, 10)); | 43 host_impl_->SetViewportSize(gfx::Size(10, 10)); |
47 } | 44 } |
48 | 45 |
49 protected: | 46 protected: |
50 FakeProxy proxy_; | 47 FakeProxy proxy_; |
51 FakeLayerTreeHostImplClient client_; | |
52 DebugScopedSetImplThreadAndMainThreadBlocked | 48 DebugScopedSetImplThreadAndMainThreadBlocked |
53 always_impl_thread_and_main_thread_blocked_; | 49 always_impl_thread_and_main_thread_blocked_; |
54 FakeRenderingStatsInstrumentation stats_instrumentation_; | |
55 scoped_ptr<LayerTreeHostImpl> host_impl_; | 50 scoped_ptr<LayerTreeHostImpl> host_impl_; |
56 }; | 51 }; |
57 | 52 |
58 class DelegatedRendererLayerImplTestSimple | 53 class DelegatedRendererLayerImplTestSimple |
59 : public DelegatedRendererLayerImplTest { | 54 : public DelegatedRendererLayerImplTest { |
60 public: | 55 public: |
61 DelegatedRendererLayerImplTestSimple() | 56 DelegatedRendererLayerImplTestSimple() |
62 : DelegatedRendererLayerImplTest() { | 57 : DelegatedRendererLayerImplTest() { |
63 scoped_ptr<LayerImpl> root_layer = SolidColorLayerImpl::Create( | 58 scoped_ptr<LayerImpl> root_layer = SolidColorLayerImpl::Create( |
64 host_impl_->active_tree(), 1).PassAs<LayerImpl>(); | 59 host_impl_->active_tree(), 1).PassAs<LayerImpl>(); |
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1245 root_delegated_shared_quad_state->clip_rect.ToString()); | 1240 root_delegated_shared_quad_state->clip_rect.ToString()); |
1246 // Quads came with a clip rect. | 1241 // Quads came with a clip rect. |
1247 EXPECT_TRUE(root_delegated_shared_quad_state->is_clipped); | 1242 EXPECT_TRUE(root_delegated_shared_quad_state->is_clipped); |
1248 | 1243 |
1249 host_impl_->DrawLayers(&frame, base::TimeTicks::Now()); | 1244 host_impl_->DrawLayers(&frame, base::TimeTicks::Now()); |
1250 host_impl_->DidDrawAllLayers(frame); | 1245 host_impl_->DidDrawAllLayers(frame); |
1251 } | 1246 } |
1252 | 1247 |
1253 } // namespace | 1248 } // namespace |
1254 } // namespace cc | 1249 } // namespace cc |
OLD | NEW |