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

Side by Side Diff: content/common/gpu/gpu_channel_test_common.cc

Issue 1365563002: Make channel preemption not require view contexts for hookup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wakeup_gpu
Patch Set: rebase 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 (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 "content/common/gpu/gpu_channel_test_common.h" 5 #include "content/common/gpu/gpu_channel_test_common.h"
6 6
7 #include "base/test/test_simple_task_runner.h" 7 #include "base/test/test_simple_task_runner.h"
8 #include "base/thread_task_runner_handle.h" 8 #include "base/thread_task_runner_handle.h"
9 #include "gpu/command_buffer/service/sync_point_manager.h" 9 #include "gpu/command_buffer/service/sync_point_manager.h"
10 #include "ipc/ipc_test_sink.h" 10 #include "ipc/ipc_test_sink.h"
(...skipping 19 matching lines...) Expand all
30 // Clear gpu channels here so that any IPC messages sent are handled using the 30 // Clear gpu channels here so that any IPC messages sent are handled using the
31 // overridden Send method. 31 // overridden Send method.
32 gpu_channels_.clear(); 32 gpu_channels_.clear();
33 } 33 }
34 34
35 bool TestGpuChannelManager::Send(IPC::Message* msg) { 35 bool TestGpuChannelManager::Send(IPC::Message* msg) {
36 return sink_->Send(msg); 36 return sink_->Send(msg);
37 } 37 }
38 38
39 scoped_ptr<GpuChannel> TestGpuChannelManager::CreateGpuChannel( 39 scoped_ptr<GpuChannel> TestGpuChannelManager::CreateGpuChannel(
40 gfx::GLShareGroup* share_group,
41 gpu::gles2::MailboxManager* mailbox_manager,
42 int client_id, 40 int client_id,
43 uint64_t client_tracing_id, 41 uint64_t client_tracing_id,
42 bool preempts,
44 bool allow_future_sync_points, 43 bool allow_future_sync_points,
45 bool allow_real_time_streams) { 44 bool allow_real_time_streams) {
46 return make_scoped_ptr(new TestGpuChannel( 45 return make_scoped_ptr(new TestGpuChannel(
47 sink_, this, share_group, mailbox_manager, task_runner_.get(), 46 sink_, this, share_group(), mailbox_manager(),
47 preempts ? preemption_flag() : nullptr, task_runner_.get(),
48 io_task_runner_.get(), client_id, client_tracing_id, 48 io_task_runner_.get(), client_id, client_tracing_id,
49 allow_future_sync_points, allow_real_time_streams)); 49 allow_future_sync_points, allow_real_time_streams));
50 } 50 }
51 51
52 TestGpuChannel::TestGpuChannel(IPC::TestSink* sink, 52 TestGpuChannel::TestGpuChannel(IPC::TestSink* sink,
53 GpuChannelManager* gpu_channel_manager, 53 GpuChannelManager* gpu_channel_manager,
54 gfx::GLShareGroup* share_group, 54 gfx::GLShareGroup* share_group,
55 gpu::gles2::MailboxManager* mailbox_manager, 55 gpu::gles2::MailboxManager* mailbox_manager,
56 gpu::PreemptionFlag* preempting_flag,
56 base::SingleThreadTaskRunner* task_runner, 57 base::SingleThreadTaskRunner* task_runner,
57 base::SingleThreadTaskRunner* io_task_runner, 58 base::SingleThreadTaskRunner* io_task_runner,
58 int client_id, 59 int client_id,
59 uint64_t client_tracing_id, 60 uint64_t client_tracing_id,
60 bool allow_future_sync_points, 61 bool allow_future_sync_points,
61 bool allow_real_time_streams) 62 bool allow_real_time_streams)
62 : GpuChannel(gpu_channel_manager, 63 : GpuChannel(gpu_channel_manager,
63 nullptr, 64 nullptr,
64 share_group, 65 share_group,
65 mailbox_manager, 66 mailbox_manager,
67 preempting_flag,
66 task_runner, 68 task_runner,
67 io_task_runner, 69 io_task_runner,
68 client_id, 70 client_id,
69 client_tracing_id, 71 client_tracing_id,
70 false,
71 allow_future_sync_points, 72 allow_future_sync_points,
72 allow_real_time_streams), 73 allow_real_time_streams),
73 sink_(sink) {} 74 sink_(sink) {}
74 75
75 TestGpuChannel::~TestGpuChannel() { 76 TestGpuChannel::~TestGpuChannel() {
76 // Call stubs here so that any IPC messages sent are handled using the 77 // Call stubs here so that any IPC messages sent are handled using the
77 // overridden Send method. 78 // overridden Send method.
78 stubs_.clear(); 79 stubs_.clear();
79 } 80 }
80 81
(...skipping 19 matching lines...) Expand all
100 sync_point_manager_(new gpu::SyncPointManager(false)), 101 sync_point_manager_(new gpu::SyncPointManager(false)),
101 channel_manager_(new TestGpuChannelManager(sink_.get(), 102 channel_manager_(new TestGpuChannelManager(sink_.get(),
102 task_runner_.get(), 103 task_runner_.get(),
103 io_task_runner_.get(), 104 io_task_runner_.get(),
104 sync_point_manager_.get(), 105 sync_point_manager_.get(),
105 nullptr)) {} 106 nullptr)) {}
106 107
107 GpuChannelTestCommon::~GpuChannelTestCommon() {} 108 GpuChannelTestCommon::~GpuChannelTestCommon() {}
108 109
109 } // namespace content 110 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_channel_test_common.h ('k') | content/common/gpu/gpu_channel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698