| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 root_layer_impl_.get(), viewport_size, &layer_list); | 119 root_layer_impl_.get(), viewport_size, &layer_list); |
| 120 LayerTreeHostCommon::CalculateDrawProperties(&inputs); | 120 LayerTreeHostCommon::CalculateDrawProperties(&inputs); |
| 121 } | 121 } |
| 122 | 122 |
| 123 void LayerTestCommon::LayerImplTest::AppendQuadsWithOcclusion( | 123 void LayerTestCommon::LayerImplTest::AppendQuadsWithOcclusion( |
| 124 LayerImpl* layer_impl, | 124 LayerImpl* layer_impl, |
| 125 const gfx::Rect& occluded) { | 125 const gfx::Rect& occluded) { |
| 126 AppendQuadsData data; | 126 AppendQuadsData data; |
| 127 | 127 |
| 128 quad_culler_->clear_lists(); | 128 quad_culler_->clear_lists(); |
| 129 quad_culler_->set_layer(layer_impl); | |
| 130 quad_culler_->set_occluded_target_rect(occluded); | 129 quad_culler_->set_occluded_target_rect(occluded); |
| 131 layer_impl->WillDraw(DRAW_MODE_HARDWARE, resource_provider()); | 130 layer_impl->WillDraw(DRAW_MODE_HARDWARE, resource_provider()); |
| 132 layer_impl->AppendQuads(quad_culler_.get(), &data); | 131 layer_impl->AppendQuads(quad_culler_.get(), &data); |
| 133 layer_impl->DidDraw(resource_provider()); | 132 layer_impl->DidDraw(resource_provider()); |
| 134 } | 133 } |
| 135 | 134 |
| 136 void LayerTestCommon::LayerImplTest::AppendQuadsForPassWithOcclusion( | 135 void LayerTestCommon::LayerImplTest::AppendQuadsForPassWithOcclusion( |
| 137 LayerImpl* layer_impl, | 136 LayerImpl* layer_impl, |
| 138 const RenderPass::Id& id, | 137 const RenderPass::Id& id, |
| 139 const gfx::Rect& occluded) { | 138 const gfx::Rect& occluded) { |
| 140 AppendQuadsData data(id); | 139 AppendQuadsData data(id); |
| 141 | 140 |
| 142 quad_culler_->clear_lists(); | 141 quad_culler_->clear_lists(); |
| 143 quad_culler_->set_layer(layer_impl); | |
| 144 quad_culler_->set_occluded_target_rect(occluded); | 142 quad_culler_->set_occluded_target_rect(occluded); |
| 145 layer_impl->WillDraw(DRAW_MODE_HARDWARE, resource_provider()); | 143 layer_impl->WillDraw(DRAW_MODE_HARDWARE, resource_provider()); |
| 146 layer_impl->AppendQuads(quad_culler_.get(), &data); | 144 layer_impl->AppendQuads(quad_culler_.get(), &data); |
| 147 layer_impl->DidDraw(resource_provider()); | 145 layer_impl->DidDraw(resource_provider()); |
| 148 } | 146 } |
| 149 | 147 |
| 150 void LayerTestCommon::LayerImplTest::AppendSurfaceQuadsWithOcclusion( | 148 void LayerTestCommon::LayerImplTest::AppendSurfaceQuadsWithOcclusion( |
| 151 LayerImpl* owning_layer_impl, | 149 LayerImpl* owning_layer_impl, |
| 152 RenderSurfaceImpl* surface_impl, | 150 RenderSurfaceImpl* surface_impl, |
| 153 const gfx::Rect& occluded) { | 151 const gfx::Rect& occluded) { |
| 154 AppendQuadsData data; | 152 AppendQuadsData data; |
| 155 | 153 |
| 156 quad_culler_->clear_lists(); | 154 quad_culler_->clear_lists(); |
| 157 quad_culler_->set_layer(owning_layer_impl); | |
| 158 quad_culler_->set_occluded_target_rect_for_contributing_surface(occluded); | 155 quad_culler_->set_occluded_target_rect_for_contributing_surface(occluded); |
| 159 bool for_replica = false; | 156 bool for_replica = false; |
| 160 RenderPass::Id id(1, 1); | 157 RenderPass::Id id(1, 1); |
| 161 surface_impl->AppendQuads(quad_culler_.get(), &data, for_replica, id); | 158 surface_impl->AppendQuads(quad_culler_.get(), &data, for_replica, id); |
| 162 } | 159 } |
| 163 | 160 |
| 164 } // namespace cc | 161 } // namespace cc |
| OLD | NEW |