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

Unified Diff: ui/gfx/buffer_types.h

Issue 2801683002: gfx: introduce GpuMemoryBufferAttrib to communicate format modifiers
Patch Set: purge enum BufferFormatModifier and use uint64_t modifiers Created 3 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 | « no previous file | ui/gfx/ipc/gfx_param_traits_macros.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/buffer_types.h
diff --git a/ui/gfx/buffer_types.h b/ui/gfx/buffer_types.h
index 179ee1941b42e828353daed7a90998d8fddd4e7e..d95c2a611b73dc91869871b427d8959c09efccdb 100644
--- a/ui/gfx/buffer_types.h
+++ b/ui/gfx/buffer_types.h
@@ -1,6 +1,8 @@
// Copyright 2015 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.
+#include <stdint.h>
+#include <vector>
#ifndef UI_GFX_BUFFER_TYPES_H_
#define UI_GFX_BUFFER_TYPES_H_
@@ -50,6 +52,25 @@ enum class BufferUsage {
LAST = GPU_READ_CPU_READ_WRITE_PERSISTENT
};
+struct GpuMemoryBufferAttrib {
+ GpuMemoryBufferAttrib(BufferFormat format, uint64_t modifier)
+ : format(format), modifier(modifier){};
+ GpuMemoryBufferAttrib(){};
+ ~GpuMemoryBufferAttrib(){};
+
+ bool operator<(GpuMemoryBufferAttrib const& rhs) const {
+ if (format == rhs.format)
+ return modifier < rhs.modifier;
+ else
+ return format < rhs.format;
+ }
+
+ BufferFormat format;
+ uint64_t modifier;
+};
+
+using GpuMemoryBufferAttribVector = std::vector<GpuMemoryBufferAttrib>;
+
} // namespace gfx
#endif // UI_GFX_BUFFER_TYPES_H_
« no previous file with comments | « no previous file | ui/gfx/ipc/gfx_param_traits_macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698