summaryrefslogtreecommitdiffstats
path: root/cc/test
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-05 06:55:03 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-05 06:55:03 +0000
commit34ba1ffb32e6b517f3051ae0cc32cdf783aab47d (patch)
treeda7444e0dda04a656d4a223016168efe3f260f9c /cc/test
parent514266b099e9e2177d230d3696c0f3835d5ffba7 (diff)
downloadchromium_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/test')
-rw-r--r--cc/test/fake_content_layer.cc2
-rw-r--r--cc/test/fake_content_layer.h5
-rw-r--r--cc/test/fake_painted_scrollbar_layer.cc5
-rw-r--r--cc/test/fake_painted_scrollbar_layer.h2
-rw-r--r--cc/test/fake_picture_layer.cc2
-rw-r--r--cc/test/fake_picture_layer.h2
-rw-r--r--cc/test/layer_tree_test.cc1
-rw-r--r--cc/test/occlusion_tracker_test_common.h50
-rw-r--r--cc/test/test_occlusion_tracker.h44
9 files changed, 53 insertions, 60 deletions
diff --git a/cc/test/fake_content_layer.cc b/cc/test/fake_content_layer.cc
index 9eaa6f7..ebeff11 100644
--- a/cc/test/fake_content_layer.cc
+++ b/cc/test/fake_content_layer.cc
@@ -37,7 +37,7 @@ scoped_ptr<LayerImpl> FakeContentLayer::CreateLayerImpl(
}
bool FakeContentLayer::Update(ResourceUpdateQueue* queue,
- const OcclusionTracker* occlusion) {
+ const OcclusionTracker<Layer>* occlusion) {
bool updated = ContentLayer::Update(queue, occlusion);
update_count_++;
return updated || always_update_resources_;
diff --git a/cc/test/fake_content_layer.h b/cc/test/fake_content_layer.h
index 07cfd4c..ee6cfb4 100644
--- a/cc/test/fake_content_layer.h
+++ b/cc/test/fake_content_layer.h
@@ -25,9 +25,8 @@ class FakeContentLayer : public ContentLayer {
size_t push_properties_count() const { return push_properties_count_; }
void reset_push_properties_count() { push_properties_count_ = 0; }
- virtual bool Update(
- ResourceUpdateQueue* queue,
- const OcclusionTracker* occlusion) OVERRIDE;
+ virtual bool Update(ResourceUpdateQueue* queue,
+ const OcclusionTracker<Layer>* occlusion) OVERRIDE;
gfx::Rect LastPaintRect() const;
diff --git a/cc/test/fake_painted_scrollbar_layer.cc b/cc/test/fake_painted_scrollbar_layer.cc
index 72ef420..b238d80 100644
--- a/cc/test/fake_painted_scrollbar_layer.cc
+++ b/cc/test/fake_painted_scrollbar_layer.cc
@@ -35,8 +35,9 @@ FakePaintedScrollbarLayer::FakePaintedScrollbarLayer(
FakePaintedScrollbarLayer::~FakePaintedScrollbarLayer() {}
-bool FakePaintedScrollbarLayer::Update(ResourceUpdateQueue* queue,
- const OcclusionTracker* occlusion) {
+bool FakePaintedScrollbarLayer::Update(
+ ResourceUpdateQueue* queue,
+ const OcclusionTracker<Layer>* occlusion) {
bool updated = PaintedScrollbarLayer::Update(queue, occlusion);
++update_count_;
return updated;
diff --git a/cc/test/fake_painted_scrollbar_layer.h b/cc/test/fake_painted_scrollbar_layer.h
index 9b1b13d..5e2fa18 100644
--- a/cc/test/fake_painted_scrollbar_layer.h
+++ b/cc/test/fake_painted_scrollbar_layer.h
@@ -21,7 +21,7 @@ class FakePaintedScrollbarLayer : public PaintedScrollbarLayer {
void reset_update_count() { update_count_ = 0; }
virtual bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker* occlusion) OVERRIDE;
+ const OcclusionTracker<Layer>* occlusion) OVERRIDE;
virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
diff --git a/cc/test/fake_picture_layer.cc b/cc/test/fake_picture_layer.cc
index 69292c3..98e658e 100644
--- a/cc/test/fake_picture_layer.cc
+++ b/cc/test/fake_picture_layer.cc
@@ -26,7 +26,7 @@ scoped_ptr<LayerImpl> FakePictureLayer::CreateLayerImpl(
}
bool FakePictureLayer::Update(ResourceUpdateQueue* queue,
- const OcclusionTracker* occlusion) {
+ const OcclusionTracker<Layer>* occlusion) {
bool updated = PictureLayer::Update(queue, occlusion);
update_count_++;
return updated || always_update_resources_;
diff --git a/cc/test/fake_picture_layer.h b/cc/test/fake_picture_layer.h
index 824ac6c..99217c2 100644
--- a/cc/test/fake_picture_layer.h
+++ b/cc/test/fake_picture_layer.h
@@ -31,7 +31,7 @@ class FakePictureLayer : public PictureLayer {
}
virtual bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker* occlusion) OVERRIDE;
+ const OcclusionTracker<Layer>* occlusion) OVERRIDE;
virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc
index 2dbab11..8e5a43b 100644
--- a/cc/test/layer_tree_test.cc
+++ b/cc/test/layer_tree_test.cc
@@ -17,7 +17,6 @@
#include "cc/test/animation_test_common.h"
#include "cc/test/fake_layer_tree_host_client.h"
#include "cc/test/fake_output_surface.h"
-#include "cc/test/occlusion_tracker_test_common.h"
#include "cc/test/test_context_provider.h"
#include "cc/test/tiled_layer_test_common.h"
#include "cc/trees/layer_tree_host_client.h"
diff --git a/cc/test/occlusion_tracker_test_common.h b/cc/test/occlusion_tracker_test_common.h
deleted file mode 100644
index 5468b99..0000000
--- a/cc/test/occlusion_tracker_test_common.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CC_TEST_OCCLUSION_TRACKER_TEST_COMMON_H_
-#define CC_TEST_OCCLUSION_TRACKER_TEST_COMMON_H_
-
-#include "cc/layers/render_surface.h"
-#include "cc/layers/render_surface_impl.h"
-#include "cc/trees/occlusion_tracker.h"
-
-namespace cc {
-
-// A subclass to expose the total current occlusion.
-template <typename LayerType, typename RenderSurfaceType>
-class TestOcclusionTrackerBase
- : public OcclusionTrackerBase<LayerType, RenderSurfaceType> {
- public:
- TestOcclusionTrackerBase(const gfx::Rect& screen_scissor_rect,
- bool record_metrics_for_frame)
- : OcclusionTrackerBase<LayerType, RenderSurfaceType>(
- screen_scissor_rect,
- record_metrics_for_frame) {}
-
- Region occlusion_from_inside_target() const {
- return OcclusionTrackerBase<LayerType, RenderSurfaceType>::stack_.back().
- occlusion_from_inside_target;
- }
- Region occlusion_from_outside_target() const {
- return OcclusionTrackerBase<LayerType, RenderSurfaceType>::stack_.back().
- occlusion_from_outside_target;
- }
-
- void set_occlusion_from_outside_target(const Region& region) {
- OcclusionTrackerBase<LayerType, RenderSurfaceType>::stack_.back().
- occlusion_from_outside_target = region;
- }
- void set_occlusion_from_inside_target(const Region& region) {
- OcclusionTrackerBase<LayerType, RenderSurfaceType>::stack_.back().
- occlusion_from_inside_target = region;
- }
-};
-
-typedef TestOcclusionTrackerBase<Layer, RenderSurface> TestOcclusionTracker;
-typedef TestOcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>
- TestOcclusionTrackerImpl;
-
-} // namespace cc
-
-#endif // CC_TEST_OCCLUSION_TRACKER_TEST_COMMON_H_
diff --git a/cc/test/test_occlusion_tracker.h b/cc/test/test_occlusion_tracker.h
new file mode 100644
index 0000000..6eec732
--- /dev/null
+++ b/cc/test/test_occlusion_tracker.h
@@ -0,0 +1,44 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_TEST_TEST_OCCLUSION_TRACKER_H_
+#define CC_TEST_TEST_OCCLUSION_TRACKER_H_
+
+#include "cc/layers/render_surface.h"
+#include "cc/layers/render_surface_impl.h"
+#include "cc/trees/occlusion_tracker.h"
+
+namespace cc {
+
+// A subclass to expose the total current occlusion.
+template <typename LayerType>
+class TestOcclusionTracker : public OcclusionTracker<LayerType> {
+ public:
+ TestOcclusionTracker(const gfx::Rect& screen_scissor_rect,
+ bool record_metrics_for_frame)
+ : OcclusionTracker<LayerType>(screen_scissor_rect,
+ record_metrics_for_frame) {}
+
+ Region occlusion_from_inside_target() const {
+ return OcclusionTracker<LayerType>::stack_.back()
+ .occlusion_from_inside_target;
+ }
+ Region occlusion_from_outside_target() const {
+ return OcclusionTracker<LayerType>::stack_.back()
+ .occlusion_from_outside_target;
+ }
+
+ void set_occlusion_from_outside_target(const Region& region) {
+ OcclusionTracker<LayerType>::stack_.back().occlusion_from_outside_target =
+ region;
+ }
+ void set_occlusion_from_inside_target(const Region& region) {
+ OcclusionTracker<LayerType>::stack_.back().occlusion_from_inside_target =
+ region;
+ }
+};
+
+} // namespace cc
+
+#endif // CC_TEST_TEST_OCCLUSION_TRACKER_H_