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

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

Issue 1412663005: Introduce painted-device-scale-factor and use it when --enable-use-zoom-for-dsf is specified. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
OLDNEW
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.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 17 matching lines...) Expand all
28 #include "cc/output/swap_promise.h" 28 #include "cc/output/swap_promise.h"
29 #include "cc/playback/display_item_list_settings.h" 29 #include "cc/playback/display_item_list_settings.h"
30 #include "cc/quads/draw_quad.h" 30 #include "cc/quads/draw_quad.h"
31 #include "cc/quads/io_surface_draw_quad.h" 31 #include "cc/quads/io_surface_draw_quad.h"
32 #include "cc/quads/render_pass_draw_quad.h" 32 #include "cc/quads/render_pass_draw_quad.h"
33 #include "cc/quads/tile_draw_quad.h" 33 #include "cc/quads/tile_draw_quad.h"
34 #include "cc/test/fake_content_layer_client.h" 34 #include "cc/test/fake_content_layer_client.h"
35 #include "cc/test/fake_display_list_recording_source.h" 35 #include "cc/test/fake_display_list_recording_source.h"
36 #include "cc/test/fake_layer_tree_host_client.h" 36 #include "cc/test/fake_layer_tree_host_client.h"
37 #include "cc/test/fake_output_surface.h" 37 #include "cc/test/fake_output_surface.h"
38 #include "cc/test/fake_output_surface_client.h"
danakj 2015/10/24 00:08:07 not needed?
oshima 2015/10/27 20:28:09 Done.
38 #include "cc/test/fake_painted_scrollbar_layer.h" 39 #include "cc/test/fake_painted_scrollbar_layer.h"
39 #include "cc/test/fake_picture_layer.h" 40 #include "cc/test/fake_picture_layer.h"
40 #include "cc/test/fake_picture_layer_impl.h" 41 #include "cc/test/fake_picture_layer_impl.h"
41 #include "cc/test/fake_proxy.h" 42 #include "cc/test/fake_proxy.h"
42 #include "cc/test/fake_scoped_ui_resource.h" 43 #include "cc/test/fake_scoped_ui_resource.h"
43 #include "cc/test/fake_video_frame_provider.h" 44 #include "cc/test/fake_video_frame_provider.h"
44 #include "cc/test/geometry_test_utils.h" 45 #include "cc/test/geometry_test_utils.h"
45 #include "cc/test/layer_tree_test.h" 46 #include "cc/test/layer_tree_test.h"
46 #include "cc/test/test_shared_bitmap_manager.h" 47 #include "cc/test/test_shared_bitmap_manager.h"
47 #include "cc/test/test_web_graphics_context_3d.h" 48 #include "cc/test/test_web_graphics_context_3d.h"
(...skipping 6323 matching lines...) Expand 10 before | Expand all | Expand 10 after
6371 // that this works correctly and the output surface is destroyed on 6372 // that this works correctly and the output surface is destroyed on
6372 // the correct thread. 6373 // the correct thread.
6373 EndTest(); 6374 EndTest();
6374 } 6375 }
6375 6376
6376 void AfterTest() override {} 6377 void AfterTest() override {}
6377 }; 6378 };
6378 6379
6379 MULTI_THREAD_TEST_F(LayerTreeHostTestDestroyWhileInitializingOutputSurface); 6380 MULTI_THREAD_TEST_F(LayerTreeHostTestDestroyWhileInitializingOutputSurface);
6380 6381
6382 // Makes sure that painted_device_scale_factor is propagated to the
6383 // frame's metadata.
6384 class LayerTreeHostTestPaintedDeviceScaleFactor : public LayerTreeHostTest {
6385 protected:
6386 void BeginTest() override {
6387 layer_tree_host()->SetPaintedDeviceScaleFactor(2.0f);
6388 EXPECT_EQ(1.0f, layer_tree_host()->device_scale_factor());
6389 PostSetNeedsCommitToMainThread();
6390 }
6391
6392 void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override {
6393 EXPECT_EQ(2.0f,
danakj 2015/10/24 00:07:00 Great, thanks. The cc parts LGTM
6394 output_surface()->last_sent_frame().metadata.device_scale_factor);
6395 EXPECT_EQ(2.0f, host_impl->active_tree()->painted_device_scale_factor());
6396 EXPECT_EQ(1.0f, host_impl->active_tree()->device_scale_factor());
6397 EndTest();
6398 }
6399
6400 void AfterTest() override {}
6401 };
6402
6403 MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor);
danakj 2015/10/24 00:08:07 Why is it MULTI only and not SINGLE_AND_MULTI?
oshima 2015/10/27 20:28:09 Done.
6404
6381 } // namespace 6405 } // namespace
6382 } // namespace cc 6406 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698