diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-05 06:55:03 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-05 06:55:03 +0000 |
commit | 34ba1ffb32e6b517f3051ae0cc32cdf783aab47d (patch) | |
tree | da7444e0dda04a656d4a223016168efe3f260f9c /cc/trees/quad_culler_unittest.cc | |
parent | 514266b099e9e2177d230d3696c0f3835d5ffba7 (diff) | |
download | chromium_src-34ba1ffb32e6b517f3051ae0cc32cdf783aab47d.zip chromium_src-34ba1ffb32e6b517f3051ae0cc32cdf783aab47d.tar.gz chromium_src-34ba1ffb32e6b517f3051ae0cc32cdf783aab47d.tar.bz2 |
cc: Clean up OcclusionTracker template parameters.
Currently it takes LayerType and RenderSurfaceType, but the latter is
derivable from the former, so just pass the former. Since there's only
one parameter, it's clearer to use OcclusionTracker<Layer(Impl)>
directly instead of using typedefs.
Also rename the TestOcclusionTracker file from
occlusion_tracker_test_common.h to test_occlusion_tracker.h.
R=enne
BUG=344962
Review URL: https://codereview.chromium.org/183563003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254965 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/trees/quad_culler_unittest.cc')
-rw-r--r-- | cc/trees/quad_culler_unittest.cc | 80 |
1 files changed, 49 insertions, 31 deletions
diff --git a/cc/trees/quad_culler_unittest.cc b/cc/trees/quad_culler_unittest.cc index ee97319..27e3de5 100644 --- a/cc/trees/quad_culler_unittest.cc +++ b/cc/trees/quad_culler_unittest.cc @@ -17,7 +17,7 @@ #include "cc/resources/layer_tiling_data.h" #include "cc/test/fake_impl_proxy.h" #include "cc/test/fake_layer_tree_host_impl.h" -#include "cc/test/occlusion_tracker_test_common.h" +#include "cc/test/test_occlusion_tracker.h" #include "cc/trees/occlusion_tracker.h" #include "cc/trees/single_thread_proxy.h" #include "testing/gmock/include/gmock/gmock.h" @@ -27,18 +27,6 @@ namespace cc { namespace { -class TestOcclusionTrackerImpl - : public TestOcclusionTrackerBase<LayerImpl, RenderSurfaceImpl> { - public: - TestOcclusionTrackerImpl(const gfx::Rect& scissor_rect_in_screen, - bool record_metrics_for_frame = true) - : TestOcclusionTrackerBase(scissor_rect_in_screen, - record_metrics_for_frame) {} - - private: - DISALLOW_COPY_AND_ASSIGN(TestOcclusionTrackerImpl); -}; - typedef LayerIterator<LayerImpl> LayerIteratorType; class QuadCullerTest : public testing::Test { @@ -104,7 +92,7 @@ class QuadCullerTest : public testing::Test { SharedQuadStateList* shared_state_list, TiledLayerImpl* layer, LayerIteratorType* it, - OcclusionTrackerImpl* occlusion_tracker) { + OcclusionTracker<LayerImpl>* occlusion_tracker) { occlusion_tracker->EnterLayer(*it); QuadCuller quad_culler( quad_list, shared_state_list, layer, *occlusion_tracker, false, false); @@ -150,7 +138,9 @@ TEST_F(QuadCullerTest, NoCulling) { false, gfx::Rect(), render_surface_layer_list); - TestOcclusionTrackerImpl occlusion_tracker(gfx::Rect(-100, -100, 1000, 1000)); + bool record_metrics = true; + TestOcclusionTracker<LayerImpl> occlusion_tracker( + gfx::Rect(-100, -100, 1000, 1000), record_metrics); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); AppendQuads(&quad_list, @@ -190,7 +180,9 @@ TEST_F(QuadCullerTest, CullChildLinesUpTopLeft) { true, gfx::Rect(), render_surface_layer_list); - TestOcclusionTrackerImpl occlusion_tracker(gfx::Rect(-100, -100, 1000, 1000)); + bool record_metrics = true; + TestOcclusionTracker<LayerImpl> occlusion_tracker( + gfx::Rect(-100, -100, 1000, 1000), record_metrics); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); AppendQuads(&quad_list, @@ -230,7 +222,9 @@ TEST_F(QuadCullerTest, CullWhenChildOpacityNotOne) { true, gfx::Rect(), render_surface_layer_list); - TestOcclusionTrackerImpl occlusion_tracker(gfx::Rect(-100, -100, 1000, 1000)); + bool record_metrics = true; + TestOcclusionTracker<LayerImpl> occlusion_tracker( + gfx::Rect(-100, -100, 1000, 1000), record_metrics); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); AppendQuads(&quad_list, @@ -270,7 +264,9 @@ TEST_F(QuadCullerTest, CullWhenChildOpaqueFlagFalse) { false, gfx::Rect(), render_surface_layer_list); - TestOcclusionTrackerImpl occlusion_tracker(gfx::Rect(-100, -100, 1000, 1000)); + bool record_metrics = true; + TestOcclusionTracker<LayerImpl> occlusion_tracker( + gfx::Rect(-100, -100, 1000, 1000), record_metrics); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); AppendQuads(&quad_list, @@ -311,7 +307,9 @@ TEST_F(QuadCullerTest, CullCenterTileOnly) { true, gfx::Rect(), render_surface_layer_list); - TestOcclusionTrackerImpl occlusion_tracker(gfx::Rect(-100, -100, 1000, 1000)); + bool record_metrics = true; + TestOcclusionTracker<LayerImpl> occlusion_tracker( + gfx::Rect(-100, -100, 1000, 1000), record_metrics); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); AppendQuads(&quad_list, @@ -377,7 +375,9 @@ TEST_F(QuadCullerTest, CullCenterTileNonIntegralSize1) { true, gfx::Rect(), render_surface_layer_list); - TestOcclusionTrackerImpl occlusion_tracker(gfx::Rect(-100, -100, 1000, 1000)); + bool record_metrics = true; + TestOcclusionTracker<LayerImpl> occlusion_tracker( + gfx::Rect(-100, -100, 1000, 1000), record_metrics); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); AppendQuads(&quad_list, @@ -428,7 +428,9 @@ TEST_F(QuadCullerTest, CullCenterTileNonIntegralSize2) { true, gfx::Rect(), render_surface_layer_list); - TestOcclusionTrackerImpl occlusion_tracker(gfx::Rect(-100, -100, 1000, 1000)); + bool record_metrics = true; + TestOcclusionTracker<LayerImpl> occlusion_tracker( + gfx::Rect(-100, -100, 1000, 1000), record_metrics); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); AppendQuads(&quad_list, @@ -469,7 +471,9 @@ TEST_F(QuadCullerTest, CullChildLinesUpBottomRight) { true, gfx::Rect(), render_surface_layer_list); - TestOcclusionTrackerImpl occlusion_tracker(gfx::Rect(-100, -100, 1000, 1000)); + bool record_metrics = true; + TestOcclusionTracker<LayerImpl> occlusion_tracker( + gfx::Rect(-100, -100, 1000, 1000), record_metrics); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); AppendQuads(&quad_list, @@ -514,7 +518,9 @@ TEST_F(QuadCullerTest, CullSubRegion) { false, child_opaque_rect, render_surface_layer_list); - TestOcclusionTrackerImpl occlusion_tracker(gfx::Rect(-100, -100, 1000, 1000)); + bool record_metrics = true; + TestOcclusionTracker<LayerImpl> occlusion_tracker( + gfx::Rect(-100, -100, 1000, 1000), record_metrics); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); AppendQuads(&quad_list, @@ -560,7 +566,9 @@ TEST_F(QuadCullerTest, CullSubRegion2) { false, child_opaque_rect, render_surface_layer_list); - TestOcclusionTrackerImpl occlusion_tracker(gfx::Rect(-100, -100, 1000, 1000)); + bool record_metrics = true; + TestOcclusionTracker<LayerImpl> occlusion_tracker( + gfx::Rect(-100, -100, 1000, 1000), record_metrics); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); AppendQuads(&quad_list, @@ -606,7 +614,9 @@ TEST_F(QuadCullerTest, CullSubRegionCheckOvercull) { false, child_opaque_rect, render_surface_layer_list); - TestOcclusionTrackerImpl occlusion_tracker(gfx::Rect(-100, -100, 1000, 1000)); + bool record_metrics = true; + TestOcclusionTracker<LayerImpl> occlusion_tracker( + gfx::Rect(-100, -100, 1000, 1000), record_metrics); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); AppendQuads(&quad_list, @@ -650,7 +660,9 @@ TEST_F(QuadCullerTest, NonAxisAlignedQuadsDontOcclude) { true, gfx::Rect(), render_surface_layer_list); - TestOcclusionTrackerImpl occlusion_tracker(gfx::Rect(-100, -100, 1000, 1000)); + bool record_metrics = true; + TestOcclusionTracker<LayerImpl> occlusion_tracker( + gfx::Rect(-100, -100, 1000, 1000), record_metrics); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); AppendQuads(&quad_list, @@ -699,7 +711,9 @@ TEST_F(QuadCullerTest, NonAxisAlignedQuadsSafelyCulled) { true, gfx::Rect(), render_surface_layer_list); - TestOcclusionTrackerImpl occlusion_tracker(gfx::Rect(-100, -100, 1000, 1000)); + bool record_metrics = true; + TestOcclusionTracker<LayerImpl> occlusion_tracker( + gfx::Rect(-100, -100, 1000, 1000), record_metrics); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); AppendQuads(&quad_list, @@ -739,8 +753,8 @@ TEST_F(QuadCullerTest, WithoutMetrics) { gfx::Rect(), render_surface_layer_list); bool record_metrics = false; - TestOcclusionTrackerImpl occlusion_tracker(gfx::Rect(-100, -100, 1000, 1000), - record_metrics); + TestOcclusionTracker<LayerImpl> occlusion_tracker( + gfx::Rect(-100, -100, 1000, 1000), record_metrics); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); AppendQuads(&quad_list, @@ -773,7 +787,9 @@ TEST_F(QuadCullerTest, PartialCullingNotDestroyed) { gfx::Rect(), render_surface_layer_list); - TestOcclusionTrackerImpl occlusion_tracker(gfx::Rect(1000, 1000)); + bool record_metrics = true; + TestOcclusionTracker<LayerImpl> occlusion_tracker(gfx::Rect(1000, 1000), + record_metrics); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); QuadCuller culler(&quad_list, @@ -847,7 +863,9 @@ TEST_F(QuadCullerTest, PartialCullingWithOcclusionNotDestroyed) { gfx::Rect(), render_surface_layer_list); - TestOcclusionTrackerImpl occlusion_tracker(gfx::Rect(1000, 1000)); + bool record_metrics = true; + TestOcclusionTracker<LayerImpl> occlusion_tracker(gfx::Rect(1000, 1000), + record_metrics); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); QuadCuller culler(&quad_list, |