| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 "gpu/ipc/service/gpu_channel_test_common.h" | 5 #include "gpu/ipc/service/gpu_channel_test_common.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/test/test_simple_task_runner.h" | 8 #include "base/test/test_simple_task_runner.h" |
| 9 #include "base/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
| 10 #include "gpu/command_buffer/service/sync_point_manager.h" | 10 #include "gpu/command_buffer/service/sync_point_manager.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 } | 67 } |
| 68 | 68 |
| 69 std::unique_ptr<GpuChannel> TestGpuChannelManager::CreateGpuChannel( | 69 std::unique_ptr<GpuChannel> TestGpuChannelManager::CreateGpuChannel( |
| 70 int client_id, | 70 int client_id, |
| 71 uint64_t client_tracing_id, | 71 uint64_t client_tracing_id, |
| 72 bool preempts, | 72 bool preempts, |
| 73 bool allow_view_command_buffers, | 73 bool allow_view_command_buffers, |
| 74 bool allow_real_time_streams) { | 74 bool allow_real_time_streams) { |
| 75 return base::MakeUnique<TestGpuChannel>( | 75 return base::MakeUnique<TestGpuChannel>( |
| 76 this, sync_point_manager(), share_group(), mailbox_manager(), | 76 this, sync_point_manager(), share_group(), mailbox_manager(), |
| 77 preempts ? preemption_flag() : nullptr, | 77 nullptr, preempts ? preemption_flag() : nullptr, |
| 78 preempts ? nullptr : preemption_flag(), task_runner_.get(), | 78 preempts ? nullptr : preemption_flag(), task_runner_.get(), |
| 79 io_task_runner_.get(), client_id, client_tracing_id, | 79 io_task_runner_.get(), client_id, client_tracing_id, |
| 80 allow_view_command_buffers, allow_real_time_streams); | 80 allow_view_command_buffers, allow_real_time_streams); |
| 81 } | 81 } |
| 82 | 82 |
| 83 TestGpuChannel::TestGpuChannel(GpuChannelManager* gpu_channel_manager, | 83 TestGpuChannel::TestGpuChannel(GpuChannelManager* gpu_channel_manager, |
| 84 SyncPointManager* sync_point_manager, | 84 SyncPointManager* sync_point_manager, |
| 85 gl::GLShareGroup* share_group, | 85 gl::GLShareGroup* share_group, |
| 86 gles2::MailboxManager* mailbox_manager, | 86 gles2::MailboxManager* mailbox_manager, |
| 87 GpuScheduler* scheduler, |
| 87 PreemptionFlag* preempting_flag, | 88 PreemptionFlag* preempting_flag, |
| 88 PreemptionFlag* preempted_flag, | 89 PreemptionFlag* preempted_flag, |
| 89 base::SingleThreadTaskRunner* task_runner, | 90 base::SingleThreadTaskRunner* task_runner, |
| 90 base::SingleThreadTaskRunner* io_task_runner, | 91 base::SingleThreadTaskRunner* io_task_runner, |
| 91 int client_id, | 92 int client_id, |
| 92 uint64_t client_tracing_id, | 93 uint64_t client_tracing_id, |
| 93 bool allow_view_command_buffers, | 94 bool allow_view_command_buffers, |
| 94 bool allow_real_time_streams) | 95 bool allow_real_time_streams) |
| 95 : GpuChannel(gpu_channel_manager, | 96 : GpuChannel(gpu_channel_manager, |
| 96 sync_point_manager, | 97 sync_point_manager, |
| 97 nullptr, | 98 nullptr, |
| 98 share_group, | 99 share_group, |
| 99 mailbox_manager, | 100 mailbox_manager, |
| 101 scheduler, |
| 100 preempting_flag, | 102 preempting_flag, |
| 101 preempted_flag, | 103 preempted_flag, |
| 102 task_runner, | 104 task_runner, |
| 103 io_task_runner, | 105 io_task_runner, |
| 104 client_id, | 106 client_id, |
| 105 client_tracing_id, | 107 client_tracing_id, |
| 106 allow_view_command_buffers, | 108 allow_view_command_buffers, |
| 107 allow_real_time_streams) {} | 109 allow_real_time_streams) {} |
| 108 | 110 |
| 109 TestGpuChannel::~TestGpuChannel() { | 111 TestGpuChannel::~TestGpuChannel() { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 io_task_runner_.get(), sync_point_manager_.get(), nullptr)); | 148 io_task_runner_.get(), sync_point_manager_.get(), nullptr)); |
| 147 } | 149 } |
| 148 | 150 |
| 149 void GpuChannelTestCommon::TearDown() { | 151 void GpuChannelTestCommon::TearDown() { |
| 150 // Destroying channels causes tasks to run on the IO task runner. | 152 // Destroying channels causes tasks to run on the IO task runner. |
| 151 channel_manager_ = nullptr; | 153 channel_manager_ = nullptr; |
| 152 } | 154 } |
| 153 | 155 |
| 154 | 156 |
| 155 } // namespace gpu | 157 } // namespace gpu |
| OLD | NEW |