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

Side by Side Diff: cc/CCOcclusionTrackerTest.cpp

Issue 11048044: cc: Switch to Chromium DCHECKs and LOGs (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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
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 "CCAnimationTestCommon.h" 9 #include "CCAnimationTestCommon.h"
10 #include "CCGeometryTestUtils.h" 10 #include "CCGeometryTestUtils.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 m_maskLayers.clear(); 169 m_maskLayers.clear();
170 CCLayerTreeHost::setNeedsFilterContext(false); 170 CCLayerTreeHost::setNeedsFilterContext(false);
171 } 171 }
172 172
173 typename Types::ContentLayerType* createRoot(const WebTransformationMatrix& transform, const FloatPoint& position, const IntSize& bounds) 173 typename Types::ContentLayerType* createRoot(const WebTransformationMatrix& transform, const FloatPoint& position, const IntSize& bounds)
174 { 174 {
175 typename Types::ContentLayerPtrType layer(Types::createContentLayer()); 175 typename Types::ContentLayerPtrType layer(Types::createContentLayer());
176 typename Types::ContentLayerType* layerPtr = layer.get(); 176 typename Types::ContentLayerType* layerPtr = layer.get();
177 setProperties(layerPtr, transform, position, bounds); 177 setProperties(layerPtr, transform, position, bounds);
178 178
179 ASSERT(!m_root); 179 DCHECK(!m_root);
180 m_root = layer.release(); 180 m_root = layer.release();
181 return layerPtr; 181 return layerPtr;
182 } 182 }
183 183
184 typename Types::LayerType* createLayer(typename Types::LayerType* parent, co nst WebTransformationMatrix& transform, const FloatPoint& position, const IntSiz e& bounds) 184 typename Types::LayerType* createLayer(typename Types::LayerType* parent, co nst WebTransformationMatrix& transform, const FloatPoint& position, const IntSiz e& bounds)
185 { 185 {
186 typename Types::LayerPtrType layer(Types::createLayer()); 186 typename Types::LayerPtrType layer(Types::createLayer());
187 typename Types::LayerType* layerPtr = layer.get(); 187 typename Types::LayerType* layerPtr = layer.get();
188 setProperties(layerPtr, transform, position, bounds); 188 setProperties(layerPtr, transform, position, bounds);
189 parent->addChild(layer.release()); 189 parent->addChild(layer.release());
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 { 241 {
242 typename Types::ContentLayerType* layer = createDrawingLayer(parent, tra nsform, position, bounds, opaque); 242 typename Types::ContentLayerType* layer = createDrawingLayer(parent, tra nsform, position, bounds, opaque);
243 WebFilterOperations filters; 243 WebFilterOperations filters;
244 filters.append(WebFilterOperation::createGrayscaleFilter(0.5)); 244 filters.append(WebFilterOperation::createGrayscaleFilter(0.5));
245 layer->setFilters(filters); 245 layer->setFilters(filters);
246 return layer; 246 return layer;
247 } 247 }
248 248
249 void calcDrawEtc(TestContentLayerImpl* root) 249 void calcDrawEtc(TestContentLayerImpl* root)
250 { 250 {
251 ASSERT(root == m_root.get()); 251 DCHECK(root == m_root.get());
252 int dummyMaxTextureSize = 512; 252 int dummyMaxTextureSize = 512;
253 CCLayerSorter layerSorter; 253 CCLayerSorter layerSorter;
254 254
255 ASSERT(!root->renderSurface()); 255 DCHECK(!root->renderSurface());
256 256
257 CCLayerTreeHostCommon::calculateDrawTransforms(root, root->bounds(), 1, &layerSorter, dummyMaxTextureSize, m_renderSurfaceLayerListImpl); 257 CCLayerTreeHostCommon::calculateDrawTransforms(root, root->bounds(), 1, &layerSorter, dummyMaxTextureSize, m_renderSurfaceLayerListImpl);
258 258
259 m_layerIterator = m_layerIteratorBegin = Types::LayerIterator::begin(&m_ renderSurfaceLayerListImpl); 259 m_layerIterator = m_layerIteratorBegin = Types::LayerIterator::begin(&m_ renderSurfaceLayerListImpl);
260 } 260 }
261 261
262 void calcDrawEtc(TestContentLayerChromium* root) 262 void calcDrawEtc(TestContentLayerChromium* root)
263 { 263 {
264 ASSERT(root == m_root.get()); 264 DCHECK(root == m_root.get());
265 int dummyMaxTextureSize = 512; 265 int dummyMaxTextureSize = 512;
266 266
267 ASSERT(!root->renderSurface()); 267 DCHECK(!root->renderSurface());
268 268
269 CCLayerTreeHostCommon::calculateDrawTransforms(root, root->bounds(), 1, dummyMaxTextureSize, m_renderSurfaceLayerListChromium); 269 CCLayerTreeHostCommon::calculateDrawTransforms(root, root->bounds(), 1, dummyMaxTextureSize, m_renderSurfaceLayerListChromium);
270 270
271 m_layerIterator = m_layerIteratorBegin = Types::LayerIterator::begin(&m_ renderSurfaceLayerListChromium); 271 m_layerIterator = m_layerIteratorBegin = Types::LayerIterator::begin(&m_ renderSurfaceLayerListChromium);
272 } 272 }
273 273
274 void enterLayer(typename Types::LayerType* layer, typename Types::OcclusionT rackerType& occlusion) 274 void enterLayer(typename Types::LayerType* layer, typename Types::OcclusionT rackerType& occlusion)
275 { 275 {
276 ASSERT_EQ(layer, *m_layerIterator); 276 ASSERT_EQ(layer, *m_layerIterator);
277 ASSERT_TRUE(m_layerIterator.representsItself()); 277 ASSERT_TRUE(m_layerIterator.representsItself());
(...skipping 2740 matching lines...) Expand 10 before | Expand all | Expand 10 after
3018 EXPECT_RECT_EQ(IntRect(IntPoint(), trackingSize), occlusion.occlusionInS creenSpace().bounds()); 3018 EXPECT_RECT_EQ(IntRect(IntPoint(), trackingSize), occlusion.occlusionInS creenSpace().bounds());
3019 EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size()); 3019 EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
3020 EXPECT_RECT_EQ(IntRect(IntPoint(), trackingSize), occlusion.occlusionInT argetSurface().bounds()); 3020 EXPECT_RECT_EQ(IntRect(IntPoint(), trackingSize), occlusion.occlusionInT argetSurface().bounds());
3021 EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size()); 3021 EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
3022 } 3022 }
3023 }; 3023 };
3024 3024
3025 ALL_CCOCCLUSIONTRACKER_TEST(CCOcclusionTrackerTestMinimumTrackingSize); 3025 ALL_CCOCCLUSIONTRACKER_TEST(CCOcclusionTrackerTestMinimumTrackingSize);
3026 3026
3027 } // namespace 3027 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698