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

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

Issue 960873002: Update from https://crrev.com/318214 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 | « tools/valgrind/gtest_exclude/content_browsertests.gtest-drmemory.txt ('k') | ui/gl/BUILD.gn » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_GPU_MEMORY_BUFFER_H_ 5 #ifndef UI_GFX_GPU_MEMORY_BUFFER_H_
6 #define UI_GFX_GPU_MEMORY_BUFFER_H_ 6 #define UI_GFX_GPU_MEMORY_BUFFER_H_
7 7
8 #include "base/memory/shared_memory.h" 8 #include "base/memory/shared_memory.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "ui/gfx/gfx_export.h" 10 #include "ui/gfx/gfx_export.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #endif 49 #endif
50 }; 50 };
51 51
52 // This interface typically correspond to a type of shared memory that is also 52 // This interface typically correspond to a type of shared memory that is also
53 // shared with the GPU. A GPU memory buffer can be written to directly by 53 // shared with the GPU. A GPU memory buffer can be written to directly by
54 // regular CPU code, but can also be read by the GPU. 54 // regular CPU code, but can also be read by the GPU.
55 class GFX_EXPORT GpuMemoryBuffer { 55 class GFX_EXPORT GpuMemoryBuffer {
56 public: 56 public:
57 // The format needs to be taken into account when mapping a buffer into the 57 // The format needs to be taken into account when mapping a buffer into the
58 // client's address space. 58 // client's address space.
59 enum Format { RGBA_8888, RGBX_8888, BGRA_8888, FORMAT_LAST = BGRA_8888 }; 59 enum Format {
60 ATC,
61 ATCIA,
62 DXT1,
63 DXT5,
64 ETC1,
65 RGBA_8888,
66 RGBX_8888,
67 BGRA_8888,
68 FORMAT_LAST = BGRA_8888
69 };
60 70
61 // The usage mode affects how a buffer can be used. Only buffers created with 71 // The usage mode affects how a buffer can be used. Only buffers created with
62 // MAP can be mapped into the client's address space and accessed by the CPU. 72 // MAP can be mapped into the client's address space and accessed by the CPU.
63 enum Usage { MAP, SCANOUT, USAGE_LAST = SCANOUT }; 73 enum Usage { MAP, SCANOUT, USAGE_LAST = SCANOUT };
64 74
65 virtual ~GpuMemoryBuffer() {} 75 virtual ~GpuMemoryBuffer() {}
66 76
67 // Maps the buffer into the client's address space so it can be written to by 77 // Maps the buffer into the client's address space so it can be written to by
68 // the CPU. This call may block, for instance if the GPU needs to finish 78 // the CPU. This call may block, for instance if the GPU needs to finish
69 // accessing the buffer or if CPU caches need to be synchronized. Returns NULL 79 // accessing the buffer or if CPU caches need to be synchronized. Returns NULL
(...skipping 16 matching lines...) Expand all
86 // Returns a platform specific handle for this buffer. 96 // Returns a platform specific handle for this buffer.
87 virtual GpuMemoryBufferHandle GetHandle() const = 0; 97 virtual GpuMemoryBufferHandle GetHandle() const = 0;
88 98
89 // Type-checking downcast routine. 99 // Type-checking downcast routine.
90 virtual ClientBuffer AsClientBuffer() = 0; 100 virtual ClientBuffer AsClientBuffer() = 0;
91 }; 101 };
92 102
93 } // namespace gfx 103 } // namespace gfx
94 104
95 #endif // UI_GFX_GPU_MEMORY_BUFFER_H_ 105 #endif // UI_GFX_GPU_MEMORY_BUFFER_H_
OLDNEW
« no previous file with comments | « tools/valgrind/gtest_exclude/content_browsertests.gtest-drmemory.txt ('k') | ui/gl/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698