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

Side by Side Diff: gpu/command_buffer/common/command_buffer.h

Issue 20017005: gpu: Refactor GpuMemoryBuffer framework for multi-process support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_ 5 #ifndef GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_
6 #define GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_ 6 #define GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_
7 7
8 #include "gpu/command_buffer/common/buffer.h" 8 #include "gpu/command_buffer/common/buffer.h"
9 #include "gpu/command_buffer/common/constants.h" 9 #include "gpu/command_buffer/common/constants.h"
10 #include "gpu/gpu_export.h" 10 #include "gpu/gpu_export.h"
11 11
12 namespace base { 12 namespace base {
13 class SharedMemory; 13 class SharedMemory;
14 } 14 }
15 15
16 namespace gfx {
17 class GpuMemoryBuffer;
18 }
19
16 namespace gpu { 20 namespace gpu {
17 21
18 // Common interface for CommandBuffer implementations. 22 // Common interface for CommandBuffer implementations.
19 class GPU_EXPORT CommandBuffer { 23 class GPU_EXPORT CommandBuffer {
20 public: 24 public:
21 struct State { 25 struct State {
22 State() 26 State()
23 : num_entries(0), 27 : num_entries(0),
24 get_offset(0), 28 get_offset(0),
25 put_offset(0), 29 put_offset(0),
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 // RendererGLContext::MakeCurrent prior to every GL call. It saves returning 6 138 // RendererGLContext::MakeCurrent prior to every GL call. It saves returning 6
135 // ints redundantly when only the error is needed for the CommandBufferProxy 139 // ints redundantly when only the error is needed for the CommandBufferProxy
136 // implementation. 140 // implementation.
137 virtual error::Error GetLastError(); 141 virtual error::Error GetLastError();
138 #endif 142 #endif
139 143
140 // Inserts a sync point, returning its ID. Sync point IDs are global and can 144 // Inserts a sync point, returning its ID. Sync point IDs are global and can
141 // be used for cross-context synchronization. 145 // be used for cross-context synchronization.
142 virtual uint32 InsertSyncPoint() = 0; 146 virtual uint32 InsertSyncPoint() = 0;
143 147
148 // Create a gpu memory buffer of the given dimensions and format. Returns
149 // its ID or -1 on error.
150 virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer(
151 size_t width,
152 size_t height,
153 unsigned internalformat,
154 int32* id) = 0;
155
156 // Destroy a gpu memory buffer. The ID must be positive.
157 virtual void DestroyGpuMemoryBuffer(int32 id) = 0;
158
144 private: 159 private:
145 DISALLOW_COPY_AND_ASSIGN(CommandBuffer); 160 DISALLOW_COPY_AND_ASSIGN(CommandBuffer);
146 }; 161 };
147 162
148 } // namespace gpu 163 } // namespace gpu
149 164
150 #endif // GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_ 165 #endif // GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698