| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 } | 44 } |
| 45 | 45 |
| 46 // static | 46 // static |
| 47 bool GpuChannelHost::IsValidGpuMemoryBuffer( | 47 bool GpuChannelHost::IsValidGpuMemoryBuffer( |
| 48 gfx::GpuMemoryBufferHandle handle) { | 48 gfx::GpuMemoryBufferHandle handle) { |
| 49 switch (handle.type) { | 49 switch (handle.type) { |
| 50 case gfx::SHARED_MEMORY_BUFFER: | 50 case gfx::SHARED_MEMORY_BUFFER: |
| 51 #if defined(OS_MACOSX) | 51 #if defined(OS_MACOSX) |
| 52 case gfx::IO_SURFACE_BUFFER: | 52 case gfx::IO_SURFACE_BUFFER: |
| 53 #endif | 53 #endif |
| 54 #if defined(OS_ANDROID) |
| 55 case gfx::SURFACE_TEXTURE_BUFFER: |
| 56 #endif |
| 54 return true; | 57 return true; |
| 55 default: | 58 default: |
| 56 return false; | 59 return false; |
| 57 } | 60 } |
| 58 } | 61 } |
| 59 | 62 |
| 60 GpuChannelHost::GpuChannelHost(GpuChannelHostFactory* factory, | 63 GpuChannelHost::GpuChannelHost(GpuChannelHostFactory* factory, |
| 61 const gpu::GPUInfo& gpu_info) | 64 const gpu::GPUInfo& gpu_info) |
| 62 : factory_(factory), | 65 : factory_(factory), |
| 63 gpu_info_(gpu_info) { | 66 gpu_info_(gpu_info) { |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 case gfx::SHARED_MEMORY_BUFFER: { | 284 case gfx::SHARED_MEMORY_BUFFER: { |
| 282 gfx::GpuMemoryBufferHandle handle; | 285 gfx::GpuMemoryBufferHandle handle; |
| 283 handle.type = gfx::SHARED_MEMORY_BUFFER; | 286 handle.type = gfx::SHARED_MEMORY_BUFFER; |
| 284 handle.handle = ShareToGpuProcess(source_handle.handle); | 287 handle.handle = ShareToGpuProcess(source_handle.handle); |
| 285 return handle; | 288 return handle; |
| 286 } | 289 } |
| 287 #if defined(OS_MACOSX) | 290 #if defined(OS_MACOSX) |
| 288 case gfx::IO_SURFACE_BUFFER: | 291 case gfx::IO_SURFACE_BUFFER: |
| 289 return source_handle; | 292 return source_handle; |
| 290 #endif | 293 #endif |
| 294 #if defined(OS_ANDROID) |
| 295 case gfx::SURFACE_TEXTURE_BUFFER: |
| 296 return source_handle; |
| 297 #endif |
| 291 default: | 298 default: |
| 292 NOTREACHED(); | 299 NOTREACHED(); |
| 293 return gfx::GpuMemoryBufferHandle(); | 300 return gfx::GpuMemoryBufferHandle(); |
| 294 } | 301 } |
| 295 } | 302 } |
| 296 | 303 |
| 297 int32 GpuChannelHost::ReserveGpuMemoryBufferId() { | 304 int32 GpuChannelHost::ReserveGpuMemoryBufferId() { |
| 298 return next_gpu_memory_buffer_id_.GetNext(); | 305 return next_gpu_memory_buffer_id_.GetNext(); |
| 299 } | 306 } |
| 300 | 307 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 | 377 |
| 371 listeners_.clear(); | 378 listeners_.clear(); |
| 372 } | 379 } |
| 373 | 380 |
| 374 bool GpuChannelHost::MessageFilter::IsLost() const { | 381 bool GpuChannelHost::MessageFilter::IsLost() const { |
| 375 AutoLock lock(lock_); | 382 AutoLock lock(lock_); |
| 376 return lost_; | 383 return lost_; |
| 377 } | 384 } |
| 378 | 385 |
| 379 } // namespace content | 386 } // namespace content |
| OLD | NEW |