| 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 "gpu/ipc/client/gpu_channel_host.h" | 5 #include "gpu/ipc/client/gpu_channel_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/atomic_sequence_num.h" | 10 #include "base/atomic_sequence_num.h" |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 } | 279 } |
| 280 } | 280 } |
| 281 | 281 |
| 282 int32_t GpuChannelHost::ReserveImageId() { | 282 int32_t GpuChannelHost::ReserveImageId() { |
| 283 return next_image_id_.GetNext(); | 283 return next_image_id_.GetNext(); |
| 284 } | 284 } |
| 285 | 285 |
| 286 gfx::GpuFenceHandle GpuChannelHost::ShareGpuFenceToGpuProcess( | 286 gfx::GpuFenceHandle GpuChannelHost::ShareGpuFenceToGpuProcess( |
| 287 const gfx::GpuFenceHandle& source_handle) { | 287 const gfx::GpuFenceHandle& source_handle) { |
| 288 gfx::GpuFenceHandle handle; | 288 gfx::GpuFenceHandle handle; |
| 289 handle.shared_event_handle = | 289 if (gfx::SharedEvent::IsHandleValid(source_handle.shared_event_handle)) { |
| 290 gfx::SharedEvent::DuplicateHandle(source_handle.shared_event_handle); | 290 handle.shared_event_handle = |
| 291 gfx::SharedEvent::DuplicateHandle(source_handle.shared_event_handle); |
| 292 } |
| 293 #if defined(OS_LINUX) |
| 294 if (source_handle.fd.fd >= 0) { |
| 295 handle.fd.fd = HANDLE_EINTR(dup(source_handle.fd.fd)); |
| 296 handle.fd.auto_close = true; |
| 297 } |
| 298 #endif |
| 291 return handle; | 299 return handle; |
| 292 } | 300 } |
| 293 | 301 |
| 294 int32_t GpuChannelHost::ReserveFenceId() { | 302 int32_t GpuChannelHost::ReserveFenceId() { |
| 295 return next_fence_id_.GetNext(); | 303 return next_fence_id_.GetNext(); |
| 296 } | 304 } |
| 297 | 305 |
| 298 int32_t GpuChannelHost::GenerateRouteID() { | 306 int32_t GpuChannelHost::GenerateRouteID() { |
| 299 return next_route_id_.GetNext(); | 307 return next_route_id_.GetNext(); |
| 300 } | 308 } |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 | 443 |
| 436 listeners_.clear(); | 444 listeners_.clear(); |
| 437 } | 445 } |
| 438 | 446 |
| 439 bool GpuChannelHost::MessageFilter::IsLost() const { | 447 bool GpuChannelHost::MessageFilter::IsLost() const { |
| 440 AutoLock lock(lock_); | 448 AutoLock lock(lock_); |
| 441 return lost_; | 449 return lost_; |
| 442 } | 450 } |
| 443 | 451 |
| 444 } // namespace gpu | 452 } // namespace gpu |
| OLD | NEW |