| 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 case gfx::SHARED_MEMORY_BUFFER: { | 274 case gfx::SHARED_MEMORY_BUFFER: { |
| 272 gfx::GpuMemoryBufferHandle handle; | 275 gfx::GpuMemoryBufferHandle handle; |
| 273 handle.type = gfx::SHARED_MEMORY_BUFFER; | 276 handle.type = gfx::SHARED_MEMORY_BUFFER; |
| 274 handle.handle = ShareToGpuProcess(source_handle.handle); | 277 handle.handle = ShareToGpuProcess(source_handle.handle); |
| 275 return handle; | 278 return handle; |
| 276 } | 279 } |
| 277 #if defined(OS_MACOSX) | 280 #if defined(OS_MACOSX) |
| 278 case gfx::IO_SURFACE_BUFFER: | 281 case gfx::IO_SURFACE_BUFFER: |
| 279 return source_handle; | 282 return source_handle; |
| 280 #endif | 283 #endif |
| 284 #if defined(OS_ANDROID) |
| 285 case gfx::SURFACE_TEXTURE_BUFFER: |
| 286 return source_handle; |
| 287 #endif |
| 281 default: | 288 default: |
| 282 NOTREACHED(); | 289 NOTREACHED(); |
| 283 return gfx::GpuMemoryBufferHandle(); | 290 return gfx::GpuMemoryBufferHandle(); |
| 284 } | 291 } |
| 285 } | 292 } |
| 286 | 293 |
| 287 int32 GpuChannelHost::ReserveGpuMemoryBufferId() { | 294 int32 GpuChannelHost::ReserveGpuMemoryBufferId() { |
| 288 return next_gpu_memory_buffer_id_.GetNext(); | 295 return next_gpu_memory_buffer_id_.GetNext(); |
| 289 } | 296 } |
| 290 | 297 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 | 367 |
| 361 listeners_.clear(); | 368 listeners_.clear(); |
| 362 } | 369 } |
| 363 | 370 |
| 364 bool GpuChannelHost::MessageFilter::IsLost() const { | 371 bool GpuChannelHost::MessageFilter::IsLost() const { |
| 365 AutoLock lock(lock_); | 372 AutoLock lock(lock_); |
| 366 return lost_; | 373 return lost_; |
| 367 } | 374 } |
| 368 | 375 |
| 369 } // namespace content | 376 } // namespace content |
| OLD | NEW |