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

Unified Diff: gpu/ipc/common/gpu_memory_buffer_support.h

Issue 2649553003: gpu: merge gpu/ipc/host/gpu_memory_buffer_support.cc to gpu/ipc/common/
Patch Set: fix bot failure Created 3 years, 11 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: gpu/ipc/common/gpu_memory_buffer_support.h
diff --git a/gpu/ipc/common/gpu_memory_buffer_support.h b/gpu/ipc/common/gpu_memory_buffer_support.h
index 6c32f464503102bbf1d5e1d423d0ffc8399e7dee..06473f03f68e235b19672022c1f0266f170e6d01 100644
--- a/gpu/ipc/common/gpu_memory_buffer_support.h
+++ b/gpu/ipc/common/gpu_memory_buffer_support.h
@@ -5,12 +5,36 @@
#ifndef GPU_IPC_COMMON_GPU_MEMORY_BUFFER_SUPPORT_H_
#define GPU_IPC_COMMON_GPU_MEMORY_BUFFER_SUPPORT_H_
+#include "base/containers/hash_tables.h"
#include "gpu/gpu_export.h"
#include "ui/gfx/buffer_types.h"
#include "ui/gfx/gpu_memory_buffer.h"
namespace gpu {
+using GpuMemoryBufferConfigurationKey =
+ std::pair<gfx::BufferFormat, gfx::BufferUsage>;
+using GpuMemoryBufferConfigurationSet =
+ base::hash_set<GpuMemoryBufferConfigurationKey>;
+
+} // namespace gpu
+
+namespace BASE_HASH_NAMESPACE {
+
+template <>
+struct hash<gpu::GpuMemoryBufferConfigurationKey> {
+ size_t operator()(const gpu::GpuMemoryBufferConfigurationKey& key) const {
+ return base::HashInts(static_cast<int>(key.first),
+ static_cast<int>(key.second));
+ }
+};
+
+} // namespace BASE_HASH_NAMESPACE
+
+namespace gpu {
+
+GPU_EXPORT bool AreNativeGpuMemoryBuffersEnabled();
+
// Returns the native GPU memory buffer factory type. Returns EMPTY_BUFFER
// type if native buffers are not supported.
GPU_EXPORT gfx::GpuMemoryBufferType GetNativeGpuMemoryBufferType();
@@ -20,6 +44,14 @@ GPU_EXPORT bool IsNativeGpuMemoryBufferConfigurationSupported(
gfx::BufferFormat format,
gfx::BufferUsage usage);
+// Returns the set of supported configurations.
+GPU_EXPORT GpuMemoryBufferConfigurationSet
+GetNativeGpuMemoryBufferConfigurations();
+
+// Returns the OpenGL target to use for image textures.
+GPU_EXPORT uint32_t GetImageTextureTarget(gfx::BufferFormat format,
+ gfx::BufferUsage usage);
+
} // namespace gpu
#endif // GPU_IPC_COMMON_GPU_MEMORY_BUFFER_SUPPORT_H_

Powered by Google App Engine
This is Rietveld 408576698