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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 #endif | 259 #endif |
260 } | 260 } |
261 | 261 |
262 int32 GpuChannelHost::ReserveTransferBufferId() { | 262 int32 GpuChannelHost::ReserveTransferBufferId() { |
263 return next_transfer_buffer_id_.GetNext(); | 263 return next_transfer_buffer_id_.GetNext(); |
264 } | 264 } |
265 | 265 |
266 gfx::GpuMemoryBufferHandle GpuChannelHost::ShareGpuMemoryBufferToGpuProcess( | 266 gfx::GpuMemoryBufferHandle GpuChannelHost::ShareGpuMemoryBufferToGpuProcess( |
267 gfx::GpuMemoryBufferHandle source_handle) { | 267 gfx::GpuMemoryBufferHandle source_handle) { |
268 switch (source_handle.type) { | 268 switch (source_handle.type) { |
| 269 case gfx::FOOBAR_BUFFER: |
269 case gfx::SHARED_MEMORY_BUFFER: { | 270 case gfx::SHARED_MEMORY_BUFFER: { |
270 gfx::GpuMemoryBufferHandle handle; | 271 gfx::GpuMemoryBufferHandle handle; |
271 handle.type = gfx::SHARED_MEMORY_BUFFER; | 272 handle.type = source_handle.type; |
272 handle.handle = ShareToGpuProcess(source_handle.handle); | 273 handle.handle = ShareToGpuProcess(source_handle.handle); |
273 return handle; | 274 return handle; |
274 } | 275 } |
275 #if defined(OS_MACOSX) | 276 #if defined(OS_MACOSX) |
276 case gfx::IO_SURFACE_BUFFER: | 277 case gfx::IO_SURFACE_BUFFER: |
277 return source_handle; | 278 return source_handle; |
278 #endif | 279 #endif |
279 default: | 280 default: |
280 NOTREACHED(); | 281 NOTREACHED(); |
281 return gfx::GpuMemoryBufferHandle(); | 282 return gfx::GpuMemoryBufferHandle(); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 | 359 |
359 listeners_.clear(); | 360 listeners_.clear(); |
360 } | 361 } |
361 | 362 |
362 bool GpuChannelHost::MessageFilter::IsLost() const { | 363 bool GpuChannelHost::MessageFilter::IsLost() const { |
363 AutoLock lock(lock_); | 364 AutoLock lock(lock_); |
364 return lost_; | 365 return lost_; |
365 } | 366 } |
366 | 367 |
367 } // namespace content | 368 } // namespace content |
OLD | NEW |