| 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/test/layer_test_common.h" | 5 #include "cc/test/layer_test_common.h" |
| 6 | 6 |
| 7 #include "cc/base/math_util.h" | 7 #include "cc/base/math_util.h" |
| 8 #include "cc/base/region.h" | 8 #include "cc/base/region.h" |
| 9 #include "cc/layers/append_quads_data.h" | 9 #include "cc/layers/append_quads_data.h" |
| 10 #include "cc/quads/draw_quad.h" | 10 #include "cc/quads/draw_quad.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 EXPECT_EQ(quad->rect.ToString(), quad->visible_rect.ToString()); | 94 EXPECT_EQ(quad->rect.ToString(), quad->visible_rect.ToString()); |
| 95 } else { | 95 } else { |
| 96 EXPECT_NE(quad->rect.ToString(), quad->visible_rect.ToString()); | 96 EXPECT_NE(quad->rect.ToString(), quad->visible_rect.ToString()); |
| 97 EXPECT_TRUE(quad->rect.Contains(quad->visible_rect)); | 97 EXPECT_TRUE(quad->rect.Contains(quad->visible_rect)); |
| 98 ++(*partially_occluded_count); | 98 ++(*partially_occluded_count); |
| 99 } | 99 } |
| 100 } | 100 } |
| 101 } | 101 } |
| 102 | 102 |
| 103 LayerTestCommon::LayerImplTest::LayerImplTest() | 103 LayerTestCommon::LayerImplTest::LayerImplTest() |
| 104 : host_(FakeLayerTreeHost::Create()), | 104 : client_(FakeLayerTreeHostClient::DIRECT_3D), |
| 105 host_(FakeLayerTreeHost::Create(&client_)), |
| 105 root_layer_impl_(LayerImpl::Create(host_->host_impl()->active_tree(), 1)), | 106 root_layer_impl_(LayerImpl::Create(host_->host_impl()->active_tree(), 1)), |
| 106 render_pass_(RenderPass::Create()) { | 107 render_pass_(RenderPass::Create()) { |
| 107 scoped_ptr<FakeOutputSurface> output_surface = FakeOutputSurface::Create3d(); | 108 scoped_ptr<FakeOutputSurface> output_surface = FakeOutputSurface::Create3d(); |
| 108 host_->host_impl()->InitializeRenderer( | 109 host_->host_impl()->InitializeRenderer( |
| 109 output_surface.PassAs<OutputSurface>()); | 110 output_surface.PassAs<OutputSurface>()); |
| 110 } | 111 } |
| 111 | 112 |
| 112 LayerTestCommon::LayerImplTest::~LayerImplTest() {} | 113 LayerTestCommon::LayerImplTest::~LayerImplTest() {} |
| 113 | 114 |
| 114 void LayerTestCommon::LayerImplTest::CalcDrawProps( | 115 void LayerTestCommon::LayerImplTest::CalcDrawProps( |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 render_pass_->shared_quad_state_list.clear(); | 156 render_pass_->shared_quad_state_list.clear(); |
| 156 occlusion_tracker_.set_occluded_target_rect_for_contributing_surface( | 157 occlusion_tracker_.set_occluded_target_rect_for_contributing_surface( |
| 157 occluded); | 158 occluded); |
| 158 bool for_replica = false; | 159 bool for_replica = false; |
| 159 RenderPassId id(1, 1); | 160 RenderPassId id(1, 1); |
| 160 surface_impl->AppendQuads( | 161 surface_impl->AppendQuads( |
| 161 render_pass_.get(), occlusion_tracker_, &data, for_replica, id); | 162 render_pass_.get(), occlusion_tracker_, &data, for_replica, id); |
| 162 } | 163 } |
| 163 | 164 |
| 164 } // namespace cc | 165 } // namespace cc |
| OLD | NEW |