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

Unified Diff: cc/test/test_occlusion_tracker.h

Issue 183563003: cc: Clean up OcclusionTracker template parameters. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: occlusionparams: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/test/occlusion_tracker_test_common.h ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/test_occlusion_tracker.h
diff --git a/cc/test/test_occlusion_tracker.h b/cc/test/test_occlusion_tracker.h
new file mode 100644
index 0000000000000000000000000000000000000000..cdb8de088a3e0a648d9fbd409f14863b224b8466
--- /dev/null
+++ b/cc/test/test_occlusion_tracker.h
@@ -0,0 +1,44 @@
+// 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_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_
« no previous file with comments | « cc/test/occlusion_tracker_test_common.h ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698