| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/layers/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 2579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2590 // not having this update will cause a crash. | 2590 // not having this update will cause a crash. |
| 2591 TEST_F(DeferredInitPictureLayerImplTest, PreventUpdateTilesDuringLostContext) { | 2591 TEST_F(DeferredInitPictureLayerImplTest, PreventUpdateTilesDuringLostContext) { |
| 2592 host_impl_.pending_tree()->UpdateDrawProperties(); | 2592 host_impl_.pending_tree()->UpdateDrawProperties(); |
| 2593 host_impl_.active_tree()->UpdateDrawProperties(); | 2593 host_impl_.active_tree()->UpdateDrawProperties(); |
| 2594 EXPECT_FALSE(host_impl_.pending_tree()->needs_update_draw_properties()); | 2594 EXPECT_FALSE(host_impl_.pending_tree()->needs_update_draw_properties()); |
| 2595 EXPECT_FALSE(host_impl_.active_tree()->needs_update_draw_properties()); | 2595 EXPECT_FALSE(host_impl_.active_tree()->needs_update_draw_properties()); |
| 2596 | 2596 |
| 2597 FakeOutputSurface* fake_output_surface = | 2597 FakeOutputSurface* fake_output_surface = |
| 2598 static_cast<FakeOutputSurface*>(host_impl_.output_surface()); | 2598 static_cast<FakeOutputSurface*>(host_impl_.output_surface()); |
| 2599 ASSERT_TRUE(fake_output_surface->InitializeAndSetContext3d( | 2599 ASSERT_TRUE(fake_output_surface->InitializeAndSetContext3d( |
| 2600 TestContextProvider::Create())); | 2600 TestContextProvider::Create(), TestContextProvider::Create())); |
| 2601 | 2601 |
| 2602 // These will crash PictureLayerImpl if this is not true. | 2602 // These will crash PictureLayerImpl if this is not true. |
| 2603 ASSERT_TRUE(host_impl_.pending_tree()->needs_update_draw_properties()); | 2603 ASSERT_TRUE(host_impl_.pending_tree()->needs_update_draw_properties()); |
| 2604 ASSERT_TRUE(host_impl_.active_tree()->needs_update_draw_properties()); | 2604 ASSERT_TRUE(host_impl_.active_tree()->needs_update_draw_properties()); |
| 2605 host_impl_.active_tree()->UpdateDrawProperties(); | 2605 host_impl_.active_tree()->UpdateDrawProperties(); |
| 2606 } | 2606 } |
| 2607 | 2607 |
| 2608 TEST_F(PictureLayerImplTest, HighResTilingDuringAnimationForCpuRasterization) { | 2608 TEST_F(PictureLayerImplTest, HighResTilingDuringAnimationForCpuRasterization) { |
| 2609 gfx::Size viewport_size(1000, 1000); | 2609 gfx::Size viewport_size(1000, 1000); |
| 2610 host_impl_.SetViewportSize(viewport_size); | 2610 host_impl_.SetViewportSize(viewport_size); |
| (...skipping 2323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4934 result = layer->CalculateTileSize(gfx::Size(447, 400)); | 4934 result = layer->CalculateTileSize(gfx::Size(447, 400)); |
| 4935 EXPECT_EQ(result.width(), 448); | 4935 EXPECT_EQ(result.width(), 448); |
| 4936 EXPECT_EQ(result.height(), 448); | 4936 EXPECT_EQ(result.height(), 448); |
| 4937 result = layer->CalculateTileSize(gfx::Size(500, 499)); | 4937 result = layer->CalculateTileSize(gfx::Size(500, 499)); |
| 4938 EXPECT_EQ(result.width(), 512); | 4938 EXPECT_EQ(result.width(), 512); |
| 4939 EXPECT_EQ(result.height(), 500 + 2); | 4939 EXPECT_EQ(result.height(), 500 + 2); |
| 4940 } | 4940 } |
| 4941 | 4941 |
| 4942 } // namespace | 4942 } // namespace |
| 4943 } // namespace cc | 4943 } // namespace cc |
| OLD | NEW |