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

Unified Diff: content/common/gpu/gpu_memory_buffer_factory.cc

Issue 1389133002: content: Use type-parameterized tests for GpuMemoryBuffer implementations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months 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
Index: content/common/gpu/gpu_memory_buffer_factory.cc
diff --git a/content/common/gpu/gpu_memory_buffer_factory.cc b/content/common/gpu/gpu_memory_buffer_factory.cc
index 2c5bd395c59e2a0610cdd37644bc1361ce56b747..d82f1cb65fdae387f0a6a1ebfe326442f1a51985 100644
--- a/content/common/gpu/gpu_memory_buffer_factory.cc
+++ b/content/common/gpu/gpu_memory_buffer_factory.cc
@@ -5,7 +5,6 @@
#include "content/common/gpu/gpu_memory_buffer_factory.h"
#include "base/logging.h"
-#include "content/common/gpu/gpu_memory_buffer_factory_shared_memory.h"
#if defined(OS_MACOSX)
#include "content/common/gpu/gpu_memory_buffer_factory_io_surface.h"
@@ -22,29 +21,23 @@
namespace content {
// static
-void GpuMemoryBufferFactory::GetSupportedTypes(
- std::vector<gfx::GpuMemoryBufferType>* types) {
- const gfx::GpuMemoryBufferType supported_types[] = {
+gfx::GpuMemoryBufferType GpuMemoryBufferFactory::GetNativeType() {
#if defined(OS_MACOSX)
- gfx::IO_SURFACE_BUFFER,
+ return gfx::IO_SURFACE_BUFFER;
#endif
#if defined(OS_ANDROID)
- gfx::SURFACE_TEXTURE_BUFFER,
+ return gfx::SURFACE_TEXTURE_BUFFER;
#endif
#if defined(USE_OZONE)
- gfx::OZONE_NATIVE_PIXMAP,
+ return gfx::OZONE_NATIVE_PIXMAP;
#endif
- gfx::SHARED_MEMORY_BUFFER
- };
- types->assign(supported_types, supported_types + arraysize(supported_types));
+ return gfx::EMPTY_BUFFER;
}
// static
scoped_ptr<GpuMemoryBufferFactory> GpuMemoryBufferFactory::Create(
gfx::GpuMemoryBufferType type) {
switch (type) {
- case gfx::SHARED_MEMORY_BUFFER:
- return make_scoped_ptr(new GpuMemoryBufferFactorySharedMemory);
#if defined(OS_MACOSX)
case gfx::IO_SURFACE_BUFFER:
return make_scoped_ptr(new GpuMemoryBufferFactoryIOSurface);
@@ -59,7 +52,7 @@ scoped_ptr<GpuMemoryBufferFactory> GpuMemoryBufferFactory::Create(
#endif
default:
NOTREACHED();
- return scoped_ptr<GpuMemoryBufferFactory>();
+ return nullptr;
}
}

Powered by Google App Engine
This is Rietveld 408576698