| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_GPU_PROCESS_HOST_UI_SHIM_H_ | 5 #ifndef CHROME_BROWSER_GPU_PROCESS_HOST_UI_SHIM_H_ |
| 6 #define CHROME_BROWSER_GPU_PROCESS_HOST_UI_SHIM_H_ | 6 #define CHROME_BROWSER_GPU_PROCESS_HOST_UI_SHIM_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 // This class lives on the UI thread and supports classes like the | 9 // This class lives on the UI thread and supports classes like the |
| 10 // BackingStoreProxy, which must live on the UI thread. The IO thread | 10 // BackingStoreProxy, which must live on the UI thread. The IO thread |
| 11 // portion of this class, the GpuProcessHost, is responsible for | 11 // portion of this class, the GpuProcessHost, is responsible for |
| 12 // shuttling messages between the browser and GPU processes. | 12 // shuttling messages between the browser and GPU processes. |
| 13 | 13 |
| 14 #include <map> | 14 #include <map> |
| 15 #include <queue> | 15 #include <queue> |
| 16 | 16 |
| 17 #include "base/callback.h" | 17 #include "base/callback.h" |
| 18 #include "base/memory/linked_ptr.h" | 18 #include "base/memory/linked_ptr.h" |
| 19 #include "base/memory/ref_counted.h" | 19 #include "base/memory/ref_counted.h" |
| 20 #include "base/memory/scoped_ptr.h" | 20 #include "base/memory/scoped_ptr.h" |
| 21 #include "base/memory/singleton.h" | 21 #include "base/memory/singleton.h" |
| 22 #include "base/process.h" | 22 #include "base/process.h" |
| 23 #include "base/threading/non_thread_safe.h" | 23 #include "base/threading/non_thread_safe.h" |
| 24 #include "content/common/gpu/gpu_channel_manager.h" |
| 25 #include "content/common/gpu/gpu_info.h" |
| 24 #include "content/common/gpu_feature_flags.h" | 26 #include "content/common/gpu_feature_flags.h" |
| 25 #include "content/common/gpu_info.h" | |
| 26 #include "content/common/message_router.h" | 27 #include "content/common/message_router.h" |
| 27 #include "content/gpu/gpu_render_thread.h" | |
| 28 #include "ui/gfx/native_widget_types.h" | 28 #include "ui/gfx/native_widget_types.h" |
| 29 | 29 |
| 30 namespace gfx { | 30 namespace gfx { |
| 31 class Size; | 31 class Size; |
| 32 } | 32 } |
| 33 | 33 |
| 34 class GpuDataManager; | 34 class GpuDataManager; |
| 35 struct GPUCreateCommandBufferConfig; | 35 struct GPUCreateCommandBufferConfig; |
| 36 struct GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params; | 36 struct GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params; |
| 37 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; | 37 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 200 |
| 201 // Encapsulates surfaces that we acquire when creating view command buffers. | 201 // Encapsulates surfaces that we acquire when creating view command buffers. |
| 202 // We assume that a render view has at most 1 such surface associated | 202 // We assume that a render view has at most 1 such surface associated |
| 203 // with it. Multimap is used to simulate reference counting, see comment in | 203 // with it. Multimap is used to simulate reference counting, see comment in |
| 204 // GpuProcessHostUIShim::CreateViewCommandBuffer. | 204 // GpuProcessHostUIShim::CreateViewCommandBuffer. |
| 205 class ViewSurface; | 205 class ViewSurface; |
| 206 typedef std::multimap<ViewID, linked_ptr<ViewSurface> > ViewSurfaceMap; | 206 typedef std::multimap<ViewID, linked_ptr<ViewSurface> > ViewSurfaceMap; |
| 207 ViewSurfaceMap acquired_surfaces_; | 207 ViewSurfaceMap acquired_surfaces_; |
| 208 | 208 |
| 209 // In single process and in process GPU mode, this references the | 209 // In single process and in process GPU mode, this references the |
| 210 // GpuRenderThread or null otherwise. It must be called and deleted on the GPU | 210 // GpuChannelManager or null otherwise. It must be called and deleted on the |
| 211 // thread. | 211 // GPU thread. |
| 212 GpuRenderThread* gpu_render_thread_; | 212 GpuChannelManager* gpu_channel_manager_; |
| 213 | 213 |
| 214 // This is likewise single process / in process GPU specific. This is a Sender | 214 // This is likewise single process / in process GPU specific. This is a Sender |
| 215 // implementation that forwards IPC messages to this UI shim on the UI thread. | 215 // implementation that forwards IPC messages to this UI shim on the UI thread. |
| 216 IPC::Channel::Sender* ui_thread_sender_; | 216 IPC::Channel::Sender* ui_thread_sender_; |
| 217 }; | 217 }; |
| 218 | 218 |
| 219 #endif // CHROME_BROWSER_GPU_PROCESS_HOST_UI_SHIM_H_ | 219 #endif // CHROME_BROWSER_GPU_PROCESS_HOST_UI_SHIM_H_ |
| 220 | 220 |
| OLD | NEW |