OLD | NEW |
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" |
(...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1491 MOCK_METHOD0(NotifyAllTileTasksCompleted, void()); | 1491 MOCK_METHOD0(NotifyAllTileTasksCompleted, void()); |
1492 MOCK_METHOD0(NotifyReadyToDraw, void()); | 1492 MOCK_METHOD0(NotifyReadyToDraw, void()); |
1493 }; | 1493 }; |
1494 | 1494 |
1495 std::unique_ptr<FakeLayerTreeHostImpl> CreateHostImpl( | 1495 std::unique_ptr<FakeLayerTreeHostImpl> CreateHostImpl( |
1496 const LayerTreeSettings& settings, | 1496 const LayerTreeSettings& settings, |
1497 TaskRunnerProvider* task_runner_provider, | 1497 TaskRunnerProvider* task_runner_provider, |
1498 SharedBitmapManager* shared_bitmap_manager, | 1498 SharedBitmapManager* shared_bitmap_manager, |
1499 TaskGraphRunner* task_graph_runner, | 1499 TaskGraphRunner* task_graph_runner, |
1500 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) override { | 1500 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) override { |
1501 return base::WrapUnique(new MockLayerTreeHostImpl( | 1501 return base::MakeUnique<MockLayerTreeHostImpl>( |
1502 settings, task_runner_provider, shared_bitmap_manager, | 1502 settings, task_runner_provider, shared_bitmap_manager, |
1503 task_graph_runner, gpu_memory_buffer_manager)); | 1503 task_graph_runner, gpu_memory_buffer_manager); |
1504 } | 1504 } |
1505 | 1505 |
1506 // By default use software compositing (no context provider). | 1506 // By default use software compositing (no context provider). |
1507 std::unique_ptr<OutputSurface> CreateOutputSurface() override { | 1507 std::unique_ptr<OutputSurface> CreateOutputSurface() override { |
1508 return FakeOutputSurface::CreateDelegatingSoftware(); | 1508 return FakeOutputSurface::CreateDelegatingSoftware(); |
1509 } | 1509 } |
1510 | 1510 |
1511 MockLayerTreeHostImpl& MockHostImpl() { | 1511 MockLayerTreeHostImpl& MockHostImpl() { |
1512 return *static_cast<MockLayerTreeHostImpl*>(host_impl()); | 1512 return *static_cast<MockLayerTreeHostImpl*>(host_impl()); |
1513 } | 1513 } |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1658 ASSERT_EQ(SK_ColorBLUE, bitmap->getColor(x, y)); | 1658 ASSERT_EQ(SK_ColorBLUE, bitmap->getColor(x, y)); |
1659 } | 1659 } |
1660 } | 1660 } |
1661 } | 1661 } |
1662 } | 1662 } |
1663 } | 1663 } |
1664 | 1664 |
1665 class ActivationTasksDoNotBlockReadyToDrawTest : public TileManagerTest { | 1665 class ActivationTasksDoNotBlockReadyToDrawTest : public TileManagerTest { |
1666 protected: | 1666 protected: |
1667 std::unique_ptr<TaskGraphRunner> CreateTaskGraphRunner() override { | 1667 std::unique_ptr<TaskGraphRunner> CreateTaskGraphRunner() override { |
1668 return base::WrapUnique(new SynchronousTaskGraphRunner()); | 1668 return base::MakeUnique<SynchronousTaskGraphRunner>(); |
1669 } | 1669 } |
1670 | 1670 |
1671 std::unique_ptr<OutputSurface> CreateOutputSurface() override { | 1671 std::unique_ptr<OutputSurface> CreateOutputSurface() override { |
1672 return FakeOutputSurface::CreateDelegating3d(); | 1672 return FakeOutputSurface::CreateDelegating3d(); |
1673 } | 1673 } |
1674 | 1674 |
1675 LayerTreeSettings CreateSettings() override { | 1675 LayerTreeSettings CreateSettings() override { |
1676 LayerTreeSettings settings = TileManagerTest::CreateSettings(); | 1676 LayerTreeSettings settings = TileManagerTest::CreateSettings(); |
1677 settings.gpu_rasterization_forced = true; | 1677 settings.gpu_rasterization_forced = true; |
1678 return settings; | 1678 return settings; |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1890 } | 1890 } |
1891 | 1891 |
1892 // Ensures that the tile manager does not attempt to reuse tiles when partial | 1892 // Ensures that the tile manager does not attempt to reuse tiles when partial |
1893 // raster is disabled. | 1893 // raster is disabled. |
1894 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) { | 1894 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) { |
1895 RunPartialRasterCheck(TakeHostImpl(), false /* partial_raster_enabled */); | 1895 RunPartialRasterCheck(TakeHostImpl(), false /* partial_raster_enabled */); |
1896 } | 1896 } |
1897 | 1897 |
1898 } // namespace | 1898 } // namespace |
1899 } // namespace cc | 1899 } // namespace cc |
OLD | NEW |