| Index: content/common/gpu/gpu_memory_buffer_factory_x11.cc
|
| diff --git a/content/common/gpu/gpu_memory_buffer_factory_x11.cc b/content/common/gpu/gpu_memory_buffer_factory_x11.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..8c36b24ead542562e1a1b02be64e4aa5a10639bf
|
| --- /dev/null
|
| +++ b/content/common/gpu/gpu_memory_buffer_factory_x11.cc
|
| @@ -0,0 +1,56 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "content/common/gpu/gpu_memory_buffer_factory.h"
|
| +
|
| +#include "content/common/gpu/gpu_memory_buffer_factory_x11_pixmap.h"
|
| +
|
| +namespace content {
|
| +
|
| +// static
|
| +void GpuMemoryBufferFactory::Initialize() {
|
| + GpuMemoryBufferFactoryX11Pixmap::Initialize();
|
| +}
|
| +
|
| +// static
|
| +bool GpuMemoryBufferFactory::CreateGpuMemoryBuffer(
|
| + const gfx::GpuMemoryBufferHandle& handle,
|
| + const gfx::Size& size,
|
| + unsigned internalformat,
|
| + unsigned usage) {
|
| + switch (handle.type) {
|
| + case gfx::X11_PIXMAP_BUFFER:
|
| + GpuMemoryBufferFactoryX11Pixmap::CreateGpuMemoryBuffer(handle);
|
| + return true;
|
| + default:
|
| + return false;
|
| + }
|
| +}
|
| +
|
| +// static
|
| +void GpuMemoryBufferFactory::DestroyGpuMemoryBuffer(
|
| + const gfx::GpuMemoryBufferHandle& handle) {
|
| + switch (handle.type) {
|
| + case gfx::X11_PIXMAP_BUFFER:
|
| + GpuMemoryBufferFactoryX11Pixmap::DestroyGpuMemoryBuffer(handle);
|
| + break;
|
| + default:
|
| + break;
|
| + }
|
| +}
|
| +
|
| +// static
|
| +bool GpuMemoryBufferFactory::RequestAccessToGpuMemoryBuffer(
|
| + const gfx::GpuMemoryBufferHandle& handle,
|
| + int client_id) {
|
| + switch (handle.type) {
|
| + case gfx::X11_PIXMAP_BUFFER:
|
| + return GpuMemoryBufferFactoryX11Pixmap::RequestAccessToGpuMemoryBuffer(
|
| + handle, client_id);
|
| + default:
|
| + return true;
|
| + }
|
| +}
|
| +
|
| +} // namespace content
|
|
|