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

Side by Side Diff: cc/occlusion_tracker_unittest.cc

Issue 11192030: cc: Switch to Chromium DCHECKs LOGs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebaseonenne Created 8 years, 2 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/occlusion_tracker.cc ('k') | cc/platform_color.h » ('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 "config.h" 5 #include "config.h"
6 6
7 #include "CCOcclusionTracker.h" 7 #include "CCOcclusionTracker.h"
8 8
9 #include "CCLayerAnimationController.h" 9 #include "CCLayerAnimationController.h"
10 #include "CCLayerImpl.h" 10 #include "CCLayerImpl.h"
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 m_maskLayers.clear(); 185 m_maskLayers.clear();
186 CCLayerTreeHost::setNeedsFilterContext(false); 186 CCLayerTreeHost::setNeedsFilterContext(false);
187 } 187 }
188 188
189 typename Types::ContentLayerType* createRoot(const WebTransformationMatrix& transform, const FloatPoint& position, const IntSize& bounds) 189 typename Types::ContentLayerType* createRoot(const WebTransformationMatrix& transform, const FloatPoint& position, const IntSize& bounds)
190 { 190 {
191 typename Types::ContentLayerPtrType layer(Types::createContentLayer()); 191 typename Types::ContentLayerPtrType layer(Types::createContentLayer());
192 typename Types::ContentLayerType* layerPtr = layer.get(); 192 typename Types::ContentLayerType* layerPtr = layer.get();
193 setProperties(layerPtr, transform, position, bounds); 193 setProperties(layerPtr, transform, position, bounds);
194 194
195 ASSERT(!m_root); 195 DCHECK(!m_root);
196 m_root = Types::passLayerPtr(layer); 196 m_root = Types::passLayerPtr(layer);
197 return layerPtr; 197 return layerPtr;
198 } 198 }
199 199
200 typename Types::LayerType* createLayer(typename Types::LayerType* parent, co nst WebTransformationMatrix& transform, const FloatPoint& position, const IntSiz e& bounds) 200 typename Types::LayerType* createLayer(typename Types::LayerType* parent, co nst WebTransformationMatrix& transform, const FloatPoint& position, const IntSiz e& bounds)
201 { 201 {
202 typename Types::LayerPtrType layer(Types::createLayer()); 202 typename Types::LayerPtrType layer(Types::createLayer());
203 typename Types::LayerType* layerPtr = layer.get(); 203 typename Types::LayerType* layerPtr = layer.get();
204 setProperties(layerPtr, transform, position, bounds); 204 setProperties(layerPtr, transform, position, bounds);
205 parent->addChild(Types::passLayerPtr(layer)); 205 parent->addChild(Types::passLayerPtr(layer));
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 { 257 {
258 typename Types::ContentLayerType* layer = createDrawingLayer(parent, tra nsform, position, bounds, opaque); 258 typename Types::ContentLayerType* layer = createDrawingLayer(parent, tra nsform, position, bounds, opaque);
259 WebFilterOperations filters; 259 WebFilterOperations filters;
260 filters.append(WebFilterOperation::createGrayscaleFilter(0.5)); 260 filters.append(WebFilterOperation::createGrayscaleFilter(0.5));
261 layer->setFilters(filters); 261 layer->setFilters(filters);
262 return layer; 262 return layer;
263 } 263 }
264 264
265 void calcDrawEtc(TestContentLayerImpl* root) 265 void calcDrawEtc(TestContentLayerImpl* root)
266 { 266 {
267 ASSERT(root == m_root.get()); 267 DCHECK(root == m_root.get());
268 int dummyMaxTextureSize = 512; 268 int dummyMaxTextureSize = 512;
269 CCLayerSorter layerSorter; 269 CCLayerSorter layerSorter;
270 270
271 ASSERT(!root->renderSurface()); 271 DCHECK(!root->renderSurface());
272 272
273 CCLayerTreeHostCommon::calculateDrawTransforms(root, root->bounds(), 1, &layerSorter, dummyMaxTextureSize, m_renderSurfaceLayerListImpl); 273 CCLayerTreeHostCommon::calculateDrawTransforms(root, root->bounds(), 1, &layerSorter, dummyMaxTextureSize, m_renderSurfaceLayerListImpl);
274 274
275 m_layerIterator = m_layerIteratorBegin = Types::LayerIterator::begin(&m_ renderSurfaceLayerListImpl); 275 m_layerIterator = m_layerIteratorBegin = Types::LayerIterator::begin(&m_ renderSurfaceLayerListImpl);
276 } 276 }
277 277
278 void calcDrawEtc(TestContentLayerChromium* root) 278 void calcDrawEtc(TestContentLayerChromium* root)
279 { 279 {
280 ASSERT(root == m_root.get()); 280 DCHECK(root == m_root.get());
281 int dummyMaxTextureSize = 512; 281 int dummyMaxTextureSize = 512;
282 282
283 ASSERT(!root->renderSurface()); 283 DCHECK(!root->renderSurface());
284 284
285 CCLayerTreeHostCommon::calculateDrawTransforms(root, root->bounds(), 1, dummyMaxTextureSize, m_renderSurfaceLayerListChromium); 285 CCLayerTreeHostCommon::calculateDrawTransforms(root, root->bounds(), 1, dummyMaxTextureSize, m_renderSurfaceLayerListChromium);
286 286
287 m_layerIterator = m_layerIteratorBegin = Types::LayerIterator::begin(&m_ renderSurfaceLayerListChromium); 287 m_layerIterator = m_layerIteratorBegin = Types::LayerIterator::begin(&m_ renderSurfaceLayerListChromium);
288 } 288 }
289 289
290 void enterLayer(typename Types::LayerType* layer, typename Types::OcclusionT rackerType& occlusion) 290 void enterLayer(typename Types::LayerType* layer, typename Types::OcclusionT rackerType& occlusion)
291 { 291 {
292 ASSERT_EQ(layer, *m_layerIterator); 292 ASSERT_EQ(layer, *m_layerIterator);
293 ASSERT_TRUE(m_layerIterator.representsItself()); 293 ASSERT_TRUE(m_layerIterator.representsItself());
(...skipping 2740 matching lines...) Expand 10 before | Expand all | Expand 10 after
3034 EXPECT_RECT_EQ(IntRect(IntPoint(), trackingSize), occlusion.occlusionInS creenSpace().bounds()); 3034 EXPECT_RECT_EQ(IntRect(IntPoint(), trackingSize), occlusion.occlusionInS creenSpace().bounds());
3035 EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size()); 3035 EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
3036 EXPECT_RECT_EQ(IntRect(IntPoint(), trackingSize), occlusion.occlusionInT argetSurface().bounds()); 3036 EXPECT_RECT_EQ(IntRect(IntPoint(), trackingSize), occlusion.occlusionInT argetSurface().bounds());
3037 EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size()); 3037 EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
3038 } 3038 }
3039 }; 3039 };
3040 3040
3041 ALL_CCOCCLUSIONTRACKER_TEST(CCOcclusionTrackerTestMinimumTrackingSize); 3041 ALL_CCOCCLUSIONTRACKER_TEST(CCOcclusionTrackerTestMinimumTrackingSize);
3042 3042
3043 } // namespace 3043 } // namespace
OLDNEW
« no previous file with comments | « cc/occlusion_tracker.cc ('k') | cc/platform_color.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698