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/layers/solid_color_layer_impl.h" | 8 #include "cc/layers/solid_color_layer_impl.h" |
9 #include "cc/quads/render_pass_draw_quad.h" | 9 #include "cc/quads/render_pass_draw_quad.h" |
10 #include "cc/quads/solid_color_draw_quad.h" | 10 #include "cc/quads/solid_color_draw_quad.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "testing/gtest/include/gtest/gtest.h" | 25 #include "testing/gtest/include/gtest/gtest.h" |
26 #include "ui/gfx/transform.h" | 26 #include "ui/gfx/transform.h" |
27 | 27 |
28 namespace cc { | 28 namespace cc { |
29 namespace { | 29 namespace { |
30 | 30 |
31 class DelegatedRendererLayerImplTest : public testing::Test { | 31 class DelegatedRendererLayerImplTest : public testing::Test { |
32 public: | 32 public: |
33 DelegatedRendererLayerImplTest() | 33 DelegatedRendererLayerImplTest() |
34 : proxy_(), | 34 : proxy_(), |
35 always_impl_thread_and_main_thread_blocked_(&proxy_), | 35 always_impl_thread_and_main_thread_blocked_(&proxy_) { |
36 output_surface_(FakeOutputSurface::Create3d()) { | |
37 LayerTreeSettings settings; | 36 LayerTreeSettings settings; |
38 settings.minimum_occlusion_tracking_size = gfx::Size(); | 37 settings.minimum_occlusion_tracking_size = gfx::Size(); |
39 | 38 |
40 host_impl_.reset(new FakeLayerTreeHostImpl( | 39 host_impl_.reset(new FakeLayerTreeHostImpl( |
41 settings, &proxy_, &shared_bitmap_manager_, &task_graph_runner_)); | 40 settings, &proxy_, &shared_bitmap_manager_, &task_graph_runner_)); |
42 host_impl_->InitializeRenderer(output_surface_.get()); | 41 host_impl_->InitializeRenderer(FakeOutputSurface::Create3d()); |
43 host_impl_->SetViewportSize(gfx::Size(10, 10)); | 42 host_impl_->SetViewportSize(gfx::Size(10, 10)); |
44 } | 43 } |
45 | 44 |
46 protected: | 45 protected: |
47 FakeImplProxy proxy_; | 46 FakeImplProxy proxy_; |
48 DebugScopedSetImplThreadAndMainThreadBlocked | 47 DebugScopedSetImplThreadAndMainThreadBlocked |
49 always_impl_thread_and_main_thread_blocked_; | 48 always_impl_thread_and_main_thread_blocked_; |
50 TestSharedBitmapManager shared_bitmap_manager_; | 49 TestSharedBitmapManager shared_bitmap_manager_; |
51 TestTaskGraphRunner task_graph_runner_; | 50 TestTaskGraphRunner task_graph_runner_; |
52 scoped_ptr<OutputSurface> output_surface_; | |
53 scoped_ptr<LayerTreeHostImpl> host_impl_; | 51 scoped_ptr<LayerTreeHostImpl> host_impl_; |
54 }; | 52 }; |
55 | 53 |
56 class DelegatedRendererLayerImplTestSimple | 54 class DelegatedRendererLayerImplTestSimple |
57 : public DelegatedRendererLayerImplTest { | 55 : public DelegatedRendererLayerImplTest { |
58 public: | 56 public: |
59 DelegatedRendererLayerImplTestSimple() | 57 DelegatedRendererLayerImplTestSimple() |
60 : DelegatedRendererLayerImplTest() { | 58 : DelegatedRendererLayerImplTest() { |
61 scoped_ptr<LayerImpl> root_layer = | 59 scoped_ptr<LayerImpl> root_layer = |
62 SolidColorLayerImpl::Create(host_impl_->active_tree(), 1); | 60 SolidColorLayerImpl::Create(host_impl_->active_tree(), 1); |
(...skipping 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1668 scoped_ptr<DelegatedRendererLayerImpl> other_layer = | 1666 scoped_ptr<DelegatedRendererLayerImpl> other_layer = |
1669 DelegatedRendererLayerImpl::Create(host_impl_->active_tree(), 6); | 1667 DelegatedRendererLayerImpl::Create(host_impl_->active_tree(), 6); |
1670 | 1668 |
1671 delegated_renderer_layer_impl->PushPropertiesTo(other_layer.get()); | 1669 delegated_renderer_layer_impl->PushPropertiesTo(other_layer.get()); |
1672 | 1670 |
1673 EXPECT_EQ(0.5f, other_layer->inverse_device_scale_factor()); | 1671 EXPECT_EQ(0.5f, other_layer->inverse_device_scale_factor()); |
1674 } | 1672 } |
1675 | 1673 |
1676 } // namespace | 1674 } // namespace |
1677 } // namespace cc | 1675 } // namespace cc |
OLD | NEW |