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/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 7457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7468 { | 7468 { |
7469 const auto& root_pass = frame.render_passes.back(); | 7469 const auto& root_pass = frame.render_passes.back(); |
7470 ASSERT_EQ(1u, root_pass->quad_list.size()); | 7470 ASSERT_EQ(1u, root_pass->quad_list.size()); |
7471 EXPECT_EQ(DrawQuad::SOLID_COLOR, root_pass->quad_list.front()->material); | 7471 EXPECT_EQ(DrawQuad::SOLID_COLOR, root_pass->quad_list.front()->material); |
7472 } | 7472 } |
7473 host_impl_->DrawLayers(&frame); | 7473 host_impl_->DrawLayers(&frame); |
7474 host_impl_->DidDrawAllLayers(frame); | 7474 host_impl_->DidDrawAllLayers(frame); |
7475 host_impl_->SwapBuffers(frame); | 7475 host_impl_->SwapBuffers(frame); |
7476 | 7476 |
7477 // Cause damage so we would draw something if possible. | 7477 // Cause damage so we would draw something if possible. |
7478 host_impl_->SetFullRootLayerDamage(); | 7478 host_impl_->SetFullViewportDamage(); |
7479 | 7479 |
7480 // Verify no quads are drawn when transparent background is set. | 7480 // Verify no quads are drawn when transparent background is set. |
7481 host_impl_->active_tree()->set_has_transparent_background(true); | 7481 host_impl_->active_tree()->set_has_transparent_background(true); |
7482 host_impl_->SetFullRootLayerDamage(); | 7482 host_impl_->SetFullViewportDamage(); |
7483 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); | 7483 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); |
7484 { | 7484 { |
7485 const auto& root_pass = frame.render_passes.back(); | 7485 const auto& root_pass = frame.render_passes.back(); |
7486 ASSERT_EQ(0u, root_pass->quad_list.size()); | 7486 ASSERT_EQ(0u, root_pass->quad_list.size()); |
7487 } | 7487 } |
7488 host_impl_->DrawLayers(&frame); | 7488 host_impl_->DrawLayers(&frame); |
7489 host_impl_->DidDrawAllLayers(frame); | 7489 host_impl_->DidDrawAllLayers(frame); |
7490 host_impl_->SwapBuffers(frame); | 7490 host_impl_->SwapBuffers(frame); |
7491 } | 7491 } |
7492 | 7492 |
(...skipping 3401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10894 EXPECT_TRUE(host_impl_->use_gpu_rasterization()); | 10894 EXPECT_TRUE(host_impl_->use_gpu_rasterization()); |
10895 | 10895 |
10896 // Re-initialize with a software output surface. | 10896 // Re-initialize with a software output surface. |
10897 output_surface_ = FakeOutputSurface::CreateDelegatingSoftware(); | 10897 output_surface_ = FakeOutputSurface::CreateDelegatingSoftware(); |
10898 host_impl_->InitializeRenderer(output_surface_.get()); | 10898 host_impl_->InitializeRenderer(output_surface_.get()); |
10899 EXPECT_FALSE(host_impl_->use_gpu_rasterization()); | 10899 EXPECT_FALSE(host_impl_->use_gpu_rasterization()); |
10900 } | 10900 } |
10901 | 10901 |
10902 } // namespace | 10902 } // namespace |
10903 } // namespace cc | 10903 } // namespace cc |
OLD | NEW |