OLD | NEW |
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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 return layer; | 269 return layer; |
270 } | 270 } |
271 | 271 |
272 void calcDrawEtc(TestContentLayerImpl* root) | 272 void calcDrawEtc(TestContentLayerImpl* root) |
273 { | 273 { |
274 DCHECK(root == m_root.get()); | 274 DCHECK(root == m_root.get()); |
275 int dummyMaxTextureSize = 512; | 275 int dummyMaxTextureSize = 512; |
276 | 276 |
277 DCHECK(!root->render_surface()); | 277 DCHECK(!root->render_surface()); |
278 | 278 |
279 LayerTreeHostCommon::calculateDrawProperties(root, root->bounds(), 1, 1,
dummyMaxTextureSize, false, m_renderSurfaceLayerListImpl, false); | 279 LayerTreeHostCommon::CalculateDrawProperties(root, root->bounds(), 1, 1,
dummyMaxTextureSize, false, &m_renderSurfaceLayerListImpl, false); |
280 | 280 |
281 m_layerIterator = m_layerIteratorBegin = Types::TestLayerIterator::Begin
(&m_renderSurfaceLayerListImpl); | 281 m_layerIterator = m_layerIteratorBegin = Types::TestLayerIterator::Begin
(&m_renderSurfaceLayerListImpl); |
282 } | 282 } |
283 | 283 |
284 void calcDrawEtc(TestContentLayer* root) | 284 void calcDrawEtc(TestContentLayer* root) |
285 { | 285 { |
286 DCHECK(root == m_root.get()); | 286 DCHECK(root == m_root.get()); |
287 int dummyMaxTextureSize = 512; | 287 int dummyMaxTextureSize = 512; |
288 | 288 |
289 DCHECK(!root->render_surface()); | 289 DCHECK(!root->render_surface()); |
290 | 290 |
291 LayerTreeHostCommon::calculateDrawProperties(root, root->bounds(), 1, 1,
dummyMaxTextureSize, false, m_renderSurfaceLayerList); | 291 LayerTreeHostCommon::CalculateDrawProperties(root, root->bounds(), 1, 1,
dummyMaxTextureSize, false, &m_renderSurfaceLayerList); |
292 | 292 |
293 m_layerIterator = m_layerIteratorBegin = Types::TestLayerIterator::Begin
(&m_renderSurfaceLayerList); | 293 m_layerIterator = m_layerIteratorBegin = Types::TestLayerIterator::Begin
(&m_renderSurfaceLayerList); |
294 } | 294 } |
295 | 295 |
296 void EnterLayer(typename Types::LayerType* layer, typename Types::OcclusionT
rackerType& occlusion) | 296 void EnterLayer(typename Types::LayerType* layer, typename Types::OcclusionT
rackerType& occlusion) |
297 { | 297 { |
298 ASSERT_EQ(layer, *m_layerIterator); | 298 ASSERT_EQ(layer, *m_layerIterator); |
299 ASSERT_TRUE(m_layerIterator.represents_itself()); | 299 ASSERT_TRUE(m_layerIterator.represents_itself()); |
300 occlusion.EnterLayer(m_layerIterator); | 300 occlusion.EnterLayer(m_layerIterator); |
301 } | 301 } |
(...skipping 2747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3049 hasOcclusionFromOutsideTargetSurface = false; | 3049 hasOcclusionFromOutsideTargetSurface = false; |
3050 EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), occlusion.UnoccludedContributing
SurfaceContentRect(smaller, false, gfx::Rect(0, 0, 100, 100), &hasOcclusionFromO
utsideTargetSurface)); | 3050 EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), occlusion.UnoccludedContributing
SurfaceContentRect(smaller, false, gfx::Rect(0, 0, 100, 100), &hasOcclusionFromO
utsideTargetSurface)); |
3051 EXPECT_FALSE(hasOcclusionFromOutsideTargetSurface); | 3051 EXPECT_FALSE(hasOcclusionFromOutsideTargetSurface); |
3052 } | 3052 } |
3053 }; | 3053 }; |
3054 | 3054 |
3055 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestLayerClipIsExternalOcclusion) | 3055 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestLayerClipIsExternalOcclusion) |
3056 | 3056 |
3057 } // namespace | 3057 } // namespace |
3058 } // namespace cc | 3058 } // namespace cc |
OLD | NEW |