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