OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/common/gpu/gpu_memory_buffer_factory.h" |
| 6 |
| 7 #include "content/common/gpu/gpu_memory_buffer_factory_x11_pixmap.h" |
| 8 |
| 9 namespace content { |
| 10 |
| 11 // static |
| 12 void GpuMemoryBufferFactory::Initialize() { |
| 13 GpuMemoryBufferFactoryX11Pixmap::Initialize(); |
| 14 } |
| 15 |
| 16 // static |
| 17 bool GpuMemoryBufferFactory::CreateGpuMemoryBuffer( |
| 18 const gfx::GpuMemoryBufferHandle& handle, |
| 19 const gfx::Size& size, |
| 20 unsigned internalformat, |
| 21 unsigned usage) { |
| 22 switch (handle.type) { |
| 23 case gfx::X11_PIXMAP_BUFFER: |
| 24 GpuMemoryBufferFactoryX11Pixmap::CreateGpuMemoryBuffer(handle); |
| 25 return true; |
| 26 default: |
| 27 return false; |
| 28 } |
| 29 } |
| 30 |
| 31 // static |
| 32 void GpuMemoryBufferFactory::DestroyGpuMemoryBuffer( |
| 33 const gfx::GpuMemoryBufferHandle& handle) { |
| 34 switch (handle.type) { |
| 35 case gfx::X11_PIXMAP_BUFFER: |
| 36 GpuMemoryBufferFactoryX11Pixmap::DestroyGpuMemoryBuffer(handle); |
| 37 break; |
| 38 default: |
| 39 break; |
| 40 } |
| 41 } |
| 42 |
| 43 // static |
| 44 bool GpuMemoryBufferFactory::RequestAccessToGpuMemoryBuffer( |
| 45 const gfx::GpuMemoryBufferHandle& handle, |
| 46 int client_id) { |
| 47 switch (handle.type) { |
| 48 case gfx::X11_PIXMAP_BUFFER: |
| 49 return GpuMemoryBufferFactoryX11Pixmap::RequestAccessToGpuMemoryBuffer( |
| 50 handle, client_id); |
| 51 default: |
| 52 return true; |
| 53 } |
| 54 } |
| 55 |
| 56 } // namespace content |
OLD | NEW |