OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/layer_tree_host_impl.h" | 5 #include "cc/layer_tree_host_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 2395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2406 } | 2406 } |
2407 | 2407 |
2408 TEST_P(LayerTreeHostImplTest, contributingLayerEmptyScissorPartialSwap) | 2408 TEST_P(LayerTreeHostImplTest, contributingLayerEmptyScissorPartialSwap) |
2409 { | 2409 { |
2410 scoped_ptr<LayerTreeHostImpl> myHostImpl = setupLayersForOpacity(true, this,
&m_proxy); | 2410 scoped_ptr<LayerTreeHostImpl> myHostImpl = setupLayersForOpacity(true, this,
&m_proxy); |
2411 | 2411 |
2412 { | 2412 { |
2413 LayerTreeHostImpl::FrameData frame; | 2413 LayerTreeHostImpl::FrameData frame; |
2414 EXPECT_TRUE(myHostImpl->prepareToDraw(frame)); | 2414 EXPECT_TRUE(myHostImpl->prepareToDraw(frame)); |
2415 | 2415 |
2416 // Just for consistency, the most interesting stuff already happened | |
2417 myHostImpl->drawLayers(frame); | |
2418 myHostImpl->didDrawAllLayers(frame); | |
2419 | |
2420 // Verify all quads have been computed | 2416 // Verify all quads have been computed |
2421 ASSERT_EQ(2U, frame.renderPasses.size()); | 2417 ASSERT_EQ(2U, frame.renderPasses.size()); |
2422 ASSERT_EQ(1U, frame.renderPasses[0]->quad_list.size()); | 2418 ASSERT_EQ(1U, frame.renderPasses[0]->quad_list.size()); |
2423 ASSERT_EQ(1U, frame.renderPasses[1]->quad_list.size()); | 2419 ASSERT_EQ(1U, frame.renderPasses[1]->quad_list.size()); |
2424 EXPECT_EQ(DrawQuad::SOLID_COLOR, frame.renderPasses[0]->quad_list[0]->ma
terial); | 2420 EXPECT_EQ(DrawQuad::SOLID_COLOR, frame.renderPasses[0]->quad_list[0]->ma
terial); |
2425 EXPECT_EQ(DrawQuad::RENDER_PASS, frame.renderPasses[1]->quad_list[0]->ma
terial); | 2421 EXPECT_EQ(DrawQuad::RENDER_PASS, frame.renderPasses[1]->quad_list[0]->ma
terial); |
| 2422 |
| 2423 myHostImpl->drawLayers(frame); |
| 2424 myHostImpl->didDrawAllLayers(frame); |
2426 } | 2425 } |
2427 } | 2426 } |
2428 | 2427 |
2429 TEST_P(LayerTreeHostImplTest, contributingLayerEmptyScissorNoPartialSwap) | 2428 TEST_P(LayerTreeHostImplTest, contributingLayerEmptyScissorNoPartialSwap) |
2430 { | 2429 { |
2431 scoped_ptr<LayerTreeHostImpl> myHostImpl = setupLayersForOpacity(false, this
, &m_proxy); | 2430 scoped_ptr<LayerTreeHostImpl> myHostImpl = setupLayersForOpacity(false, this
, &m_proxy); |
2432 | 2431 |
2433 { | 2432 { |
2434 LayerTreeHostImpl::FrameData frame; | 2433 LayerTreeHostImpl::FrameData frame; |
2435 EXPECT_TRUE(myHostImpl->prepareToDraw(frame)); | 2434 EXPECT_TRUE(myHostImpl->prepareToDraw(frame)); |
2436 | 2435 |
2437 // Just for consistency, the most interesting stuff already happened | |
2438 myHostImpl->drawLayers(frame); | |
2439 myHostImpl->didDrawAllLayers(frame); | |
2440 | |
2441 // Verify all quads have been computed | 2436 // Verify all quads have been computed |
2442 ASSERT_EQ(2U, frame.renderPasses.size()); | 2437 ASSERT_EQ(2U, frame.renderPasses.size()); |
2443 ASSERT_EQ(1U, frame.renderPasses[0]->quad_list.size()); | 2438 ASSERT_EQ(1U, frame.renderPasses[0]->quad_list.size()); |
2444 ASSERT_EQ(1U, frame.renderPasses[1]->quad_list.size()); | 2439 ASSERT_EQ(1U, frame.renderPasses[1]->quad_list.size()); |
2445 EXPECT_EQ(DrawQuad::SOLID_COLOR, frame.renderPasses[0]->quad_list[0]->ma
terial); | 2440 EXPECT_EQ(DrawQuad::SOLID_COLOR, frame.renderPasses[0]->quad_list[0]->ma
terial); |
2446 EXPECT_EQ(DrawQuad::RENDER_PASS, frame.renderPasses[1]->quad_list[0]->ma
terial); | 2441 EXPECT_EQ(DrawQuad::RENDER_PASS, frame.renderPasses[1]->quad_list[0]->ma
terial); |
| 2442 |
| 2443 myHostImpl->drawLayers(frame); |
| 2444 myHostImpl->didDrawAllLayers(frame); |
2447 } | 2445 } |
2448 } | 2446 } |
2449 | 2447 |
2450 // Make sure that context lost notifications are propagated through the tree. | 2448 // Make sure that context lost notifications are propagated through the tree. |
2451 class ContextLostNotificationCheckLayer : public LayerImpl { | 2449 class ContextLostNotificationCheckLayer : public LayerImpl { |
2452 public: | 2450 public: |
2453 static scoped_ptr<LayerImpl> create(int id) { return scoped_ptr<LayerImpl>(n
ew ContextLostNotificationCheckLayer(id)); } | 2451 static scoped_ptr<LayerImpl> create(int id) { return scoped_ptr<LayerImpl>(n
ew ContextLostNotificationCheckLayer(id)); } |
2454 | 2452 |
2455 virtual void didLoseContext() OVERRIDE | 2453 virtual void didLoseContext() OVERRIDE |
2456 { | 2454 { |
(...skipping 2435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4892 { | 4890 { |
4893 pinchZoomPanViewportAndScrollBoundaryTest(2); | 4891 pinchZoomPanViewportAndScrollBoundaryTest(2); |
4894 } | 4892 } |
4895 | 4893 |
4896 INSTANTIATE_TEST_CASE_P(LayerTreeHostImplTests, | 4894 INSTANTIATE_TEST_CASE_P(LayerTreeHostImplTests, |
4897 LayerTreeHostImplTest, | 4895 LayerTreeHostImplTest, |
4898 ::testing::Values(false, true)); | 4896 ::testing::Values(false, true)); |
4899 | 4897 |
4900 } // namespace | 4898 } // namespace |
4901 } // namespace cc | 4899 } // namespace cc |
OLD | NEW |