OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_impl.h" | 5 #include "cc/trees/layer_tree_impl.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "cc/layers/heads_up_display_layer_impl.h" | 9 #include "cc/layers/heads_up_display_layer_impl.h" |
10 #include "cc/test/fake_layer_tree_host_impl.h" | 10 #include "cc/test/fake_layer_tree_host_impl.h" |
(...skipping 2040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2051 } | 2051 } |
2052 | 2052 |
2053 host_impl().active_tree()->BuildPropertyTreesForTesting(); | 2053 host_impl().active_tree()->BuildPropertyTreesForTesting(); |
2054 | 2054 |
2055 float device_scale_factor = 3.f; | 2055 float device_scale_factor = 3.f; |
2056 float page_scale_factor = 5.f; | 2056 float page_scale_factor = 5.f; |
2057 gfx::Size scaled_bounds_for_root = gfx::ScaleToCeiledSize( | 2057 gfx::Size scaled_bounds_for_root = gfx::ScaleToCeiledSize( |
2058 root->bounds(), device_scale_factor * page_scale_factor); | 2058 root->bounds(), device_scale_factor * page_scale_factor); |
2059 host_impl().SetViewportSize(scaled_bounds_for_root); | 2059 host_impl().SetViewportSize(scaled_bounds_for_root); |
2060 | 2060 |
2061 host_impl().active_tree()->SetViewportLayersFromIds(Layer::INVALID_ID, 1, 1, | 2061 host_impl().active_tree()->SetViewportLayersFromIds( |
2062 Layer::INVALID_ID); | 2062 Layer::INVALID_ID, root->id(), Layer::INVALID_ID, Layer::INVALID_ID); |
2063 host_impl().active_tree()->SetDeviceScaleFactor(device_scale_factor); | 2063 host_impl().active_tree()->SetDeviceScaleFactor(device_scale_factor); |
2064 host_impl().active_tree()->SetPageScaleOnActiveTree(page_scale_factor); | 2064 host_impl().active_tree()->SetPageScaleOnActiveTree(page_scale_factor); |
2065 | 2065 |
2066 host_impl().active_tree()->PushPageScaleFromMainThread( | 2066 host_impl().active_tree()->PushPageScaleFromMainThread( |
2067 page_scale_factor, page_scale_factor, page_scale_factor); | 2067 page_scale_factor, page_scale_factor, page_scale_factor); |
2068 host_impl().active_tree()->SetPageScaleOnActiveTree(page_scale_factor); | 2068 host_impl().active_tree()->SetPageScaleOnActiveTree(page_scale_factor); |
2069 host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); | 2069 host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); |
2070 | 2070 |
2071 // Sanity check the scenario we just created. | 2071 // Sanity check the scenario we just created. |
2072 ASSERT_EQ(1u, GetRenderSurfaceList().size()); | 2072 ASSERT_EQ(1u, GetRenderSurfaceList().size()); |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2350 auto weak_promise = promise->AsWeakPtr(); | 2350 auto weak_promise = promise->AsWeakPtr(); |
2351 host_impl().active_tree()->QueueSwapPromise(std::move(promise)); | 2351 host_impl().active_tree()->QueueSwapPromise(std::move(promise)); |
2352 host_impl().active_tree()->BreakSwapPromises( | 2352 host_impl().active_tree()->BreakSwapPromises( |
2353 SwapPromise::DidNotSwapReason::SWAP_FAILS); | 2353 SwapPromise::DidNotSwapReason::SWAP_FAILS); |
2354 EXPECT_FALSE(weak_promise); | 2354 EXPECT_FALSE(weak_promise); |
2355 } | 2355 } |
2356 } | 2356 } |
2357 | 2357 |
2358 } // namespace | 2358 } // namespace |
2359 } // namespace cc | 2359 } // namespace cc |
OLD | NEW |