summaryrefslogtreecommitdiffstats
path: root/cc/test/layer_test_common.cc
diff options
context:
space:
mode:
authorweiliangc@chromium.org <weiliangc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-13 22:01:42 +0000
committerweiliangc@chromium.org <weiliangc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-13 22:01:42 +0000
commitb74d7f2825baa2ea59b0b30410efee434ace7d99 (patch)
tree567872dcbb6c849e13ecb17d247e7c474c74f376 /cc/test/layer_test_common.cc
parent117eb82d7a3b62cb363fb8e64dc9aa3a7ef7e028 (diff)
downloadchromium_src-b74d7f2825baa2ea59b0b30410efee434ace7d99.zip
chromium_src-b74d7f2825baa2ea59b0b30410efee434ace7d99.tar.gz
chromium_src-b74d7f2825baa2ea59b0b30410efee434ace7d99.tar.bz2
MockQC stops create its own RP and MockOcclusionTracker
MockQuadCuller used to make its own RenderPass and Occlusion Tracker when nothing is passed in. Now all unittests use MockQC has to create their own RP and OT, and pass pointers to MockQC. This would make MockQC mimick QC behavior. Next CL would use one QuadSink function to replace the hierarchy of QuadSink, QuadCuller, and MockQuadCuller. This CL follows 306683002. BUG=344962 TEST=cc_unittests Review URL: https://codereview.chromium.org/306683002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277099 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/layer_test_common.cc')
-rw-r--r--cc/test/layer_test_common.cc24
1 files changed, 13 insertions, 11 deletions
diff --git a/cc/test/layer_test_common.cc b/cc/test/layer_test_common.cc
index 6661644..4daca5d 100644
--- a/cc/test/layer_test_common.cc
+++ b/cc/test/layer_test_common.cc
@@ -101,8 +101,10 @@ void LayerTestCommon::VerifyQuadsCoverRectWithOcclusion(
LayerTestCommon::LayerImplTest::LayerImplTest()
: host_(FakeLayerTreeHost::Create()),
- root_layer_impl_(
- LayerImpl::Create(host_->host_impl()->active_tree(), 1)) {
+ root_layer_impl_(LayerImpl::Create(host_->host_impl()->active_tree(), 1)),
+ render_pass_(RenderPass::Create()),
+ quad_culler_(make_scoped_ptr(
+ new MockQuadCuller(render_pass_.get(), &occlusion_tracker_))) {
scoped_ptr<FakeOutputSurface> output_surface = FakeOutputSurface::Create3d();
host_->host_impl()->InitializeRenderer(
output_surface.PassAs<OutputSurface>());
@@ -123,10 +125,10 @@ void LayerTestCommon::LayerImplTest::AppendQuadsWithOcclusion(
const gfx::Rect& occluded) {
AppendQuadsData data;
- quad_culler_.clear_lists();
- quad_culler_.set_occluded_target_rect(occluded);
+ quad_culler_->clear_lists();
+ quad_culler_->set_occluded_target_rect(occluded);
layer_impl->WillDraw(DRAW_MODE_HARDWARE, resource_provider());
- layer_impl->AppendQuads(&quad_culler_, &data);
+ layer_impl->AppendQuads(quad_culler_.get(), &data);
layer_impl->DidDraw(resource_provider());
}
@@ -136,10 +138,10 @@ void LayerTestCommon::LayerImplTest::AppendQuadsForPassWithOcclusion(
const gfx::Rect& occluded) {
AppendQuadsData data(id);
- quad_culler_.clear_lists();
- quad_culler_.set_occluded_target_rect(occluded);
+ quad_culler_->clear_lists();
+ quad_culler_->set_occluded_target_rect(occluded);
layer_impl->WillDraw(DRAW_MODE_HARDWARE, resource_provider());
- layer_impl->AppendQuads(&quad_culler_, &data);
+ layer_impl->AppendQuads(quad_culler_.get(), &data);
layer_impl->DidDraw(resource_provider());
}
@@ -148,11 +150,11 @@ void LayerTestCommon::LayerImplTest::AppendSurfaceQuadsWithOcclusion(
const gfx::Rect& occluded) {
AppendQuadsData data;
- quad_culler_.clear_lists();
- quad_culler_.set_occluded_target_rect_for_contributing_surface(occluded);
+ quad_culler_->clear_lists();
+ quad_culler_->set_occluded_target_rect_for_contributing_surface(occluded);
bool for_replica = false;
RenderPass::Id id(1, 1);
- surface_impl->AppendQuads(&quad_culler_, &data, for_replica, id);
+ surface_impl->AppendQuads(quad_culler_.get(), &data, for_replica, id);
}
} // namespace cc