Index: gpu/ipc/service/gpu_channel.h |
diff --git a/content/common/gpu/gpu_channel.h b/gpu/ipc/service/gpu_channel.h |
similarity index 86% |
rename from content/common/gpu/gpu_channel.h |
rename to gpu/ipc/service/gpu_channel.h |
index 0cf25125dd27c0056f5efafdee0de54e76645932..8090b40b8a6fd98c1779132bc818285cd7363e8b 100644 |
--- a/content/common/gpu/gpu_channel.h |
+++ b/gpu/ipc/service/gpu_channel.h |
@@ -2,8 +2,8 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef CONTENT_COMMON_GPU_GPU_CHANNEL_H_ |
-#define CONTENT_COMMON_GPU_GPU_CHANNEL_H_ |
+#ifndef GPU_IPC_SERVICE_GPU_CHANNEL_H_ |
+#define GPU_IPC_SERVICE_GPU_CHANNEL_H_ |
#include <stddef.h> |
#include <stdint.h> |
@@ -20,11 +20,11 @@ |
#include "base/threading/thread_checker.h" |
#include "base/trace_event/memory_dump_provider.h" |
#include "build/build_config.h" |
-#include "content/common/content_export.h" |
-#include "content/common/gpu/gpu_command_buffer_stub.h" |
-#include "content/common/gpu/gpu_memory_manager.h" |
#include "gpu/command_buffer/service/valuebuffer_manager.h" |
+#include "gpu/gpu_export.h" |
#include "gpu/ipc/common/gpu_stream_constants.h" |
+#include "gpu/ipc/service/gpu_command_buffer_stub.h" |
+#include "gpu/ipc/service/gpu_memory_manager.h" |
#include "ipc/ipc_sync_channel.h" |
#include "ipc/message_router.h" |
#include "ui/gfx/geometry/size.h" |
@@ -38,42 +38,41 @@ namespace base { |
class WaitableEvent; |
} |
+namespace IPC { |
+class MessageFilter; |
+} |
+ |
namespace gpu { |
+ |
class PreemptionFlag; |
class SyncPointOrderData; |
class SyncPointManager; |
union ValueState; |
class ValueStateMap; |
-namespace gles2 { |
-class SubscriptionRefSet; |
-} |
-} |
- |
-namespace IPC { |
-class MessageFilter; |
-} |
- |
-namespace content { |
class GpuChannelManager; |
class GpuChannelMessageFilter; |
class GpuChannelMessageQueue; |
class GpuWatchdog; |
+namespace gles2 { |
+class SubscriptionRefSet; |
+} |
+ |
// Encapsulates an IPC channel between the GPU process and one renderer |
// process. On the renderer side there's a corresponding GpuChannelHost. |
-class CONTENT_EXPORT GpuChannel |
+class GPU_EXPORT GpuChannel |
: public IPC::Listener, |
public IPC::Sender, |
- public gpu::gles2::SubscriptionRefSet::Observer { |
+ public gles2::SubscriptionRefSet::Observer { |
public: |
// Takes ownership of the renderer process handle. |
GpuChannel(GpuChannelManager* gpu_channel_manager, |
- gpu::SyncPointManager* sync_point_manager, |
+ SyncPointManager* sync_point_manager, |
GpuWatchdog* watchdog, |
gfx::GLShareGroup* share_group, |
- gpu::gles2::MailboxManager* mailbox_manager, |
- gpu::PreemptionFlag* preempting_flag, |
- gpu::PreemptionFlag* preempted_flag, |
+ gles2::MailboxManager* mailbox_manager, |
+ PreemptionFlag* preempting_flag, |
+ PreemptionFlag* preempted_flag, |
base::SingleThreadTaskRunner* task_runner, |
base::SingleThreadTaskRunner* io_task_runner, |
int32_t client_id, |
@@ -148,12 +147,12 @@ class CONTENT_EXPORT GpuChannel |
uint32_t internalformat); |
void HandleUpdateValueState(unsigned int target, |
- const gpu::ValueState& state); |
+ const ValueState& state); |
GpuChannelMessageFilter* filter() const { return filter_.get(); } |
// Visible for testing. |
- const gpu::ValueStateMap* pending_valuebuffer_state() const { |
+ const ValueStateMap* pending_valuebuffer_state() const { |
return pending_valuebuffer_state_.get(); |
} |
@@ -164,7 +163,7 @@ class CONTENT_EXPORT GpuChannel |
uint32_t GetUnprocessedOrderNum() const; |
// Returns the shared sync point global order data for the stream. |
- scoped_refptr<gpu::SyncPointOrderData> GetSyncPointOrderData( |
+ scoped_refptr<SyncPointOrderData> GetSyncPointOrderData( |
int32_t stream_id); |
void PostHandleOutOfOrderMessage(const IPC::Message& message); |
@@ -198,7 +197,7 @@ class CONTENT_EXPORT GpuChannel |
scoped_refptr<GpuChannelMessageQueue> CreateStream( |
int32_t stream_id, |
- gpu::GpuStreamPriority stream_priority); |
+ GpuStreamPriority stream_priority); |
scoped_refptr<GpuChannelMessageQueue> LookupStream(int32_t stream_id); |
@@ -209,7 +208,7 @@ class CONTENT_EXPORT GpuChannel |
void RemoveRouteFromStream(int32_t route_id); |
// Message handlers for control messages. |
- void OnCreateCommandBuffer(gpu::SurfaceHandle surface_handle, |
+ void OnCreateCommandBuffer(SurfaceHandle surface_handle, |
const gfx::Size& size, |
const GPUCreateCommandBufferConfig& init_params, |
int32_t route_id, |
@@ -225,7 +224,7 @@ class CONTENT_EXPORT GpuChannel |
// Sync point manager. Outlives the channel and is guaranteed to outlive the |
// message loop. |
- gpu::SyncPointManager* const sync_point_manager_; |
+ SyncPointManager* const sync_point_manager_; |
scoped_ptr<IPC::SyncChannel> channel_; |
@@ -239,11 +238,11 @@ class CONTENT_EXPORT GpuChannel |
// Whether the processing of IPCs on this channel is stalled and we should |
// preempt other GpuChannels. |
- scoped_refptr<gpu::PreemptionFlag> preempting_flag_; |
+ scoped_refptr<PreemptionFlag> preempting_flag_; |
// If non-NULL, all stubs on this channel should stop processing GL |
// commands (via their CommandExecutor) when preempted_flag_->IsSet() |
- scoped_refptr<gpu::PreemptionFlag> preempted_flag_; |
+ scoped_refptr<PreemptionFlag> preempted_flag_; |
// The id of the client who is on the other side of the channel. |
const int32_t client_id_; |
@@ -259,13 +258,13 @@ class CONTENT_EXPORT GpuChannel |
// process use. |
scoped_refptr<gfx::GLShareGroup> share_group_; |
- scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; |
+ scoped_refptr<gles2::MailboxManager> mailbox_manager_; |
- scoped_refptr<gpu::gles2::SubscriptionRefSet> subscription_ref_set_; |
+ scoped_refptr<gles2::SubscriptionRefSet> subscription_ref_set_; |
- scoped_refptr<gpu::ValueStateMap> pending_valuebuffer_state_; |
+ scoped_refptr<ValueStateMap> pending_valuebuffer_state_; |
- gpu::gles2::DisallowedFeatures disallowed_features_; |
+ gles2::DisallowedFeatures disallowed_features_; |
GpuWatchdog* const watchdog_; |
// Map of stream id to appropriate message queue. |
@@ -302,7 +301,7 @@ class CONTENT_EXPORT GpuChannel |
// posting a task to insert the GpuCommandBufferMsg_RetireSyncPoint message |
// into the channel's queue. |
// - it generates mailbox names for clients of the GPU process on the IO thread. |
-class GpuChannelMessageFilter : public IPC::MessageFilter { |
+class GPU_EXPORT GpuChannelMessageFilter : public IPC::MessageFilter { |
public: |
GpuChannelMessageFilter(); |
@@ -361,18 +360,18 @@ class GpuChannelMessageQueue |
public: |
static scoped_refptr<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); |
void Disable(); |
void DisableIO(); |
int32_t stream_id() const { return stream_id_; } |
- gpu::GpuStreamPriority stream_priority() const { return stream_priority_; } |
+ GpuStreamPriority stream_priority() const { return stream_priority_; } |
bool IsScheduled() const; |
void OnRescheduled(bool scheduled); |
@@ -381,7 +380,7 @@ class GpuChannelMessageQueue |
base::TimeTicks GetNextMessageTimeTick() const; |
- scoped_refptr<gpu::SyncPointOrderData> GetSyncPointOrderData(); |
+ scoped_refptr<SyncPointOrderData> GetSyncPointOrderData(); |
// Returns the global order number for the last unprocessed IPC message. |
uint32_t GetUnprocessedOrderNum() const; |
@@ -421,12 +420,12 @@ class 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); |
~GpuChannelMessageQueue(); |
void UpdatePreemptionState(); |
@@ -447,7 +446,7 @@ class GpuChannelMessageQueue |
bool ShouldTransitionToIdle() const; |
const int32_t stream_id_; |
- const gpu::GpuStreamPriority stream_priority_; |
+ const GpuStreamPriority stream_priority_; |
// These can be accessed from both IO and main threads and are protected by |
// |channel_lock_|. |
@@ -469,16 +468,16 @@ class GpuChannelMessageQueue |
base::ThreadChecker io_thread_checker_; |
// Keeps track of sync point related state such as message order numbers. |
- scoped_refptr<gpu::SyncPointOrderData> sync_point_order_data_; |
+ scoped_refptr<SyncPointOrderData> sync_point_order_data_; |
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
- scoped_refptr<gpu::PreemptionFlag> preempting_flag_; |
- scoped_refptr<gpu::PreemptionFlag> preempted_flag_; |
- gpu::SyncPointManager* const sync_point_manager_; |
+ scoped_refptr<PreemptionFlag> preempting_flag_; |
+ scoped_refptr<PreemptionFlag> preempted_flag_; |
+ SyncPointManager* const sync_point_manager_; |
DISALLOW_COPY_AND_ASSIGN(GpuChannelMessageQueue); |
}; |
-} // namespace content |
+} // namespace gpu |
-#endif // CONTENT_COMMON_GPU_GPU_CHANNEL_H_ |
+#endif // GPU_IPC_SERVICE_GPU_CHANNEL_H_ |