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

Side by Side Diff: cc/tiles/tile_manager_unittest.cc

Issue 2337913003: Fork cc::OutputSurface into cc::CompositorFrameSink. (Closed)
Patch Set: cfsfork: android-vulkan Created 4 years, 3 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/tiles/tile_manager_perftest.cc ('k') | cc/trees/channel_impl.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 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
11 #include "cc/playback/raster_source.h" 11 #include "cc/playback/raster_source.h"
12 #include "cc/playback/recording_source.h" 12 #include "cc/playback/recording_source.h"
13 #include "cc/raster/raster_buffer.h" 13 #include "cc/raster/raster_buffer.h"
14 #include "cc/raster/synchronous_task_graph_runner.h" 14 #include "cc/raster/synchronous_task_graph_runner.h"
15 #include "cc/resources/resource_pool.h" 15 #include "cc/resources/resource_pool.h"
16 #include "cc/test/begin_frame_args_test.h" 16 #include "cc/test/begin_frame_args_test.h"
17 #include "cc/test/fake_compositor_frame_sink.h"
18 #include "cc/test/fake_compositor_frame_sink_client.h"
17 #include "cc/test/fake_impl_task_runner_provider.h" 19 #include "cc/test/fake_impl_task_runner_provider.h"
18 #include "cc/test/fake_layer_tree_host_impl.h" 20 #include "cc/test/fake_layer_tree_host_impl.h"
19 #include "cc/test/fake_output_surface.h"
20 #include "cc/test/fake_output_surface_client.h"
21 #include "cc/test/fake_picture_layer_impl.h" 21 #include "cc/test/fake_picture_layer_impl.h"
22 #include "cc/test/fake_picture_layer_tiling_client.h" 22 #include "cc/test/fake_picture_layer_tiling_client.h"
23 #include "cc/test/fake_raster_source.h" 23 #include "cc/test/fake_raster_source.h"
24 #include "cc/test/fake_recording_source.h" 24 #include "cc/test/fake_recording_source.h"
25 #include "cc/test/fake_tile_manager.h" 25 #include "cc/test/fake_tile_manager.h"
26 #include "cc/test/fake_tile_task_manager.h" 26 #include "cc/test/fake_tile_task_manager.h"
27 #include "cc/test/layer_tree_settings_for_testing.h" 27 #include "cc/test/layer_tree_settings_for_testing.h"
28 #include "cc/test/test_gpu_memory_buffer_manager.h" 28 #include "cc/test/test_gpu_memory_buffer_manager.h"
29 #include "cc/test/test_layer_tree_host_base.h" 29 #include "cc/test/test_layer_tree_host_base.h"
30 #include "cc/test/test_shared_bitmap_manager.h" 30 #include "cc/test/test_shared_bitmap_manager.h"
(...skipping 1468 matching lines...) Expand 10 before | Expand all | Expand 10 after
1499 TaskRunnerProvider* task_runner_provider, 1499 TaskRunnerProvider* task_runner_provider,
1500 SharedBitmapManager* shared_bitmap_manager, 1500 SharedBitmapManager* shared_bitmap_manager,
1501 TaskGraphRunner* task_graph_runner, 1501 TaskGraphRunner* task_graph_runner,
1502 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) override { 1502 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) override {
1503 return base::MakeUnique<MockLayerTreeHostImpl>( 1503 return base::MakeUnique<MockLayerTreeHostImpl>(
1504 settings, task_runner_provider, shared_bitmap_manager, 1504 settings, task_runner_provider, shared_bitmap_manager,
1505 task_graph_runner, gpu_memory_buffer_manager); 1505 task_graph_runner, gpu_memory_buffer_manager);
1506 } 1506 }
1507 1507
1508 // By default use software compositing (no context provider). 1508 // By default use software compositing (no context provider).
1509 std::unique_ptr<OutputSurface> CreateOutputSurface() override { 1509 std::unique_ptr<CompositorFrameSink> CreateCompositorFrameSink() override {
1510 return FakeOutputSurface::CreateDelegatingSoftware(); 1510 return FakeCompositorFrameSink::CreateSoftware();
1511 } 1511 }
1512 1512
1513 MockLayerTreeHostImpl& MockHostImpl() { 1513 MockLayerTreeHostImpl& MockHostImpl() {
1514 return *static_cast<MockLayerTreeHostImpl*>(host_impl()); 1514 return *static_cast<MockLayerTreeHostImpl*>(host_impl());
1515 } 1515 }
1516 }; 1516 };
1517 1517
1518 // Test to ensure that we call NotifyAllTileTasksCompleted when PrepareTiles is 1518 // Test to ensure that we call NotifyAllTileTasksCompleted when PrepareTiles is
1519 // called. 1519 // called.
1520 TEST_F(TileManagerTest, AllWorkFinishedTest) { 1520 TEST_F(TileManagerTest, AllWorkFinishedTest) {
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
1663 } 1663 }
1664 } 1664 }
1665 } 1665 }
1666 1666
1667 class ActivationTasksDoNotBlockReadyToDrawTest : public TileManagerTest { 1667 class ActivationTasksDoNotBlockReadyToDrawTest : public TileManagerTest {
1668 protected: 1668 protected:
1669 std::unique_ptr<TaskGraphRunner> CreateTaskGraphRunner() override { 1669 std::unique_ptr<TaskGraphRunner> CreateTaskGraphRunner() override {
1670 return base::MakeUnique<SynchronousTaskGraphRunner>(); 1670 return base::MakeUnique<SynchronousTaskGraphRunner>();
1671 } 1671 }
1672 1672
1673 std::unique_ptr<OutputSurface> CreateOutputSurface() override { 1673 std::unique_ptr<CompositorFrameSink> CreateCompositorFrameSink() override {
1674 return FakeOutputSurface::CreateDelegating3d(); 1674 return FakeCompositorFrameSink::Create3d();
1675 } 1675 }
1676 1676
1677 LayerTreeSettings CreateSettings() override { 1677 LayerTreeSettings CreateSettings() override {
1678 LayerTreeSettings settings = TileManagerTest::CreateSettings(); 1678 LayerTreeSettings settings = TileManagerTest::CreateSettings();
1679 settings.gpu_rasterization_forced = true; 1679 settings.gpu_rasterization_forced = true;
1680 return settings; 1680 return settings;
1681 } 1681 }
1682 }; 1682 };
1683 1683
1684 TEST_F(ActivationTasksDoNotBlockReadyToDrawTest, 1684 TEST_F(ActivationTasksDoNotBlockReadyToDrawTest,
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
1892 } 1892 }
1893 1893
1894 // Ensures that the tile manager does not attempt to reuse tiles when partial 1894 // Ensures that the tile manager does not attempt to reuse tiles when partial
1895 // raster is disabled. 1895 // raster is disabled.
1896 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) { 1896 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) {
1897 RunPartialRasterCheck(TakeHostImpl(), false /* partial_raster_enabled */); 1897 RunPartialRasterCheck(TakeHostImpl(), false /* partial_raster_enabled */);
1898 } 1898 }
1899 1899
1900 } // namespace 1900 } // namespace
1901 } // namespace cc 1901 } // namespace cc
OLDNEW
« no previous file with comments | « cc/tiles/tile_manager_perftest.cc ('k') | cc/trees/channel_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698