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

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

Issue 1849313002: Pull gpu CmdBuf service/client shared GpuMemoryBuffer code to common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 4 years, 8 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 | « gpu/command_buffer/common/BUILD.gn ('k') | gpu/command_buffer/common/gpu_memory_buffer_support.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/common/gpu_memory_buffer_support.h
diff --git a/gpu/command_buffer/common/gpu_memory_buffer_support.h b/gpu/command_buffer/common/gpu_memory_buffer_support.h
new file mode 100644
index 0000000000000000000000000000000000000000..7539de3098ef15c41e7a4ac22440b66019f8b8e8
--- /dev/null
+++ b/gpu/command_buffer/common/gpu_memory_buffer_support.h
@@ -0,0 +1,39 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef GPU_COMMAND_BUFFER_COMMON_GPU_MEMORY_BUFFER_SUPPORT_H_
+#define GPU_COMMAND_BUFFER_COMMON_GPU_MEMORY_BUFFER_SUPPORT_H_
+
+#include "gpu/gpu_export.h"
+#include "ui/gfx/buffer_types.h"
+#include "ui/gfx/geometry/size.h"
+#include "ui/gfx/gpu_memory_buffer.h"
+
+namespace gpu {
+
+struct Capabilities;
+
+// Returns a valid GpuMemoryBuffer format given a valid internalformat as
+// defined by CHROMIUM_gpu_memory_buffer_image.
+GPU_EXPORT gfx::BufferFormat DefaultBufferFormatForImageFormat(
+ unsigned internalformat);
+
+// Returns true if |internalformat| is compatible with |format|.
+GPU_EXPORT bool IsImageFormatCompatibleWithGpuMemoryBufferFormat(
+ unsigned internalformat,
+ gfx::BufferFormat format);
+
+// Returns true if |format| is supported by |capabilities|.
+GPU_EXPORT bool IsGpuMemoryBufferFormatSupported(
+ gfx::BufferFormat format,
+ const Capabilities& capabilities);
+
+// Returns true if |size| is valid for |format|.
+GPU_EXPORT bool IsImageSizeValidForGpuMemoryBufferFormat(
+ const gfx::Size& size,
+ gfx::BufferFormat format);
+
+} // namespace gpu
+
+#endif // GPU_COMMAND_BUFFER_COMMON_GPU_MEMORY_BUFFER_SUPPORT_H_
« no previous file with comments | « gpu/command_buffer/common/BUILD.gn ('k') | gpu/command_buffer/common/gpu_memory_buffer_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698