| Index: gpu/ipc/service/gpu_channel.cc
|
| diff --git a/content/common/gpu/gpu_channel.cc b/gpu/ipc/service/gpu_channel.cc
|
| similarity index 94%
|
| rename from content/common/gpu/gpu_channel.cc
|
| rename to gpu/ipc/service/gpu_channel.cc
|
| index 20edeafa8467e1ad4f42da2350c052003e8be2a6..7661318de18f0a31e4997dd5267986cf54d0579a 100644
|
| --- a/content/common/gpu/gpu_channel.cc
|
| +++ b/gpu/ipc/service/gpu_channel.cc
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "content/common/gpu/gpu_channel.h"
|
| +#include "gpu/ipc/service/gpu_channel.h"
|
|
|
| #include <utility>
|
|
|
| @@ -30,9 +30,6 @@
|
| #include "base/trace_event/process_memory_dump.h"
|
| #include "base/trace_event/trace_event.h"
|
| #include "build/build_config.h"
|
| -#include "content/common/gpu/gpu_channel_manager.h"
|
| -#include "content/common/gpu/gpu_channel_manager_delegate.h"
|
| -#include "content/common/gpu/gpu_memory_buffer_factory.h"
|
| #include "gpu/command_buffer/common/mailbox.h"
|
| #include "gpu/command_buffer/common/value_state.h"
|
| #include "gpu/command_buffer/service/command_executor.h"
|
| @@ -41,6 +38,9 @@
|
| #include "gpu/command_buffer/service/sync_point_manager.h"
|
| #include "gpu/command_buffer/service/valuebuffer_manager.h"
|
| #include "gpu/ipc/common/gpu_messages.h"
|
| +#include "gpu/ipc/service/gpu_channel_manager.h"
|
| +#include "gpu/ipc/service/gpu_channel_manager_delegate.h"
|
| +#include "gpu/ipc/service/gpu_memory_buffer_factory.h"
|
| #include "ipc/ipc_channel.h"
|
| #include "ipc/message_filter.h"
|
| #include "ui/gl/gl_context.h"
|
| @@ -51,7 +51,7 @@
|
| #include "ipc/ipc_channel_posix.h"
|
| #endif
|
|
|
| -namespace content {
|
| +namespace gpu {
|
| namespace {
|
|
|
| // Number of milliseconds between successive vsync. Many GL commands block
|
| @@ -75,30 +75,30 @@ const int64_t kStopPreemptThresholdMs = kVsyncIntervalMs;
|
|
|
| scoped_refptr<GpuChannelMessageQueue> GpuChannelMessageQueue::Create(
|
| int32_t stream_id,
|
| - gpu::GpuStreamPriority stream_priority,
|
| + GpuStreamPriority stream_priority,
|
| GpuChannel* channel,
|
| const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner,
|
| - const scoped_refptr<gpu::PreemptionFlag>& preempting_flag,
|
| - const scoped_refptr<gpu::PreemptionFlag>& preempted_flag,
|
| - gpu::SyncPointManager* sync_point_manager) {
|
| + const scoped_refptr<PreemptionFlag>& preempting_flag,
|
| + const scoped_refptr<PreemptionFlag>& preempted_flag,
|
| + SyncPointManager* sync_point_manager) {
|
| return new GpuChannelMessageQueue(stream_id, stream_priority, channel,
|
| io_task_runner, preempting_flag,
|
| preempted_flag, sync_point_manager);
|
| }
|
|
|
| -scoped_refptr<gpu::SyncPointOrderData>
|
| +scoped_refptr<SyncPointOrderData>
|
| GpuChannelMessageQueue::GetSyncPointOrderData() {
|
| return sync_point_order_data_;
|
| }
|
|
|
| GpuChannelMessageQueue::GpuChannelMessageQueue(
|
| int32_t stream_id,
|
| - gpu::GpuStreamPriority stream_priority,
|
| + GpuStreamPriority stream_priority,
|
| GpuChannel* channel,
|
| const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner,
|
| - const scoped_refptr<gpu::PreemptionFlag>& preempting_flag,
|
| - const scoped_refptr<gpu::PreemptionFlag>& preempted_flag,
|
| - gpu::SyncPointManager* sync_point_manager)
|
| + const scoped_refptr<PreemptionFlag>& preempting_flag,
|
| + const scoped_refptr<PreemptionFlag>& preempted_flag,
|
| + SyncPointManager* sync_point_manager)
|
| : stream_id_(stream_id),
|
| stream_priority_(stream_priority),
|
| enabled_(true),
|
| @@ -108,7 +108,7 @@ GpuChannelMessageQueue::GpuChannelMessageQueue(
|
| max_preemption_time_(
|
| base::TimeDelta::FromMilliseconds(kMaxPreemptTimeMs)),
|
| timer_(new base::OneShotTimer),
|
| - sync_point_order_data_(gpu::SyncPointOrderData::Create()),
|
| + sync_point_order_data_(SyncPointOrderData::Create()),
|
| io_task_runner_(io_task_runner),
|
| preempting_flag_(preempting_flag),
|
| preempted_flag_(preempted_flag),
|
| @@ -578,12 +578,12 @@ bool GpuChannelMessageFilter::MessageErrorHandler(const IPC::Message& message,
|
| }
|
|
|
| GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager,
|
| - gpu::SyncPointManager* sync_point_manager,
|
| + SyncPointManager* sync_point_manager,
|
| GpuWatchdog* watchdog,
|
| gfx::GLShareGroup* share_group,
|
| - gpu::gles2::MailboxManager* mailbox,
|
| - gpu::PreemptionFlag* preempting_flag,
|
| - gpu::PreemptionFlag* preempted_flag,
|
| + gles2::MailboxManager* mailbox,
|
| + PreemptionFlag* preempting_flag,
|
| + PreemptionFlag* preempted_flag,
|
| base::SingleThreadTaskRunner* task_runner,
|
| base::SingleThreadTaskRunner* io_task_runner,
|
| int32_t client_id,
|
| @@ -602,8 +602,8 @@ GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager,
|
| io_task_runner_(io_task_runner),
|
| share_group_(share_group),
|
| mailbox_manager_(mailbox),
|
| - subscription_ref_set_(new gpu::gles2::SubscriptionRefSet),
|
| - pending_valuebuffer_state_(new gpu::ValueStateMap),
|
| + subscription_ref_set_(new gles2::SubscriptionRefSet),
|
| + pending_valuebuffer_state_(new ValueStateMap),
|
| watchdog_(watchdog),
|
| allow_view_command_buffers_(allow_view_command_buffers),
|
| allow_real_time_streams_(allow_real_time_streams),
|
| @@ -614,8 +614,8 @@ GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager,
|
| filter_ = new GpuChannelMessageFilter();
|
|
|
| scoped_refptr<GpuChannelMessageQueue> control_queue =
|
| - CreateStream(gpu::GPU_STREAM_DEFAULT, gpu::GpuStreamPriority::HIGH);
|
| - AddRouteToStream(MSG_ROUTING_CONTROL, gpu::GPU_STREAM_DEFAULT);
|
| + CreateStream(GPU_STREAM_DEFAULT, GpuStreamPriority::HIGH);
|
| + AddRouteToStream(MSG_ROUTING_CONTROL, GPU_STREAM_DEFAULT);
|
|
|
| subscription_ref_set_->AddObserver(this);
|
| }
|
| @@ -767,7 +767,7 @@ bool GpuChannel::OnControlMessageReceived(const IPC::Message& msg) {
|
| return handled;
|
| }
|
|
|
| -scoped_refptr<gpu::SyncPointOrderData> GpuChannel::GetSyncPointOrderData(
|
| +scoped_refptr<SyncPointOrderData> GpuChannel::GetSyncPointOrderData(
|
| int32_t stream_id) {
|
| auto it = streams_.find(stream_id);
|
| DCHECK(it != streams_.end());
|
| @@ -846,11 +846,11 @@ void GpuChannel::HandleMessageForTesting(const IPC::Message& msg) {
|
|
|
| scoped_refptr<GpuChannelMessageQueue> GpuChannel::CreateStream(
|
| int32_t stream_id,
|
| - gpu::GpuStreamPriority stream_priority) {
|
| + GpuStreamPriority stream_priority) {
|
| DCHECK(streams_.find(stream_id) == streams_.end());
|
| scoped_refptr<GpuChannelMessageQueue> queue = GpuChannelMessageQueue::Create(
|
| stream_id, stream_priority, this, io_task_runner_,
|
| - (stream_id == gpu::GPU_STREAM_DEFAULT) ? preempting_flag_ : nullptr,
|
| + (stream_id == GPU_STREAM_DEFAULT) ? preempting_flag_ : nullptr,
|
| preempted_flag_, sync_point_manager_);
|
| streams_.insert(std::make_pair(stream_id, queue));
|
| streams_to_num_routes_.insert(std::make_pair(stream_id, 0));
|
| @@ -905,15 +905,15 @@ const GpuCommandBufferStub* GpuChannel::GetOneStub() const {
|
| #endif
|
|
|
| void GpuChannel::OnCreateCommandBuffer(
|
| - gpu::SurfaceHandle surface_handle,
|
| + SurfaceHandle surface_handle,
|
| const gfx::Size& size,
|
| const GPUCreateCommandBufferConfig& init_params,
|
| int32_t route_id,
|
| bool* succeeded) {
|
| TRACE_EVENT2("gpu", "GpuChannel::OnCreateCommandBuffer", "route_id", route_id,
|
| - "offscreen", (surface_handle == gpu::kNullSurfaceHandle));
|
| + "offscreen", (surface_handle == kNullSurfaceHandle));
|
| *succeeded = false;
|
| - if (surface_handle != gpu::kNullSurfaceHandle &&
|
| + if (surface_handle != kNullSurfaceHandle &&
|
| !allow_view_command_buffers_) {
|
| DLOG(ERROR) << "GpuChannel::CreateCommandBuffer(): attempt to create a "
|
| "view context on a non-priviledged channel";
|
| @@ -936,9 +936,9 @@ void GpuChannel::OnCreateCommandBuffer(
|
| return;
|
| }
|
|
|
| - gpu::GpuStreamPriority stream_priority = init_params.stream_priority;
|
| + GpuStreamPriority stream_priority = init_params.stream_priority;
|
| if (!allow_real_time_streams_ &&
|
| - stream_priority == gpu::GpuStreamPriority::REAL_TIME) {
|
| + stream_priority == GpuStreamPriority::REAL_TIME) {
|
| DLOG(ERROR) << "GpuChannel::OnCreateCommandBuffer(): real time stream "
|
| "priority not allowed";
|
| return;
|
| @@ -1016,7 +1016,7 @@ void GpuChannel::RemoveFilter(IPC::MessageFilter* filter) {
|
|
|
| uint64_t GpuChannel::GetMemoryUsage() {
|
| // Collect the unique memory trackers in use by the |stubs_|.
|
| - std::set<gpu::gles2::MemoryTracker*> unique_memory_trackers;
|
| + std::set<gles2::MemoryTracker*> unique_memory_trackers;
|
| for (auto& kv : stubs_)
|
| unique_memory_trackers.insert(kv.second->GetMemoryTracker());
|
|
|
| @@ -1065,8 +1065,8 @@ scoped_refptr<gl::GLImage> GpuChannel::CreateImageForGpuMemoryBuffer(
|
| }
|
|
|
| void GpuChannel::HandleUpdateValueState(
|
| - unsigned int target, const gpu::ValueState& state) {
|
| + unsigned int target, const ValueState& state) {
|
| pending_valuebuffer_state_->UpdateState(target, state);
|
| }
|
|
|
| -} // namespace content
|
| +} // namespace gpu
|
|
|