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

Side by Side Diff: cc/trees/occlusion_tracker_unittest.cc

Issue 180243014: Revert "Revert 253606 "Revert 251238 "cc: Clean up iterator template to ..."" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/trees/occlusion_tracker_perftest.cc ('k') | cc/trees/quad_culler_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/trees/occlusion_tracker.h" 5 #include "cc/trees/occlusion_tracker.h"
6 6
7 #include "cc/animation/layer_animation_controller.h" 7 #include "cc/animation/layer_animation_controller.h"
8 #include "cc/base/math_util.h" 8 #include "cc/base/math_util.h"
9 #include "cc/debug/overdraw_metrics.h" 9 #include "cc/debug/overdraw_metrics.h"
10 #include "cc/layers/layer.h" 10 #include "cc/layers/layer.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 } 115 }
116 }; 116 };
117 117
118 struct OcclusionTrackerTestMainThreadTypes { 118 struct OcclusionTrackerTestMainThreadTypes {
119 typedef Layer LayerType; 119 typedef Layer LayerType;
120 typedef FakeLayerTreeHost HostType; 120 typedef FakeLayerTreeHost HostType;
121 typedef RenderSurface RenderSurfaceType; 121 typedef RenderSurface RenderSurfaceType;
122 typedef TestContentLayer ContentLayerType; 122 typedef TestContentLayer ContentLayerType;
123 typedef scoped_refptr<Layer> LayerPtrType; 123 typedef scoped_refptr<Layer> LayerPtrType;
124 typedef scoped_refptr<ContentLayerType> ContentLayerPtrType; 124 typedef scoped_refptr<ContentLayerType> ContentLayerPtrType;
125 typedef LayerIterator<Layer> TestLayerIterator; 125 typedef LayerIterator<Layer,
126 RenderSurfaceLayerList,
127 RenderSurface,
128 LayerIteratorActions::FrontToBack> TestLayerIterator;
126 typedef OcclusionTracker OcclusionTrackerType; 129 typedef OcclusionTracker OcclusionTrackerType;
127 130
128 static LayerPtrType CreateLayer(HostType* host) { return Layer::Create(); } 131 static LayerPtrType CreateLayer(HostType* host) { return Layer::Create(); }
129 static ContentLayerPtrType CreateContentLayer(HostType* host) { 132 static ContentLayerPtrType CreateContentLayer(HostType* host) {
130 return make_scoped_refptr(new ContentLayerType()); 133 return make_scoped_refptr(new ContentLayerType());
131 } 134 }
132 135
133 static LayerPtrType PassLayerPtr(ContentLayerPtrType* layer) { 136 static LayerPtrType PassLayerPtr(ContentLayerPtrType* layer) {
134 LayerPtrType ref(*layer); 137 LayerPtrType ref(*layer);
135 *layer = NULL; 138 *layer = NULL;
136 return ref; 139 return ref;
137 } 140 }
138 141
139 static LayerPtrType PassLayerPtr(LayerPtrType* layer) { 142 static LayerPtrType PassLayerPtr(LayerPtrType* layer) {
140 LayerPtrType ref(*layer); 143 LayerPtrType ref(*layer);
141 *layer = NULL; 144 *layer = NULL;
142 return ref; 145 return ref;
143 } 146 }
144 147
145 static void DestroyLayer(LayerPtrType* layer) { *layer = NULL; } 148 static void DestroyLayer(LayerPtrType* layer) { *layer = NULL; }
146 }; 149 };
147 150
148 struct OcclusionTrackerTestImplThreadTypes { 151 struct OcclusionTrackerTestImplThreadTypes {
149 typedef LayerImpl LayerType; 152 typedef LayerImpl LayerType;
150 typedef LayerTreeImpl HostType; 153 typedef LayerTreeImpl HostType;
151 typedef RenderSurfaceImpl RenderSurfaceType; 154 typedef RenderSurfaceImpl RenderSurfaceType;
152 typedef TestContentLayerImpl ContentLayerType; 155 typedef TestContentLayerImpl ContentLayerType;
153 typedef scoped_ptr<LayerImpl> LayerPtrType; 156 typedef scoped_ptr<LayerImpl> LayerPtrType;
154 typedef scoped_ptr<ContentLayerType> ContentLayerPtrType; 157 typedef scoped_ptr<ContentLayerType> ContentLayerPtrType;
155 typedef LayerIterator<LayerImpl> TestLayerIterator; 158 typedef LayerIterator<LayerImpl,
159 LayerImplList,
160 RenderSurfaceImpl,
161 LayerIteratorActions::FrontToBack> TestLayerIterator;
156 typedef OcclusionTrackerImpl OcclusionTrackerType; 162 typedef OcclusionTrackerImpl OcclusionTrackerType;
157 163
158 static LayerPtrType CreateLayer(HostType* host) { 164 static LayerPtrType CreateLayer(HostType* host) {
159 return LayerImpl::Create(host, next_layer_impl_id++); 165 return LayerImpl::Create(host, next_layer_impl_id++);
160 } 166 }
161 static ContentLayerPtrType CreateContentLayer(HostType* host) { 167 static ContentLayerPtrType CreateContentLayer(HostType* host) {
162 return make_scoped_ptr(new ContentLayerType(host, next_layer_impl_id++)); 168 return make_scoped_ptr(new ContentLayerType(host, next_layer_impl_id++));
163 } 169 }
164 static int next_layer_impl_id; 170 static int next_layer_impl_id;
165 171
(...skipping 3651 matching lines...) Expand 10 before | Expand all | Expand 10 after
3817 occlusion.occlusion_from_outside_target().ToString()); 3823 occlusion.occlusion_from_outside_target().ToString());
3818 EXPECT_EQ(gfx::Rect().ToString(), 3824 EXPECT_EQ(gfx::Rect().ToString(),
3819 occlusion.occlusion_from_inside_target().ToString()); 3825 occlusion.occlusion_from_inside_target().ToString());
3820 } 3826 }
3821 }; 3827 };
3822 3828
3823 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestEmptyEventLayerDoesNotOcclude) 3829 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestEmptyEventLayerDoesNotOcclude)
3824 3830
3825 } // namespace 3831 } // namespace
3826 } // namespace cc 3832 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/occlusion_tracker_perftest.cc ('k') | cc/trees/quad_culler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698