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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/gfx/ipc/gfx_param_traits_macros.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 #include <stdint.h>
5 #include <vector>
4 6
5 #ifndef UI_GFX_BUFFER_TYPES_H_ 7 #ifndef UI_GFX_BUFFER_TYPES_H_
6 #define UI_GFX_BUFFER_TYPES_H_ 8 #define UI_GFX_BUFFER_TYPES_H_
7 9
8 namespace gfx { 10 namespace gfx {
9 11
10 // The format needs to be taken into account when mapping a buffer into the 12 // The format needs to be taken into account when mapping a buffer into the
11 // client's address space. 13 // client's address space.
12 enum class BufferFormat { 14 enum class BufferFormat {
13 ATC, 15 ATC,
(...skipping 29 matching lines...) Expand all
43 SCANOUT, 45 SCANOUT,
44 SCANOUT_CPU_READ_WRITE, 46 SCANOUT_CPU_READ_WRITE,
45 GPU_READ_CPU_READ_WRITE, 47 GPU_READ_CPU_READ_WRITE,
46 // TODO(reveman): Merge this with GPU_READ_CPU_READ_WRITE when SurfaceTexture 48 // TODO(reveman): Merge this with GPU_READ_CPU_READ_WRITE when SurfaceTexture
47 // backed buffers are single buffered and support it. 49 // backed buffers are single buffered and support it.
48 GPU_READ_CPU_READ_WRITE_PERSISTENT, 50 GPU_READ_CPU_READ_WRITE_PERSISTENT,
49 51
50 LAST = GPU_READ_CPU_READ_WRITE_PERSISTENT 52 LAST = GPU_READ_CPU_READ_WRITE_PERSISTENT
51 }; 53 };
52 54
55 struct GpuMemoryBufferAttrib {
56 GpuMemoryBufferAttrib(BufferFormat format, uint64_t modifier)
57 : format(format), modifier(modifier){};
58 GpuMemoryBufferAttrib(){};
59 ~GpuMemoryBufferAttrib(){};
60
61 bool operator<(GpuMemoryBufferAttrib const& rhs) const {
62 if (format == rhs.format)
63 return modifier < rhs.modifier;
64 else
65 return format < rhs.format;
66 }
67
68 BufferFormat format;
69 uint64_t modifier;
70 };
71
72 using GpuMemoryBufferAttribVector = std::vector<GpuMemoryBufferAttrib>;
73
53 } // namespace gfx 74 } // namespace gfx
54 75
55 #endif // UI_GFX_BUFFER_TYPES_H_ 76 #endif // UI_GFX_BUFFER_TYPES_H_
OLDNEW
« 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