Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Side by Side Diff: cc/test/layer_test_common.cc

Issue 633773004: cc: Pass Occlusion instead of OcclusionTracker to LayerImpls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/test/fake_picture_layer_impl.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 LayerTreeHostCommon::CalculateDrawProperties(&inputs); 117 LayerTreeHostCommon::CalculateDrawProperties(&inputs);
118 } 118 }
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
128 Occlusion occlusion(layer_impl->draw_transform(),
129 SimpleEnclosedRegion(occluded),
130 SimpleEnclosedRegion());
131
128 layer_impl->WillDraw(DRAW_MODE_HARDWARE, resource_provider()); 132 layer_impl->WillDraw(DRAW_MODE_HARDWARE, resource_provider());
129 layer_impl->AppendQuads(render_pass_.get(), occlusion_tracker_, &data); 133 layer_impl->AppendQuads(render_pass_.get(), occlusion, &data);
130 layer_impl->DidDraw(resource_provider()); 134 layer_impl->DidDraw(resource_provider());
131 } 135 }
132 136
133 void LayerTestCommon::LayerImplTest::AppendQuadsForPassWithOcclusion( 137 void LayerTestCommon::LayerImplTest::AppendQuadsForPassWithOcclusion(
134 LayerImpl* layer_impl, 138 LayerImpl* layer_impl,
135 const RenderPassId& id, 139 const RenderPassId& id,
136 const gfx::Rect& occluded) { 140 const gfx::Rect& occluded) {
137 AppendQuadsData data(id); 141 AppendQuadsData data(id);
138 142
139 render_pass_->quad_list.clear(); 143 render_pass_->quad_list.clear();
140 render_pass_->shared_quad_state_list.clear(); 144 render_pass_->shared_quad_state_list.clear();
141 occlusion_tracker_.set_occluded_target_rect(occluded); 145
146 Occlusion occlusion(layer_impl->draw_transform(),
147 SimpleEnclosedRegion(occluded),
148 SimpleEnclosedRegion());
149
142 layer_impl->WillDraw(DRAW_MODE_HARDWARE, resource_provider()); 150 layer_impl->WillDraw(DRAW_MODE_HARDWARE, resource_provider());
143 layer_impl->AppendQuads(render_pass_.get(), occlusion_tracker_, &data); 151 layer_impl->AppendQuads(render_pass_.get(), occlusion, &data);
144 layer_impl->DidDraw(resource_provider()); 152 layer_impl->DidDraw(resource_provider());
145 } 153 }
146 154
147 void LayerTestCommon::LayerImplTest::AppendSurfaceQuadsWithOcclusion( 155 void LayerTestCommon::LayerImplTest::AppendSurfaceQuadsWithOcclusion(
148 RenderSurfaceImpl* surface_impl, 156 RenderSurfaceImpl* surface_impl,
149 const gfx::Rect& occluded) { 157 const gfx::Rect& occluded) {
150 AppendQuadsData data; 158 AppendQuadsData data;
151 159
152 render_pass_->quad_list.clear(); 160 render_pass_->quad_list.clear();
153 render_pass_->shared_quad_state_list.clear(); 161 render_pass_->shared_quad_state_list.clear();
154 occlusion_tracker_.set_occluded_target_rect_for_contributing_surface( 162 occlusion_tracker_.set_occluded_target_rect_for_contributing_surface(
155 occluded); 163 occluded);
156 bool for_replica = false; 164 bool for_replica = false;
157 RenderPassId id(1, 1); 165 RenderPassId id(1, 1);
158 surface_impl->AppendQuads( 166 surface_impl->AppendQuads(
159 render_pass_.get(), occlusion_tracker_, &data, for_replica, id); 167 render_pass_.get(), occlusion_tracker_, &data, for_replica, id);
160 } 168 }
161 169
162 } // namespace cc 170 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_picture_layer_impl.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698