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 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 5 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
6 | 6 |
| 7 #include <algorithm> |
| 8 |
7 #include "base/id_map.h" | 9 #include "base/id_map.h" |
8 #include "base/process_util.h" | 10 #include "base/process_util.h" |
9 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
10 #include "content/browser/browser_thread.h" | 12 #include "content/browser/browser_thread.h" |
11 #include "content/browser/gpu/gpu_data_manager.h" | 13 #include "content/browser/gpu/gpu_data_manager.h" |
12 #include "content/browser/gpu/gpu_process_host.h" | 14 #include "content/browser/gpu/gpu_process_host.h" |
13 #include "content/browser/renderer_host/render_process_host.h" | 15 #include "content/browser/renderer_host/render_process_host.h" |
14 #include "content/browser/renderer_host/render_view_host.h" | 16 #include "content/browser/renderer_host/render_view_host.h" |
15 #include "content/browser/renderer_host/render_widget_host_view.h" | 17 #include "content/browser/renderer_host/render_widget_host_view.h" |
16 #include "content/common/gpu/gpu_messages.h" | 18 #include "content/common/gpu/gpu_messages.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 // to be. | 189 // to be. |
188 #if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) | 190 #if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) |
189 GdkWindow* window = reinterpret_cast<GdkWindow*>( | 191 GdkWindow* window = reinterpret_cast<GdkWindow*>( |
190 gdk_xid_table_lookup(handle)); | 192 gdk_xid_table_lookup(handle)); |
191 if (window) { | 193 if (window) { |
192 Display* display = GDK_WINDOW_XDISPLAY(window); | 194 Display* display = GDK_WINDOW_XDISPLAY(window); |
193 gdk_window_resize(window, size.width(), size.height()); | 195 gdk_window_resize(window, size.width(), size.height()); |
194 XSync(display, False); | 196 XSync(display, False); |
195 } | 197 } |
196 #elif defined(OS_WIN) | 198 #elif defined(OS_WIN) |
| 199 // Ensure window does not have zero area because D3D cannot create a zero |
| 200 // area swap chain. |
197 SetWindowPos(handle, | 201 SetWindowPos(handle, |
198 NULL, | 202 NULL, |
199 0, 0, | 203 0, 0, |
200 size.width(), | 204 std::max(1, size.width()), |
201 size.height(), | 205 std::max(1, size.height()), |
202 SWP_NOSENDCHANGING | SWP_NOCOPYBITS | SWP_NOZORDER | | 206 SWP_NOSENDCHANGING | SWP_NOCOPYBITS | SWP_NOZORDER | |
203 SWP_NOACTIVATE | SWP_DEFERERASE); | 207 SWP_NOACTIVATE | SWP_DEFERERASE); |
204 #endif | 208 #endif |
205 } | 209 } |
206 } | 210 } |
207 | 211 |
208 // Always respond even if the window no longer exists. The GPU process cannot | 212 // Always respond even if the window no longer exists. The GPU process cannot |
209 // make progress on the resizing command buffer until it receives the | 213 // make progress on the resizing command buffer until it receives the |
210 // response. | 214 // response. |
211 Send(new GpuMsg_ResizeViewACK(renderer_id, command_buffer_route_id)); | 215 Send(new GpuMsg_ResizeViewACK(renderer_id, command_buffer_route_id)); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 params.window, | 248 params.window, |
245 params.surface_id, | 249 params.surface_id, |
246 // Parameters needed to formulate an acknowledgment. | 250 // Parameters needed to formulate an acknowledgment. |
247 params.renderer_id, | 251 params.renderer_id, |
248 params.route_id, | 252 params.route_id, |
249 host_id_, | 253 host_id_, |
250 params.swap_buffers_count); | 254 params.swap_buffers_count); |
251 } | 255 } |
252 | 256 |
253 #endif | 257 #endif |
OLD | NEW |