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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 return handle; | 300 return handle; |
298 } | 301 } |
299 #if defined(OS_MACOSX) | 302 #if defined(OS_MACOSX) |
300 case gfx::IO_SURFACE_BUFFER: | 303 case gfx::IO_SURFACE_BUFFER: |
301 return source_handle; | 304 return source_handle; |
302 #endif | 305 #endif |
303 #if defined(OS_ANDROID) | 306 #if defined(OS_ANDROID) |
304 case gfx::SURFACE_TEXTURE_BUFFER: | 307 case gfx::SURFACE_TEXTURE_BUFFER: |
305 return source_handle; | 308 return source_handle; |
306 #endif | 309 #endif |
| 310 #if defined(USE_X11) |
| 311 case gfx::X11_PIXMAP_BUFFER: |
| 312 return source_handle; |
| 313 #endif |
307 default: | 314 default: |
308 NOTREACHED(); | 315 NOTREACHED(); |
309 return gfx::GpuMemoryBufferHandle(); | 316 return gfx::GpuMemoryBufferHandle(); |
310 } | 317 } |
311 } | 318 } |
312 | 319 |
313 int32 GpuChannelHost::ReserveGpuMemoryBufferId() { | 320 int32 GpuChannelHost::ReserveGpuMemoryBufferId() { |
314 return next_gpu_memory_buffer_id_.GetNext(); | 321 return next_gpu_memory_buffer_id_.GetNext(); |
315 } | 322 } |
316 | 323 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 | 397 |
391 listeners_.clear(); | 398 listeners_.clear(); |
392 } | 399 } |
393 | 400 |
394 bool GpuChannelHost::MessageFilter::IsLost() const { | 401 bool GpuChannelHost::MessageFilter::IsLost() const { |
395 AutoLock lock(lock_); | 402 AutoLock lock(lock_); |
396 return lost_; | 403 return lost_; |
397 } | 404 } |
398 | 405 |
399 } // namespace content | 406 } // namespace content |
OLD | NEW |