| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/common/gpu/client/gpu_channel_host.h" | 5 #include "content/common/gpu/client/gpu_channel_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 | 274 |
| 275 return base::FileDescriptor(duped_handle, true); | 275 return base::FileDescriptor(duped_handle, true); |
| 276 #endif | 276 #endif |
| 277 } | 277 } |
| 278 | 278 |
| 279 int32 GpuChannelHost::ReserveTransferBufferId() { | 279 int32 GpuChannelHost::ReserveTransferBufferId() { |
| 280 return next_transfer_buffer_id_.GetNext(); | 280 return next_transfer_buffer_id_.GetNext(); |
| 281 } | 281 } |
| 282 | 282 |
| 283 gfx::GpuMemoryBufferHandle GpuChannelHost::ShareGpuMemoryBufferToGpuProcess( | 283 gfx::GpuMemoryBufferHandle GpuChannelHost::ShareGpuMemoryBufferToGpuProcess( |
| 284 gfx::GpuMemoryBufferHandle source_handle) { | 284 gfx::GpuMemoryBufferHandle source_handle, |
| 285 bool* requires_sync_point) { |
| 285 switch (source_handle.type) { | 286 switch (source_handle.type) { |
| 286 case gfx::SHARED_MEMORY_BUFFER: { | 287 case gfx::SHARED_MEMORY_BUFFER: { |
| 287 gfx::GpuMemoryBufferHandle handle; | 288 gfx::GpuMemoryBufferHandle handle; |
| 288 handle.type = gfx::SHARED_MEMORY_BUFFER; | 289 handle.type = gfx::SHARED_MEMORY_BUFFER; |
| 289 handle.handle = ShareToGpuProcess(source_handle.handle); | 290 handle.handle = ShareToGpuProcess(source_handle.handle); |
| 291 *requires_sync_point = false; |
| 290 return handle; | 292 return handle; |
| 291 } | 293 } |
| 292 #if defined(USE_OZONE) | 294 #if defined(USE_OZONE) |
| 293 case gfx::OZONE_NATIVE_BUFFER: | 295 case gfx::OZONE_NATIVE_BUFFER: |
| 296 *requires_sync_point = true; |
| 294 return source_handle; | 297 return source_handle; |
| 295 #endif | 298 #endif |
| 296 #if defined(OS_MACOSX) | 299 #if defined(OS_MACOSX) |
| 297 case gfx::IO_SURFACE_BUFFER: | 300 case gfx::IO_SURFACE_BUFFER: |
| 301 *requires_sync_point = true; |
| 298 return source_handle; | 302 return source_handle; |
| 299 #endif | 303 #endif |
| 300 #if defined(OS_ANDROID) | 304 #if defined(OS_ANDROID) |
| 301 case gfx::SURFACE_TEXTURE_BUFFER: | 305 case gfx::SURFACE_TEXTURE_BUFFER: |
| 306 *requires_sync_point = true; |
| 302 return source_handle; | 307 return source_handle; |
| 303 #endif | 308 #endif |
| 304 #if defined(USE_X11) | 309 #if defined(USE_X11) |
| 305 case gfx::X11_PIXMAP_BUFFER: | 310 case gfx::X11_PIXMAP_BUFFER: |
| 311 *requires_sync_point = true; |
| 306 return source_handle; | 312 return source_handle; |
| 307 #endif | 313 #endif |
| 308 default: | 314 default: |
| 309 NOTREACHED(); | 315 NOTREACHED(); |
| 310 return gfx::GpuMemoryBufferHandle(); | 316 return gfx::GpuMemoryBufferHandle(); |
| 311 } | 317 } |
| 312 } | 318 } |
| 313 | 319 |
| 314 int32 GpuChannelHost::ReserveImageId() { | 320 int32 GpuChannelHost::ReserveImageId() { |
| 315 return next_image_id_.GetNext(); | 321 return next_image_id_.GetNext(); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 | 397 |
| 392 listeners_.clear(); | 398 listeners_.clear(); |
| 393 } | 399 } |
| 394 | 400 |
| 395 bool GpuChannelHost::MessageFilter::IsLost() const { | 401 bool GpuChannelHost::MessageFilter::IsLost() const { |
| 396 AutoLock lock(lock_); | 402 AutoLock lock(lock_); |
| 397 return lost_; | 403 return lost_; |
| 398 } | 404 } |
| 399 | 405 |
| 400 } // namespace content | 406 } // namespace content |
| OLD | NEW |