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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 #endif | 271 #endif |
272 } | 272 } |
273 | 273 |
274 int32 GpuChannelHost::ReserveTransferBufferId() { | 274 int32 GpuChannelHost::ReserveTransferBufferId() { |
275 return next_transfer_buffer_id_.GetNext(); | 275 return next_transfer_buffer_id_.GetNext(); |
276 } | 276 } |
277 | 277 |
278 gfx::GpuMemoryBufferHandle GpuChannelHost::ShareGpuMemoryBufferToGpuProcess( | 278 gfx::GpuMemoryBufferHandle GpuChannelHost::ShareGpuMemoryBufferToGpuProcess( |
279 gfx::GpuMemoryBufferHandle source_handle) { | 279 gfx::GpuMemoryBufferHandle source_handle) { |
280 switch (source_handle.type) { | 280 switch (source_handle.type) { |
| 281 case gfx::FOOBAR_BUFFER: |
281 case gfx::SHARED_MEMORY_BUFFER: { | 282 case gfx::SHARED_MEMORY_BUFFER: { |
282 gfx::GpuMemoryBufferHandle handle; | 283 gfx::GpuMemoryBufferHandle handle; |
283 handle.type = gfx::SHARED_MEMORY_BUFFER; | 284 handle.type = source_handle.type; |
284 handle.handle = ShareToGpuProcess(source_handle.handle); | 285 handle.handle = ShareToGpuProcess(source_handle.handle); |
285 return handle; | 286 return handle; |
286 } | 287 } |
287 #if defined(OS_MACOSX) | 288 #if defined(OS_MACOSX) |
288 case gfx::IO_SURFACE_BUFFER: | 289 case gfx::IO_SURFACE_BUFFER: |
289 return source_handle; | 290 return source_handle; |
290 #endif | 291 #endif |
291 default: | 292 default: |
292 NOTREACHED(); | 293 NOTREACHED(); |
293 return gfx::GpuMemoryBufferHandle(); | 294 return gfx::GpuMemoryBufferHandle(); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 | 371 |
371 listeners_.clear(); | 372 listeners_.clear(); |
372 } | 373 } |
373 | 374 |
374 bool GpuChannelHost::MessageFilter::IsLost() const { | 375 bool GpuChannelHost::MessageFilter::IsLost() const { |
375 AutoLock lock(lock_); | 376 AutoLock lock(lock_); |
376 return lost_; | 377 return lost_; |
377 } | 378 } |
378 | 379 |
379 } // namespace content | 380 } // namespace content |
OLD | NEW |