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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 bool GpuChannelHost::IsValidGpuMemoryBuffer( | 46 bool GpuChannelHost::IsValidGpuMemoryBuffer( |
47 gfx::GpuMemoryBufferHandle handle) { | 47 gfx::GpuMemoryBufferHandle handle) { |
48 switch (handle.type) { | 48 switch (handle.type) { |
49 case gfx::SHARED_MEMORY_BUFFER: | 49 case gfx::SHARED_MEMORY_BUFFER: |
50 #if defined(OS_MACOSX) | 50 #if defined(OS_MACOSX) |
51 case gfx::IO_SURFACE_BUFFER: | 51 case gfx::IO_SURFACE_BUFFER: |
52 #endif | 52 #endif |
53 #if defined(OS_ANDROID) | 53 #if defined(OS_ANDROID) |
54 case gfx::SURFACE_TEXTURE_BUFFER: | 54 case gfx::SURFACE_TEXTURE_BUFFER: |
55 #endif | 55 #endif |
| 56 #if defined(USE_X11) |
| 57 case gfx::X11_PIXMAP_BUFFER: |
| 58 #endif |
56 return true; | 59 return true; |
57 default: | 60 default: |
58 return false; | 61 return false; |
59 } | 62 } |
60 } | 63 } |
61 | 64 |
62 GpuChannelHost::GpuChannelHost(GpuChannelHostFactory* factory, | 65 GpuChannelHost::GpuChannelHost(GpuChannelHostFactory* factory, |
63 const gpu::GPUInfo& gpu_info) | 66 const gpu::GPUInfo& gpu_info) |
64 : factory_(factory), | 67 : factory_(factory), |
65 gpu_info_(gpu_info) { | 68 gpu_info_(gpu_info) { |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 return handle; | 305 return handle; |
303 } | 306 } |
304 #if defined(OS_MACOSX) | 307 #if defined(OS_MACOSX) |
305 case gfx::IO_SURFACE_BUFFER: | 308 case gfx::IO_SURFACE_BUFFER: |
306 return source_handle; | 309 return source_handle; |
307 #endif | 310 #endif |
308 #if defined(OS_ANDROID) | 311 #if defined(OS_ANDROID) |
309 case gfx::SURFACE_TEXTURE_BUFFER: | 312 case gfx::SURFACE_TEXTURE_BUFFER: |
310 return source_handle; | 313 return source_handle; |
311 #endif | 314 #endif |
| 315 #if defined(USE_X11) |
| 316 case gfx::X11_PIXMAP_BUFFER: |
| 317 return source_handle; |
| 318 #endif |
312 default: | 319 default: |
313 NOTREACHED(); | 320 NOTREACHED(); |
314 return gfx::GpuMemoryBufferHandle(); | 321 return gfx::GpuMemoryBufferHandle(); |
315 } | 322 } |
316 } | 323 } |
317 | 324 |
318 int32 GpuChannelHost::ReserveGpuMemoryBufferId() { | 325 int32 GpuChannelHost::ReserveGpuMemoryBufferId() { |
319 return next_gpu_memory_buffer_id_.GetNext(); | 326 return next_gpu_memory_buffer_id_.GetNext(); |
320 } | 327 } |
321 | 328 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 | 402 |
396 listeners_.clear(); | 403 listeners_.clear(); |
397 } | 404 } |
398 | 405 |
399 bool GpuChannelHost::MessageFilter::IsLost() const { | 406 bool GpuChannelHost::MessageFilter::IsLost() const { |
400 AutoLock lock(lock_); | 407 AutoLock lock(lock_); |
401 return lost_; | 408 return lost_; |
402 } | 409 } |
403 | 410 |
404 } // namespace content | 411 } // namespace content |
OLD | NEW |