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) { | |
286 DCHECK(requires_sync_point); | |
reveman
2014/11/03 22:26:12
nit: I think this DCHECK is overkill
| |
285 switch (source_handle.type) { | 287 switch (source_handle.type) { |
286 case gfx::SHARED_MEMORY_BUFFER: { | 288 case gfx::SHARED_MEMORY_BUFFER: { |
287 gfx::GpuMemoryBufferHandle handle; | 289 gfx::GpuMemoryBufferHandle handle; |
288 handle.type = gfx::SHARED_MEMORY_BUFFER; | 290 handle.type = gfx::SHARED_MEMORY_BUFFER; |
289 handle.handle = ShareToGpuProcess(source_handle.handle); | 291 handle.handle = ShareToGpuProcess(source_handle.handle); |
292 *requires_sync_point = false; | |
290 return handle; | 293 return handle; |
291 } | 294 } |
292 #if defined(USE_OZONE) | 295 #if defined(USE_OZONE) |
293 case gfx::OZONE_NATIVE_BUFFER: | 296 case gfx::OZONE_NATIVE_BUFFER: |
297 *requires_sync_point = true; | |
294 return source_handle; | 298 return source_handle; |
295 #endif | 299 #endif |
296 #if defined(OS_MACOSX) | 300 #if defined(OS_MACOSX) |
297 case gfx::IO_SURFACE_BUFFER: | 301 case gfx::IO_SURFACE_BUFFER: |
302 *requires_sync_point = true; | |
298 return source_handle; | 303 return source_handle; |
299 #endif | 304 #endif |
300 #if defined(OS_ANDROID) | 305 #if defined(OS_ANDROID) |
301 case gfx::SURFACE_TEXTURE_BUFFER: | 306 case gfx::SURFACE_TEXTURE_BUFFER: |
307 *requires_sync_point = true; | |
302 return source_handle; | 308 return source_handle; |
303 #endif | 309 #endif |
304 #if defined(USE_X11) | 310 #if defined(USE_X11) |
305 case gfx::X11_PIXMAP_BUFFER: | 311 case gfx::X11_PIXMAP_BUFFER: |
312 *requires_sync_point = true; | |
306 return source_handle; | 313 return source_handle; |
307 #endif | 314 #endif |
308 default: | 315 default: |
309 NOTREACHED(); | 316 NOTREACHED(); |
317 *requires_sync_point = false; | |
reveman
2014/11/03 22:26:12
nit: I don't think you should set requires_sync_po
| |
310 return gfx::GpuMemoryBufferHandle(); | 318 return gfx::GpuMemoryBufferHandle(); |
311 } | 319 } |
312 } | 320 } |
313 | 321 |
314 int32 GpuChannelHost::ReserveImageId() { | 322 int32 GpuChannelHost::ReserveImageId() { |
315 return next_image_id_.GetNext(); | 323 return next_image_id_.GetNext(); |
316 } | 324 } |
317 | 325 |
318 int32 GpuChannelHost::GenerateRouteID() { | 326 int32 GpuChannelHost::GenerateRouteID() { |
319 return next_route_id_.GetNext(); | 327 return next_route_id_.GetNext(); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
391 | 399 |
392 listeners_.clear(); | 400 listeners_.clear(); |
393 } | 401 } |
394 | 402 |
395 bool GpuChannelHost::MessageFilter::IsLost() const { | 403 bool GpuChannelHost::MessageFilter::IsLost() const { |
396 AutoLock lock(lock_); | 404 AutoLock lock(lock_); |
397 return lost_; | 405 return lost_; |
398 } | 406 } |
399 | 407 |
400 } // namespace content | 408 } // namespace content |
OLD | NEW |