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 CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_UI_SHIM_H_ | 5 #ifndef CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_UI_SHIM_H_ |
6 #define CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_UI_SHIM_H_ | 6 #define CONTENT_BROWSER_GPU_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 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 // IPC::Channel::Sender implementation. | 68 // IPC::Channel::Sender implementation. |
69 virtual bool Send(IPC::Message* msg) OVERRIDE; | 69 virtual bool Send(IPC::Message* msg) OVERRIDE; |
70 | 70 |
71 // IPC::Channel::Listener implementation. | 71 // IPC::Channel::Listener implementation. |
72 // The GpuProcessHost causes this to be called on the UI thread to | 72 // The GpuProcessHost causes this to be called on the UI thread to |
73 // dispatch the incoming messages from the GPU process, which are | 73 // dispatch the incoming messages from the GPU process, which are |
74 // actually received on the IO thread. | 74 // actually received on the IO thread. |
75 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 75 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
76 | 76 |
| 77 #if defined(OS_MACOSX) || defined(UI_COMPOSITOR_IMAGE_TRANSPORT) |
| 78 // TODO(apatrick): Remove this when mac does not use AcceleratedSurfaces for |
| 79 // when running the GPU thread in the browser process. |
| 80 // This is now also used in TOUCH_UI builds. |
77 static void SendToGpuHost(int host_id, IPC::Message* msg); | 81 static void SendToGpuHost(int host_id, IPC::Message* msg); |
| 82 #endif |
78 | 83 |
79 private: | 84 private: |
80 explicit GpuProcessHostUIShim(int host_id); | 85 explicit GpuProcessHostUIShim(int host_id); |
81 virtual ~GpuProcessHostUIShim(); | 86 virtual ~GpuProcessHostUIShim(); |
82 | 87 |
83 // Message handlers. | 88 // Message handlers. |
84 bool OnControlMessageReceived(const IPC::Message& message); | 89 bool OnControlMessageReceived(const IPC::Message& message); |
85 | 90 |
86 void OnLogMessage(int level, const std::string& header, | 91 void OnLogMessage(int level, const std::string& header, |
87 const std::string& message); | 92 const std::string& message); |
88 #if defined(TOOLKIT_USES_GTK) && !defined(UI_COMPOSITOR_IMAGE_TRANSPORT) || \ | 93 #if defined(TOOLKIT_USES_GTK) && !defined(UI_COMPOSITOR_IMAGE_TRANSPORT) || \ |
89 defined(OS_WIN) | 94 defined(OS_WIN) |
90 void OnResizeView(int32 renderer_id, | 95 void OnResizeView(int32 renderer_id, |
91 int32 render_view_id, | 96 int32 render_view_id, |
92 int32 route_id, | 97 int32 command_buffer_route_id, |
93 gfx::Size size); | 98 gfx::Size size); |
94 #endif | 99 #endif |
95 | 100 |
96 void OnAcceleratedSurfaceBuffersSwapped( | |
97 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params); | |
98 | |
99 #if defined(OS_MACOSX) || defined(UI_COMPOSITOR_IMAGE_TRANSPORT) | 101 #if defined(OS_MACOSX) || defined(UI_COMPOSITOR_IMAGE_TRANSPORT) |
100 void OnAcceleratedSurfaceNew( | 102 void OnAcceleratedSurfaceNew( |
101 const GpuHostMsg_AcceleratedSurfaceNew_Params& params); | 103 const GpuHostMsg_AcceleratedSurfaceNew_Params& params); |
| 104 void OnAcceleratedSurfaceBuffersSwapped( |
| 105 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params); |
102 #endif | 106 #endif |
103 | 107 |
104 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) | 108 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) |
105 void OnAcceleratedSurfaceRelease( | 109 void OnAcceleratedSurfaceRelease( |
106 const GpuHostMsg_AcceleratedSurfaceRelease_Params& params); | 110 const GpuHostMsg_AcceleratedSurfaceRelease_Params& params); |
107 #endif | 111 #endif |
108 | 112 |
109 // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair. | 113 // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair. |
110 int host_id_; | 114 int host_id_; |
111 }; | 115 }; |
112 | 116 |
113 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_UI_SHIM_H_ | 117 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_UI_SHIM_H_ |
OLD | NEW |