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> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/id_map.h" | 10 #include "base/id_map.h" |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 RenderWidgetHostView* view = host->view(); | 274 RenderWidgetHostView* view = host->view(); |
275 if (!view) | 275 if (!view) |
276 return; | 276 return; |
277 | 277 |
278 uint64 surface_id = params.surface_id; | 278 uint64 surface_id = params.surface_id; |
279 TransportDIB::Handle surface_handle = TransportDIB::DefaultHandleValue(); | 279 TransportDIB::Handle surface_handle = TransportDIB::DefaultHandleValue(); |
280 | 280 |
281 #if defined(OS_MACOSX) | 281 #if defined(OS_MACOSX) |
282 if (params.create_transport_dib) { | 282 if (params.create_transport_dib) { |
283 scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory()); | 283 scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory()); |
284 if (shared_memory->CreateAnonymous(params.width * params.height * 4)) { | 284 if (shared_memory->CreateAnonymous(params.width * params.height * 4, |
| 285 false)) { |
285 // Create a local handle for RWHVMac to map the SHM. | 286 // Create a local handle for RWHVMac to map the SHM. |
286 TransportDIB::Handle local_handle; | 287 TransportDIB::Handle local_handle; |
287 if (!shared_memory->ShareToProcess(0 /* pid, not needed */, | 288 if (!shared_memory->ShareToProcess(0 /* pid, not needed */, |
288 &local_handle)) { | 289 &local_handle)) { |
289 return; | 290 return; |
290 } else { | 291 } else { |
291 view->AcceleratedSurfaceSetTransportDIB(params.window, | 292 view->AcceleratedSurfaceSetTransportDIB(params.window, |
292 params.width, | 293 params.width, |
293 params.height, | 294 params.height, |
294 local_handle); | 295 local_handle); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 params.render_view_id); | 361 params.render_view_id); |
361 if (!host) | 362 if (!host) |
362 return; | 363 return; |
363 RenderWidgetHostView* view = host->view(); | 364 RenderWidgetHostView* view = host->view(); |
364 if (!view) | 365 if (!view) |
365 return; | 366 return; |
366 view->AcceleratedSurfaceRelease(params.identifier); | 367 view->AcceleratedSurfaceRelease(params.identifier); |
367 } | 368 } |
368 | 369 |
369 #endif | 370 #endif |
OLD | NEW |