diff options
author | fsamuel <fsamuel@chromium.org> | 2016-03-23 17:27:12 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-24 00:28:29 +0000 |
commit | c27742238e78f1e2f7f6fe37f101eb0d07483416 (patch) | |
tree | e15a09d867f489fc54367b3bbfa5d04432b395b6 /content/browser | |
parent | 26befa044b2ce9ed1b5dfd83eb5a67d1a964bb8c (diff) | |
download | chromium_src-c27742238e78f1e2f7f6fe37f101eb0d07483416.zip chromium_src-c27742238e78f1e2f7f6fe37f101eb0d07483416.tar.gz chromium_src-c27742238e78f1e2f7f6fe37f101eb0d07483416.tar.bz2 |
Pull gpu service/client shared memory buffer code to GpuMemoryBufferSupport
GpuMemoryBufferFactory is a gpu service concept and should
not be accessed from the client.
Client code accessed GpuMemoryBufferFactory to get the
native GPU buffer type and to check whether a provided
buffer is supported. Depending on GpuMemoryBufferFactory
ends up pulling in other service-only bits.
This CL addresses this issue. The two static methods
accessed by clients are pulled into a new class:
GpuMemoryBufferSupport placed in gpu/ipc/common.
BUG=597170
CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel
Review URL: https://codereview.chromium.org/1831513003
Cr-Commit-Position: refs/heads/master@{#382987}
Diffstat (limited to 'content/browser')
-rw-r--r-- | content/browser/gpu/browser_gpu_memory_buffer_manager.cc | 33 |
1 files changed, 5 insertions, 28 deletions
diff --git a/content/browser/gpu/browser_gpu_memory_buffer_manager.cc b/content/browser/gpu/browser_gpu_memory_buffer_manager.cc index d9c25c9..c1e3d4e 100644 --- a/content/browser/gpu/browser_gpu_memory_buffer_manager.cc +++ b/content/browser/gpu/browser_gpu_memory_buffer_manager.cc @@ -19,25 +19,13 @@ #include "content/common/generic_shared_memory_id_generator.h" #include "content/common/gpu/client/gpu_memory_buffer_impl.h" #include "content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h" -#include "content/common/gpu/gpu_memory_buffer_factory.h" #include "content/public/browser/browser_thread.h" #include "content/public/common/content_switches.h" #include "gpu/GLES2/gl2extchromium.h" +#include "gpu/ipc/common/gpu_memory_buffer_support.h" #include "ui/gfx/buffer_format_util.h" #include "ui/gl/gl_switches.h" -#if defined(OS_MACOSX) -#include "content/common/gpu/gpu_memory_buffer_factory_io_surface.h" -#endif - -#if defined(OS_ANDROID) -#include "content/common/gpu/gpu_memory_buffer_factory_surface_texture.h" -#endif - -#if defined(USE_OZONE) -#include "content/common/gpu/gpu_memory_buffer_factory_ozone_native_pixmap.h" -#endif - namespace content { namespace { @@ -78,24 +66,13 @@ void GpuMemoryBufferDeleted( bool IsNativeGpuMemoryBufferFactoryConfigurationSupported( gfx::BufferFormat format, gfx::BufferUsage usage) { - switch (GpuMemoryBufferFactory::GetNativeType()) { + switch (gpu::GetNativeGpuMemoryBufferType()) { case gfx::SHARED_MEMORY_BUFFER: return false; -#if defined(OS_MACOSX) case gfx::IO_SURFACE_BUFFER: - return GpuMemoryBufferFactoryIOSurface:: - IsGpuMemoryBufferConfigurationSupported(format, usage); -#endif -#if defined(OS_ANDROID) case gfx::SURFACE_TEXTURE_BUFFER: - return GpuMemoryBufferFactorySurfaceTexture:: - IsGpuMemoryBufferConfigurationSupported(format, usage); -#endif -#if defined(USE_OZONE) case gfx::OZONE_NATIVE_PIXMAP: - return GpuMemoryBufferFactoryOzoneNativePixmap:: - IsGpuMemoryBufferConfigurationSupported(format, usage); -#endif + return gpu::IsNativeGpuMemoryBufferConfigurationSupported(format, usage); default: NOTREACHED(); return false; @@ -239,7 +216,7 @@ uint32_t BrowserGpuMemoryBufferManager::GetImageTextureTarget( return GL_TEXTURE_2D; } - switch (GpuMemoryBufferFactory::GetNativeType()) { + switch (gpu::GetNativeGpuMemoryBufferType()) { case gfx::SURFACE_TEXTURE_BUFFER: case gfx::OZONE_NATIVE_PIXMAP: // GPU memory buffers that are shared with the GL using EGLImages @@ -517,7 +494,7 @@ void BrowserGpuMemoryBufferManager::HandleCreateGpuMemoryBufferFromHandleOnIO( // Use service side allocation for native types. if (request->handle.type != gfx::SHARED_MEMORY_BUFFER) { // Early out if service side allocation is not supported. - if (request->handle.type != GpuMemoryBufferFactory::GetNativeType() || + if (request->handle.type != gpu::GetNativeGpuMemoryBufferType() || !IsNativeGpuMemoryBufferConfiguration(request->format, request->usage)) { request->event.Signal(); |