| 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 7351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7362 { | 7362 { |
| 7363 const auto& root_pass = frame.render_passes.back(); | 7363 const auto& root_pass = frame.render_passes.back(); |
| 7364 ASSERT_EQ(1u, root_pass->quad_list.size()); | 7364 ASSERT_EQ(1u, root_pass->quad_list.size()); |
| 7365 EXPECT_EQ(DrawQuad::SOLID_COLOR, root_pass->quad_list.front()->material); | 7365 EXPECT_EQ(DrawQuad::SOLID_COLOR, root_pass->quad_list.front()->material); |
| 7366 } | 7366 } |
| 7367 host_impl_->DrawLayers(&frame); | 7367 host_impl_->DrawLayers(&frame); |
| 7368 host_impl_->DidDrawAllLayers(frame); | 7368 host_impl_->DidDrawAllLayers(frame); |
| 7369 host_impl_->SwapBuffers(frame); | 7369 host_impl_->SwapBuffers(frame); |
| 7370 | 7370 |
| 7371 // Cause damage so we would draw something if possible. | 7371 // Cause damage so we would draw something if possible. |
| 7372 host_impl_->SetFullRootLayerDamage(); | 7372 host_impl_->SetFullViewportDamage(); |
| 7373 | 7373 |
| 7374 // Verify no quads are drawn when transparent background is set. | 7374 // Verify no quads are drawn when transparent background is set. |
| 7375 host_impl_->active_tree()->set_has_transparent_background(true); | 7375 host_impl_->active_tree()->set_has_transparent_background(true); |
| 7376 host_impl_->SetFullRootLayerDamage(); | 7376 host_impl_->SetFullViewportDamage(); |
| 7377 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); | 7377 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); |
| 7378 { | 7378 { |
| 7379 const auto& root_pass = frame.render_passes.back(); | 7379 const auto& root_pass = frame.render_passes.back(); |
| 7380 ASSERT_EQ(0u, root_pass->quad_list.size()); | 7380 ASSERT_EQ(0u, root_pass->quad_list.size()); |
| 7381 } | 7381 } |
| 7382 host_impl_->DrawLayers(&frame); | 7382 host_impl_->DrawLayers(&frame); |
| 7383 host_impl_->DidDrawAllLayers(frame); | 7383 host_impl_->DidDrawAllLayers(frame); |
| 7384 host_impl_->SwapBuffers(frame); | 7384 host_impl_->SwapBuffers(frame); |
| 7385 } | 7385 } |
| 7386 | 7386 |
| (...skipping 3401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10788 EXPECT_TRUE(host_impl_->use_gpu_rasterization()); | 10788 EXPECT_TRUE(host_impl_->use_gpu_rasterization()); |
| 10789 | 10789 |
| 10790 // Re-initialize with a software output surface. | 10790 // Re-initialize with a software output surface. |
| 10791 output_surface_ = FakeOutputSurface::CreateDelegatingSoftware(); | 10791 output_surface_ = FakeOutputSurface::CreateDelegatingSoftware(); |
| 10792 host_impl_->InitializeRenderer(output_surface_.get()); | 10792 host_impl_->InitializeRenderer(output_surface_.get()); |
| 10793 EXPECT_FALSE(host_impl_->use_gpu_rasterization()); | 10793 EXPECT_FALSE(host_impl_->use_gpu_rasterization()); |
| 10794 } | 10794 } |
| 10795 | 10795 |
| 10796 } // namespace | 10796 } // namespace |
| 10797 } // namespace cc | 10797 } // namespace cc |
| OLD | NEW |