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

Side by Side Diff: ui/gfx/buffer_types.h

Issue 1375663002: Show GpuMemoryBuffer feature in chrome://gpu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: display a matrix of formats and usages Created 5 years, 2 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 | « content/browser/resources/gpu/info_view.js ('k') | no next file » | 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 4
5 #ifndef UI_GFX_BUFFER_TYPES_H_ 5 #ifndef UI_GFX_BUFFER_TYPES_H_
6 #define UI_GFX_BUFFER_TYPES_H_ 6 #define UI_GFX_BUFFER_TYPES_H_
7 7
8 namespace gfx { 8 namespace gfx {
9 9
10 // The format needs to be taken into account when mapping a buffer into the 10 // The format needs to be taken into account when mapping a buffer into the
(...skipping 16 matching lines...) Expand all
27 LAST = UYVY_422 27 LAST = UYVY_422
28 }; 28 };
29 29
30 // The usage mode affects how a buffer can be used. Only buffers created with 30 // The usage mode affects how a buffer can be used. Only buffers created with
31 // MAP can be mapped into the client's address space and accessed by the CPU. 31 // MAP can be mapped into the client's address space and accessed by the CPU.
32 // PERSISTENT_MAP adds the additional condition that successive Map() calls 32 // PERSISTENT_MAP adds the additional condition that successive Map() calls
33 // (with Unmap() calls between) will return a pointer to the same memory 33 // (with Unmap() calls between) will return a pointer to the same memory
34 // contents. 34 // contents.
35 enum class BufferUsage { MAP, PERSISTENT_MAP, SCANOUT, LAST = SCANOUT }; 35 enum class BufferUsage { MAP, PERSISTENT_MAP, SCANOUT, LAST = SCANOUT };
36 36
37 inline const char* BufferFormatToString(BufferFormat format) {
38 switch (format) {
39 case BufferFormat::ATC: return "ATC";
40 case BufferFormat::ATCIA: return "ATCIA";
41 case BufferFormat::DXT1: return "DXT1";
42 case BufferFormat::DXT5: return "DXT5";
43 case BufferFormat::ETC1: return "ETC1";
44 case BufferFormat::R_8: return "R_8";
45 case BufferFormat::RGBA_4444: return "RGBA_4444";
46 case BufferFormat::RGBA_8888: return "RGBA_8888";
47 case BufferFormat::BGRX_8888: return "BGRX_8888";
48 case BufferFormat::BGRA_8888: return "BGRA_8888";
49 case BufferFormat::YUV_420: return "YUV_420";
50 case BufferFormat::YUV_420_BIPLANAR: return "YUV_420_BIPLANAR";
51 case BufferFormat::UYVY_422: return "UYVY_422";
52 }
53 }
54
55 inline const char* BufferUsageToString(BufferUsage usage) {
56 switch (usage) {
57 case BufferUsage::MAP: return "MAP";
58 case BufferUsage::PERSISTENT_MAP: return "PERSISTENT_MAP";
59 case BufferUsage::SCANOUT: return "SCANOUT";
60 }
61 }
62
vignatti (out of this project) 2015/10/26 20:55:49 reveman@ do you think it's worth doing this global
reveman 2015/10/26 21:09:20 I'd keep it local for now and we can move it hear
37 } // namespace gfx 63 } // namespace gfx
38 64
39 #endif // UI_GFX_BUFFER_TYPES_H_ 65 #endif // UI_GFX_BUFFER_TYPES_H_
OLDNEW
« no previous file with comments | « content/browser/resources/gpu/info_view.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698