Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Side by Side Diff: cc/trees/layer_tree_impl_unittest.cc

Issue 2735943002: cc: Clarify that color spaces are for raster (Closed)
Patch Set: Rebase (a few times) Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_impl.cc ('k') | cc/trees/layer_tree_settings.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2224 matching lines...) Expand 10 before | Expand all | Expand 10 after
2235 2235
2236 TEST_F(LayerTreeImplTest, DeviceScaleFactorNeedsDrawPropertiesUpdate) { 2236 TEST_F(LayerTreeImplTest, DeviceScaleFactorNeedsDrawPropertiesUpdate) {
2237 host_impl().active_tree()->BuildPropertyTreesForTesting(); 2237 host_impl().active_tree()->BuildPropertyTreesForTesting();
2238 host_impl().active_tree()->SetDeviceScaleFactor(1.f); 2238 host_impl().active_tree()->SetDeviceScaleFactor(1.f);
2239 host_impl().active_tree()->UpdateDrawProperties(false); 2239 host_impl().active_tree()->UpdateDrawProperties(false);
2240 EXPECT_FALSE(host_impl().active_tree()->needs_update_draw_properties()); 2240 EXPECT_FALSE(host_impl().active_tree()->needs_update_draw_properties());
2241 host_impl().active_tree()->SetDeviceScaleFactor(2.f); 2241 host_impl().active_tree()->SetDeviceScaleFactor(2.f);
2242 EXPECT_TRUE(host_impl().active_tree()->needs_update_draw_properties()); 2242 EXPECT_TRUE(host_impl().active_tree()->needs_update_draw_properties());
2243 } 2243 }
2244 2244
2245 TEST_F(LayerTreeImplTest, DeviceColorSpaceDoesNotNeedDrawPropertiesUpdate) { 2245 TEST_F(LayerTreeImplTest, RasterColorSpaceDoesNotNeedDrawPropertiesUpdate) {
2246 host_impl().active_tree()->BuildPropertyTreesForTesting(); 2246 host_impl().active_tree()->BuildPropertyTreesForTesting();
2247 host_impl().active_tree()->SetDeviceColorSpace( 2247 host_impl().active_tree()->SetRasterColorSpace(
2248 gfx::ColorSpace::CreateXYZD50()); 2248 gfx::ColorSpace::CreateXYZD50());
2249 host_impl().active_tree()->UpdateDrawProperties(false); 2249 host_impl().active_tree()->UpdateDrawProperties(false);
2250 EXPECT_FALSE(host_impl().active_tree()->needs_update_draw_properties()); 2250 EXPECT_FALSE(host_impl().active_tree()->needs_update_draw_properties());
2251 host_impl().active_tree()->SetDeviceColorSpace(gfx::ColorSpace::CreateSRGB()); 2251 host_impl().active_tree()->SetRasterColorSpace(gfx::ColorSpace::CreateSRGB());
2252 EXPECT_FALSE(host_impl().active_tree()->needs_update_draw_properties()); 2252 EXPECT_FALSE(host_impl().active_tree()->needs_update_draw_properties());
2253 } 2253 }
2254 2254
2255 TEST_F(LayerTreeImplTest, HitTestingCorrectLayerWheelListener) { 2255 TEST_F(LayerTreeImplTest, HitTestingCorrectLayerWheelListener) {
2256 host_impl().active_tree()->set_event_listener_properties( 2256 host_impl().active_tree()->set_event_listener_properties(
2257 EventListenerClass::kMouseWheel, EventListenerProperties::kBlocking); 2257 EventListenerClass::kMouseWheel, EventListenerProperties::kBlocking);
2258 2258
2259 LayerImpl* root = root_layer(); 2259 LayerImpl* root = root_layer();
2260 std::unique_ptr<LayerImpl> left_child = 2260 std::unique_ptr<LayerImpl> left_child =
2261 LayerImpl::Create(host_impl().active_tree(), 2); 2261 LayerImpl::Create(host_impl().active_tree(), 2);
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
2401 auto weak_promise = promise->AsWeakPtr(); 2401 auto weak_promise = promise->AsWeakPtr();
2402 host_impl().active_tree()->QueueSwapPromise(std::move(promise)); 2402 host_impl().active_tree()->QueueSwapPromise(std::move(promise));
2403 host_impl().active_tree()->BreakSwapPromises( 2403 host_impl().active_tree()->BreakSwapPromises(
2404 SwapPromise::DidNotSwapReason::SWAP_FAILS); 2404 SwapPromise::DidNotSwapReason::SWAP_FAILS);
2405 EXPECT_FALSE(weak_promise); 2405 EXPECT_FALSE(weak_promise);
2406 } 2406 }
2407 } 2407 }
2408 2408
2409 } // namespace 2409 } // namespace
2410 } // namespace cc 2410 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_impl.cc ('k') | cc/trees/layer_tree_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698