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 <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 5641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5652 TEST_F(LayerTreeHostImplTestDeferredInitialize, Success) { | 5652 TEST_F(LayerTreeHostImplTestDeferredInitialize, Success) { |
5653 // Software draw. | 5653 // Software draw. |
5654 DrawFrame(); | 5654 DrawFrame(); |
5655 | 5655 |
5656 EXPECT_FALSE(host_impl_->output_surface()->context_provider()); | 5656 EXPECT_FALSE(host_impl_->output_surface()->context_provider()); |
5657 | 5657 |
5658 // DeferredInitialize and hardware draw. | 5658 // DeferredInitialize and hardware draw. |
5659 did_update_renderer_capabilities_ = false; | 5659 did_update_renderer_capabilities_ = false; |
5660 EXPECT_TRUE( | 5660 EXPECT_TRUE( |
5661 output_surface_->InitializeAndSetContext3d(onscreen_context_provider_)); | 5661 output_surface_->InitializeAndSetContext3d(onscreen_context_provider_)); |
5662 EXPECT_EQ(onscreen_context_provider_, | 5662 EXPECT_EQ(onscreen_context_provider_.get(), |
5663 host_impl_->output_surface()->context_provider()); | 5663 host_impl_->output_surface()->context_provider()); |
5664 EXPECT_TRUE(did_update_renderer_capabilities_); | 5664 EXPECT_TRUE(did_update_renderer_capabilities_); |
5665 | 5665 |
5666 // Defer intialized GL draw. | 5666 // Defer intialized GL draw. |
5667 DrawFrame(); | 5667 DrawFrame(); |
5668 | 5668 |
5669 // Revert back to software. | 5669 // Revert back to software. |
5670 did_update_renderer_capabilities_ = false; | 5670 did_update_renderer_capabilities_ = false; |
5671 output_surface_->ReleaseGL(); | 5671 output_surface_->ReleaseGL(); |
5672 EXPECT_FALSE(host_impl_->output_surface()->context_provider()); | 5672 EXPECT_FALSE(host_impl_->output_surface()->context_provider()); |
(...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6979 // surface. | 6979 // surface. |
6980 EXPECT_EQ(0, num_lost_surfaces_); | 6980 EXPECT_EQ(0, num_lost_surfaces_); |
6981 host_impl_->DidLoseOutputSurface(); | 6981 host_impl_->DidLoseOutputSurface(); |
6982 EXPECT_EQ(1, num_lost_surfaces_); | 6982 EXPECT_EQ(1, num_lost_surfaces_); |
6983 host_impl_->DidLoseOutputSurface(); | 6983 host_impl_->DidLoseOutputSurface(); |
6984 EXPECT_LE(1, num_lost_surfaces_); | 6984 EXPECT_LE(1, num_lost_surfaces_); |
6985 } | 6985 } |
6986 | 6986 |
6987 } // namespace | 6987 } // namespace |
6988 } // namespace cc | 6988 } // namespace cc |
OLD | NEW |