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

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

Issue 1389133002: content: Use type-parameterized tests for GpuMemoryBuffer implementations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add blankline 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
« no previous file with comments | « no previous file | content/browser/gpu/browser_gpu_memory_buffer_manager.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.h
diff --git a/content/browser/gpu/browser_gpu_memory_buffer_manager.h b/content/browser/gpu/browser_gpu_memory_buffer_manager.h
index 12fd082975a2c4672bdc262dde2c593f967017bb..4c275056e580bcd467c2d3d7ad58852dbf20df6c 100644
--- a/content/browser/gpu/browser_gpu_memory_buffer_manager.h
+++ b/content/browser/gpu/browser_gpu_memory_buffer_manager.h
@@ -5,16 +5,37 @@
#ifndef CONTENT_BROWSER_GPU_BROWSER_GPU_MEMORY_BUFFER_MANAGER_H_
#define CONTENT_BROWSER_GPU_BROWSER_GPU_MEMORY_BUFFER_MANAGER_H_
-#include <vector>
+#include <utility>
#include "base/callback.h"
+#include "base/containers/hash_tables.h"
#include "base/trace_event/memory_dump_provider.h"
#include "content/common/content_export.h"
-#include "content/common/gpu/gpu_memory_buffer_factory.h"
#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
namespace content {
+using GpuMemoryBufferConfigurationKey =
+ std::pair<gfx::BufferFormat, gfx::BufferUsage>;
+using GpuMemoryBufferConfigurationSet =
+ base::hash_set<GpuMemoryBufferConfigurationKey>;
+
+} // content
+
+namespace BASE_HASH_NAMESPACE {
+
+template <>
+struct hash<content::GpuMemoryBufferConfigurationKey> {
+ size_t operator()(const content::GpuMemoryBufferConfigurationKey& key) const {
+ return base::HashPair(static_cast<int>(key.first),
+ static_cast<int>(key.second));
+ }
+};
+
+} // namespace BASE_HASH_NAMESPACE
+
+namespace content {
+
class CONTENT_EXPORT BrowserGpuMemoryBufferManager
: public gpu::GpuMemoryBufferManager,
public base::trace_event::MemoryDumpProvider {
@@ -97,8 +118,8 @@ class CONTENT_EXPORT BrowserGpuMemoryBufferManager
gfx::BufferFormat format,
gfx::BufferUsage usage,
int32 surface_id);
- bool IsGpuMemoryBufferConfigurationSupported(gfx::BufferFormat format,
- gfx::BufferUsage usage) const;
+ bool IsNativeGpuMemoryBufferConfiguration(gfx::BufferFormat format,
+ gfx::BufferUsage usage) const;
void AllocateGpuMemoryBufferForSurfaceOnIO(
AllocateGpuMemoryBufferRequest* request);
void GpuMemoryBufferAllocatedForSurfaceOnIO(
@@ -125,9 +146,7 @@ class CONTENT_EXPORT BrowserGpuMemoryBufferManager
uint64_t ClientIdToTracingProcessId(int client_id) const;
- const gfx::GpuMemoryBufferType factory_type_;
- const std::vector<GpuMemoryBufferFactory::Configuration>
- supported_configurations_;
+ const GpuMemoryBufferConfigurationSet native_configurations_;
const int gpu_client_id_;
const uint64_t gpu_client_tracing_id_;
« no previous file with comments | « no previous file | content/browser/gpu/browser_gpu_memory_buffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698