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

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

Issue 304203005: Remove const LayerImpl* from QuadSink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@onlyQuadSink
Patch Set: Created 6 years, 6 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
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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698