| 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 const gfx::GpuMemoryBufferHandle& source_handle, |
| 285 bool* requires_sync_point) { | 285 bool* requires_sync_point) { |
| 286 switch (source_handle.type) { | 286 switch (source_handle.type) { |
| 287 case gfx::SHARED_MEMORY_BUFFER: { | 287 case gfx::SHARED_MEMORY_BUFFER: { |
| 288 gfx::GpuMemoryBufferHandle handle; | 288 gfx::GpuMemoryBufferHandle handle; |
| 289 handle.type = gfx::SHARED_MEMORY_BUFFER; | 289 handle.type = gfx::SHARED_MEMORY_BUFFER; |
| 290 handle.handle = ShareToGpuProcess(source_handle.handle); | 290 handle.handle = ShareToGpuProcess(source_handle.handle); |
| 291 *requires_sync_point = false; | 291 *requires_sync_point = false; |
| 292 return handle; | 292 return handle; |
| 293 } | 293 } |
| 294 #if defined(USE_OZONE) | 294 case gfx::IO_SURFACE_BUFFER: |
| 295 case gfx::SURFACE_TEXTURE_BUFFER: |
| 295 case gfx::OZONE_NATIVE_BUFFER: | 296 case gfx::OZONE_NATIVE_BUFFER: |
| 296 *requires_sync_point = true; | 297 *requires_sync_point = true; |
| 297 return source_handle; | 298 return source_handle; |
| 298 #endif | |
| 299 #if defined(OS_MACOSX) | |
| 300 case gfx::IO_SURFACE_BUFFER: | |
| 301 *requires_sync_point = true; | |
| 302 return source_handle; | |
| 303 #endif | |
| 304 #if defined(OS_ANDROID) | |
| 305 case gfx::SURFACE_TEXTURE_BUFFER: | |
| 306 *requires_sync_point = true; | |
| 307 return source_handle; | |
| 308 #endif | |
| 309 #if defined(USE_X11) | |
| 310 case gfx::X11_PIXMAP_BUFFER: | |
| 311 *requires_sync_point = true; | |
| 312 return source_handle; | |
| 313 #endif | |
| 314 default: | 299 default: |
| 315 NOTREACHED(); | 300 NOTREACHED(); |
| 316 return gfx::GpuMemoryBufferHandle(); | 301 return gfx::GpuMemoryBufferHandle(); |
| 317 } | 302 } |
| 318 } | 303 } |
| 319 | 304 |
| 320 int32 GpuChannelHost::ReserveImageId() { | 305 int32 GpuChannelHost::ReserveImageId() { |
| 321 return next_image_id_.GetNext(); | 306 return next_image_id_.GetNext(); |
| 322 } | 307 } |
| 323 | 308 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 | 382 |
| 398 listeners_.clear(); | 383 listeners_.clear(); |
| 399 } | 384 } |
| 400 | 385 |
| 401 bool GpuChannelHost::MessageFilter::IsLost() const { | 386 bool GpuChannelHost::MessageFilter::IsLost() const { |
| 402 AutoLock lock(lock_); | 387 AutoLock lock(lock_); |
| 403 return lost_; | 388 return lost_; |
| 404 } | 389 } |
| 405 | 390 |
| 406 } // namespace content | 391 } // namespace content |
| OLD | NEW |