| Index: content/browser/gpu/browser_gpu_memory_buffer_manager.cc
|
| diff --git a/content/browser/gpu/browser_gpu_memory_buffer_manager.cc b/content/browser/gpu/browser_gpu_memory_buffer_manager.cc
|
| index 189f0c5e57d08092a06d0cdbb9e705a285012e94..639e1cd23a94dbfb94be0b1d5de757744d9f678d 100644
|
| --- a/content/browser/gpu/browser_gpu_memory_buffer_manager.cc
|
| +++ b/content/browser/gpu/browser_gpu_memory_buffer_manager.cc
|
| @@ -29,6 +29,7 @@
|
|
|
| #if defined(OS_ANDROID)
|
| #include "content/common/gpu/gpu_memory_buffer_factory_surface_texture.h"
|
| +#include "ui/gl/android/surface_texture.h"
|
| #endif
|
|
|
| #if defined(USE_OZONE)
|
| @@ -124,6 +125,13 @@ GpuMemoryBufferConfigurationSet GetNativeGpuMemoryBufferConfigurations() {
|
| force_native_gpu_read_write_formats = false;
|
| }
|
|
|
| +#if defined(OS_ANDROID)
|
| + // Single buffer SurfaceTexture mode is required for native buffers on
|
| + // Android.
|
| + if (!gfx::SurfaceTexture::IsSingleBufferModeSupported())
|
| + enable_native_gpu_memory_buffers = false;
|
| +#endif
|
| +
|
| if (enable_native_gpu_memory_buffers) {
|
| const gfx::BufferFormat kNativeFormats[] = {
|
| gfx::BufferFormat::R_8, gfx::BufferFormat::RGBA_4444,
|
| @@ -233,16 +241,17 @@ uint32 BrowserGpuMemoryBufferManager::GetImageTextureTarget(
|
| }
|
|
|
| switch (GpuMemoryBufferFactory::GetNativeType()) {
|
| - case gfx::SURFACE_TEXTURE_BUFFER:
|
| case gfx::OZONE_NATIVE_PIXMAP:
|
| - // GPU memory buffers that are shared with the GL using EGLImages
|
| + // GPU memory buffers that are bound to GL textures using EGLImages
|
| // require TEXTURE_EXTERNAL_OES.
|
| return GL_TEXTURE_EXTERNAL_OES;
|
| case gfx::IO_SURFACE_BUFFER:
|
| // IOSurface backed images require GL_TEXTURE_RECTANGLE_ARB.
|
| return GL_TEXTURE_RECTANGLE_ARB;
|
| - case gfx::SHARED_MEMORY_BUFFER:
|
| + case gfx::SURFACE_TEXTURE_BUFFER:
|
| + // GPU memory buffers that require a copy expects GL_TEXTURE_2D as target.
|
| return GL_TEXTURE_2D;
|
| + case gfx::SHARED_MEMORY_BUFFER:
|
| case gfx::EMPTY_BUFFER:
|
| NOTREACHED();
|
| return GL_TEXTURE_2D;
|
|
|