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 "cc/animation/mutable_properties.h" | 8 #include "cc/animation/mutable_properties.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 2206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2217 | 2217 |
2218 TEST_F(LayerTreeImplTest, DeviceScaleFactorNeedsDrawPropertiesUpdate) { | 2218 TEST_F(LayerTreeImplTest, DeviceScaleFactorNeedsDrawPropertiesUpdate) { |
2219 host_impl().active_tree()->BuildPropertyTreesForTesting(); | 2219 host_impl().active_tree()->BuildPropertyTreesForTesting(); |
2220 host_impl().active_tree()->SetDeviceScaleFactor(1.f); | 2220 host_impl().active_tree()->SetDeviceScaleFactor(1.f); |
2221 host_impl().active_tree()->UpdateDrawProperties(false); | 2221 host_impl().active_tree()->UpdateDrawProperties(false); |
2222 EXPECT_FALSE(host_impl().active_tree()->needs_update_draw_properties()); | 2222 EXPECT_FALSE(host_impl().active_tree()->needs_update_draw_properties()); |
2223 host_impl().active_tree()->SetDeviceScaleFactor(2.f); | 2223 host_impl().active_tree()->SetDeviceScaleFactor(2.f); |
2224 EXPECT_TRUE(host_impl().active_tree()->needs_update_draw_properties()); | 2224 EXPECT_TRUE(host_impl().active_tree()->needs_update_draw_properties()); |
2225 } | 2225 } |
2226 | 2226 |
| 2227 TEST_F(LayerTreeImplTest, DeviceColorSpaceDoesNotNeedDrawPropertiesUpdate) { |
| 2228 host_impl().active_tree()->BuildPropertyTreesForTesting(); |
| 2229 host_impl().active_tree()->SetDeviceColorSpace( |
| 2230 gfx::ColorSpace::CreateXYZD50()); |
| 2231 host_impl().active_tree()->UpdateDrawProperties(false); |
| 2232 EXPECT_FALSE(host_impl().active_tree()->needs_update_draw_properties()); |
| 2233 host_impl().active_tree()->SetDeviceColorSpace(gfx::ColorSpace::CreateSRGB()); |
| 2234 EXPECT_FALSE(host_impl().active_tree()->needs_update_draw_properties()); |
| 2235 } |
| 2236 |
2227 TEST_F(LayerTreeImplTest, HitTestingCorrectLayerWheelListener) { | 2237 TEST_F(LayerTreeImplTest, HitTestingCorrectLayerWheelListener) { |
2228 host_impl().active_tree()->set_event_listener_properties( | 2238 host_impl().active_tree()->set_event_listener_properties( |
2229 EventListenerClass::kMouseWheel, EventListenerProperties::kBlocking); | 2239 EventListenerClass::kMouseWheel, EventListenerProperties::kBlocking); |
2230 | 2240 |
2231 LayerImpl* root = root_layer(); | 2241 LayerImpl* root = root_layer(); |
2232 std::unique_ptr<LayerImpl> left_child = | 2242 std::unique_ptr<LayerImpl> left_child = |
2233 LayerImpl::Create(host_impl().active_tree(), 2); | 2243 LayerImpl::Create(host_impl().active_tree(), 2); |
2234 std::unique_ptr<LayerImpl> right_child = | 2244 std::unique_ptr<LayerImpl> right_child = |
2235 LayerImpl::Create(host_impl().active_tree(), 3); | 2245 LayerImpl::Create(host_impl().active_tree(), 3); |
2236 | 2246 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2371 auto weak_promise = promise->AsWeakPtr(); | 2381 auto weak_promise = promise->AsWeakPtr(); |
2372 host_impl().active_tree()->QueueSwapPromise(std::move(promise)); | 2382 host_impl().active_tree()->QueueSwapPromise(std::move(promise)); |
2373 host_impl().active_tree()->BreakSwapPromises( | 2383 host_impl().active_tree()->BreakSwapPromises( |
2374 SwapPromise::DidNotSwapReason::SWAP_FAILS); | 2384 SwapPromise::DidNotSwapReason::SWAP_FAILS); |
2375 EXPECT_FALSE(weak_promise); | 2385 EXPECT_FALSE(weak_promise); |
2376 } | 2386 } |
2377 } | 2387 } |
2378 | 2388 |
2379 } // namespace | 2389 } // namespace |
2380 } // namespace cc | 2390 } // namespace cc |
OLD | NEW |