| 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(TOUCH_UI) | 79 #if defined(OS_MACOSX) || defined(UI_COMPOSITOR_IMAGE_TRANSPORT) |
| 80 // TODO(apatrick): Remove this when mac does not use AcceleratedSurfaces for | 80 // TODO(apatrick): Remove this when mac does not use AcceleratedSurfaces for |
| 81 // when running the GPU thread in the browser process. | 81 // when running the GPU thread in the browser process. |
| 82 // This is now also used in TOUCH_UI builds. | 82 // This is now also used in TOUCH_UI builds. |
| 83 static void SendToGpuHost(int host_id, IPC::Message* msg); | 83 static void SendToGpuHost(int host_id, IPC::Message* msg); |
| 84 #endif | 84 #endif |
| 85 | 85 |
| 86 private: | 86 private: |
| 87 explicit GpuProcessHostUIShim(int host_id); | 87 explicit GpuProcessHostUIShim(int host_id); |
| 88 virtual ~GpuProcessHostUIShim(); | 88 virtual ~GpuProcessHostUIShim(); |
| 89 | 89 |
| 90 // Message handlers. | 90 // Message handlers. |
| 91 bool OnControlMessageReceived(const IPC::Message& message); | 91 bool OnControlMessageReceived(const IPC::Message& message); |
| 92 | 92 |
| 93 void OnLogMessage(int level, const std::string& header, | 93 void OnLogMessage(int level, const std::string& header, |
| 94 const std::string& message); | 94 const std::string& message); |
| 95 #if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) || defined(OS_WIN) | 95 #if defined(TOOLKIT_USES_GTK) && !defined(UI_COMPOSITOR_IMAGE_TRANSPORT) || \ |
| 96 defined(OS_WIN) |
| 96 void OnResizeView(int32 renderer_id, | 97 void OnResizeView(int32 renderer_id, |
| 97 int32 render_view_id, | 98 int32 render_view_id, |
| 98 int32 command_buffer_route_id, | 99 int32 command_buffer_route_id, |
| 99 gfx::Size size); | 100 gfx::Size size); |
| 100 #endif | 101 #endif |
| 101 | 102 |
| 102 #if defined(OS_MACOSX) || defined(TOUCH_UI) | 103 #if defined(OS_MACOSX) || defined(UI_COMPOSITOR_IMAGE_TRANSPORT) |
| 103 void OnAcceleratedSurfaceNew( | 104 void OnAcceleratedSurfaceNew( |
| 104 const GpuHostMsg_AcceleratedSurfaceNew_Params& params); | 105 const GpuHostMsg_AcceleratedSurfaceNew_Params& params); |
| 105 void OnAcceleratedSurfaceBuffersSwapped( | 106 void OnAcceleratedSurfaceBuffersSwapped( |
| 106 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params); | 107 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params); |
| 107 #endif | 108 #endif |
| 108 | 109 |
| 109 #if defined(TOUCH_UI) | 110 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) |
| 110 void OnAcceleratedSurfaceRelease( | 111 void OnAcceleratedSurfaceRelease( |
| 111 const GpuHostMsg_AcceleratedSurfaceRelease_Params& params); | 112 const GpuHostMsg_AcceleratedSurfaceRelease_Params& params); |
| 112 #endif | 113 #endif |
| 113 | 114 |
| 114 // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair. | 115 // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair. |
| 115 int host_id_; | 116 int host_id_; |
| 116 }; | 117 }; |
| 117 | 118 |
| 118 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_UI_SHIM_H_ | 119 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_UI_SHIM_H_ |
| OLD | NEW |