| OLD | NEW | 
|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_COMMON_GPU_GPU_CHANNEL_H_ | 5 #ifndef CONTENT_COMMON_GPU_GPU_CHANNEL_H_ | 
| 6 #define CONTENT_COMMON_GPU_GPU_CHANNEL_H_ | 6 #define CONTENT_COMMON_GPU_GPU_CHANNEL_H_ | 
| 7 #pragma once | 7 #pragma once | 
| 8 | 8 | 
| 9 #include <deque> | 9 #include <deque> | 
| 10 #include <string> | 10 #include <string> | 
| 11 | 11 | 
| 12 #include "base/id_map.h" | 12 #include "base/id_map.h" | 
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" | 
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" | 
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" | 
| 16 #include "base/process.h" | 16 #include "base/process.h" | 
| 17 #include "build/build_config.h" | 17 #include "build/build_config.h" | 
| 18 #include "content/common/gpu/gpu_command_buffer_stub.h" | 18 #include "content/common/gpu/gpu_command_buffer_stub.h" | 
|  | 19 #include "content/common/gpu/gpu_memory_manager.h" | 
| 19 #include "content/common/message_router.h" | 20 #include "content/common/message_router.h" | 
| 20 #include "ipc/ipc_sync_channel.h" | 21 #include "ipc/ipc_sync_channel.h" | 
| 21 #include "ui/gfx/gl/gl_share_group.h" | 22 #include "ui/gfx/gl/gl_share_group.h" | 
| 22 #include "ui/gfx/gl/gpu_preference.h" | 23 #include "ui/gfx/gl/gpu_preference.h" | 
| 23 #include "ui/gfx/native_widget_types.h" | 24 #include "ui/gfx/native_widget_types.h" | 
| 24 #include "ui/gfx/size.h" | 25 #include "ui/gfx/size.h" | 
| 25 | 26 | 
| 26 class GpuChannelManager; | 27 class GpuChannelManager; | 
| 27 struct GPUCreateCommandBufferConfig; | 28 struct GPUCreateCommandBufferConfig; | 
| 28 class GpuWatchdog; | 29 class GpuWatchdog; | 
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 66   } | 67   } | 
| 67 | 68 | 
| 68   // IPC::Channel::Listener implementation: | 69   // IPC::Channel::Listener implementation: | 
| 69   virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 70   virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 
| 70   virtual void OnChannelError() OVERRIDE; | 71   virtual void OnChannelError() OVERRIDE; | 
| 71   virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; | 72   virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; | 
| 72 | 73 | 
| 73   // IPC::Message::Sender implementation: | 74   // IPC::Message::Sender implementation: | 
| 74   virtual bool Send(IPC::Message* msg) OVERRIDE; | 75   virtual bool Send(IPC::Message* msg) OVERRIDE; | 
| 75 | 76 | 
|  | 77   virtual void AppendAllCommandBufferStubs( | 
|  | 78       std::vector<GpuCommandBufferStubBase*>& stubs); | 
|  | 79 | 
| 76   // Whether this channel is able to handle IPC messages. | 80   // Whether this channel is able to handle IPC messages. | 
| 77   bool IsScheduled(); | 81   bool IsScheduled(); | 
| 78 | 82 | 
| 79   // This is called when a command buffer transitions from the unscheduled | 83   // This is called when a command buffer transitions from the unscheduled | 
| 80   // state to the scheduled state, which potentially means the channel | 84   // state to the scheduled state, which potentially means the channel | 
| 81   // transitions from the unscheduled to the scheduled state. When this occurs | 85   // transitions from the unscheduled to the scheduled state. When this occurs | 
| 82   // deferred IPC messaged are handled. | 86   // deferred IPC messaged are handled. | 
| 83   void OnScheduled(); | 87   void OnScheduled(); | 
| 84 | 88 | 
| 85   void CreateViewCommandBuffer( | 89   void CreateViewCommandBuffer( | 
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 173   bool handle_messages_scheduled_; | 177   bool handle_messages_scheduled_; | 
| 174   bool processed_get_state_fast_; | 178   bool processed_get_state_fast_; | 
| 175   int32 num_contexts_preferring_discrete_gpu_; | 179   int32 num_contexts_preferring_discrete_gpu_; | 
| 176 | 180 | 
| 177   base::WeakPtrFactory<GpuChannel> weak_factory_; | 181   base::WeakPtrFactory<GpuChannel> weak_factory_; | 
| 178 | 182 | 
| 179   DISALLOW_COPY_AND_ASSIGN(GpuChannel); | 183   DISALLOW_COPY_AND_ASSIGN(GpuChannel); | 
| 180 }; | 184 }; | 
| 181 | 185 | 
| 182 #endif  // CONTENT_COMMON_GPU_GPU_CHANNEL_H_ | 186 #endif  // CONTENT_COMMON_GPU_GPU_CHANNEL_H_ | 
| OLD | NEW | 
|---|