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