Chromium Code Reviews| 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 | 119 |
| 120 void LayerTestCommon::LayerImplTest::AppendQuadsWithOcclusion( | 120 void LayerTestCommon::LayerImplTest::AppendQuadsWithOcclusion( |
| 121 LayerImpl* layer_impl, | 121 LayerImpl* layer_impl, |
| 122 const gfx::Rect& occluded) { | 122 const gfx::Rect& occluded) { |
| 123 AppendQuadsData data; | 123 AppendQuadsData data; |
| 124 | 124 |
| 125 render_pass_->quad_list.clear(); | 125 render_pass_->quad_list.clear(); |
| 126 render_pass_->shared_quad_state_list.clear(); | 126 render_pass_->shared_quad_state_list.clear(); |
| 127 occlusion_tracker_.set_occluded_target_rect(occluded); | 127 occlusion_tracker_.set_occluded_target_rect(occluded); |
| 128 layer_impl->WillDraw(DRAW_MODE_HARDWARE, resource_provider()); | 128 layer_impl->WillDraw(DRAW_MODE_HARDWARE, resource_provider()); |
| 129 layer_impl->AppendQuads(render_pass_.get(), occlusion_tracker_, &data); | 129 layer_impl->AppendQuads(render_pass_.get(), |
| 130 occlusion_tracker_.GetCurrentOcclusionForLayer( | |
|
danakj
2014/10/07 17:01:23
How about just construct an Occlusion with the |oc
vmpstr
2014/10/07 18:50:09
Constructed Occlusion, keeping the tracker around
| |
| 131 layer_impl->draw_transform()), | |
| 132 &data); | |
| 130 layer_impl->DidDraw(resource_provider()); | 133 layer_impl->DidDraw(resource_provider()); |
| 131 } | 134 } |
| 132 | 135 |
| 133 void LayerTestCommon::LayerImplTest::AppendQuadsForPassWithOcclusion( | 136 void LayerTestCommon::LayerImplTest::AppendQuadsForPassWithOcclusion( |
| 134 LayerImpl* layer_impl, | 137 LayerImpl* layer_impl, |
| 135 const RenderPassId& id, | 138 const RenderPassId& id, |
| 136 const gfx::Rect& occluded) { | 139 const gfx::Rect& occluded) { |
| 137 AppendQuadsData data(id); | 140 AppendQuadsData data(id); |
| 138 | 141 |
| 139 render_pass_->quad_list.clear(); | 142 render_pass_->quad_list.clear(); |
| 140 render_pass_->shared_quad_state_list.clear(); | 143 render_pass_->shared_quad_state_list.clear(); |
| 141 occlusion_tracker_.set_occluded_target_rect(occluded); | 144 occlusion_tracker_.set_occluded_target_rect(occluded); |
| 142 layer_impl->WillDraw(DRAW_MODE_HARDWARE, resource_provider()); | 145 layer_impl->WillDraw(DRAW_MODE_HARDWARE, resource_provider()); |
| 143 layer_impl->AppendQuads(render_pass_.get(), occlusion_tracker_, &data); | 146 layer_impl->AppendQuads(render_pass_.get(), |
| 147 occlusion_tracker_.GetCurrentOcclusionForLayer( | |
|
danakj
2014/10/07 17:01:23
ditto
| |
| 148 layer_impl->draw_transform()), | |
| 149 &data); | |
| 144 layer_impl->DidDraw(resource_provider()); | 150 layer_impl->DidDraw(resource_provider()); |
| 145 } | 151 } |
| 146 | 152 |
| 147 void LayerTestCommon::LayerImplTest::AppendSurfaceQuadsWithOcclusion( | 153 void LayerTestCommon::LayerImplTest::AppendSurfaceQuadsWithOcclusion( |
| 148 RenderSurfaceImpl* surface_impl, | 154 RenderSurfaceImpl* surface_impl, |
| 149 const gfx::Rect& occluded) { | 155 const gfx::Rect& occluded) { |
| 150 AppendQuadsData data; | 156 AppendQuadsData data; |
| 151 | 157 |
| 152 render_pass_->quad_list.clear(); | 158 render_pass_->quad_list.clear(); |
| 153 render_pass_->shared_quad_state_list.clear(); | 159 render_pass_->shared_quad_state_list.clear(); |
| 154 occlusion_tracker_.set_occluded_target_rect_for_contributing_surface( | 160 occlusion_tracker_.set_occluded_target_rect_for_contributing_surface( |
|
vmpstr
2014/10/07 18:50:10
I gotta keep it around, beacuse of this. Once I co
| |
| 155 occluded); | 161 occluded); |
| 156 bool for_replica = false; | 162 bool for_replica = false; |
| 157 RenderPassId id(1, 1); | 163 RenderPassId id(1, 1); |
| 158 surface_impl->AppendQuads( | 164 surface_impl->AppendQuads( |
| 159 render_pass_.get(), occlusion_tracker_, &data, for_replica, id); | 165 render_pass_.get(), occlusion_tracker_, &data, for_replica, id); |
| 160 } | 166 } |
| 161 | 167 |
| 162 } // namespace cc | 168 } // namespace cc |
| OLD | NEW |