Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1489)

Unified Diff: content/browser/gpu/browser_gpu_memory_buffer_manager.cc

Issue 1419623008: ui: Use single buffer SurfaceTexture mode for native GpuMemoryBuffers on Android. Base URL: https://chromium.googlesource.com/chromium/src.git@1419733005
Patch Set: libs = [] Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/common/gpu/gpu_memory_buffer_factory_surface_texture.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b4b474e4d484d111461d3725380902b76ed455c1..bc0d534dfa9645ca59b6eec954deb9ca33c00564 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)
@@ -216,6 +217,13 @@ bool BrowserGpuMemoryBufferManager::IsNativeGpuMemoryBuffersEnabled() {
return false;
}
+#if defined(OS_ANDROID)
+ // Single buffer SurfaceTexture mode is required for native buffers on
+ // Android.
+ if (!gfx::SurfaceTexture::IsSingleBufferModeSupported())
+ return false;
+#endif
+
#if defined(OS_MACOSX)
return !base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableNativeGpuMemoryBuffers);
@@ -237,16 +245,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;
« no previous file with comments | « no previous file | content/common/gpu/gpu_memory_buffer_factory_surface_texture.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698