| OLD | NEW |
| 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 Loading... |
| 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_ |
| OLD | NEW |