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

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: Include proper internalformat support.[D Created 7 years, 4 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 GLImage;
18 class GpuMemoryBuffer;
19 }
20
16 namespace gpu { 21 namespace gpu {
17 22
18 // Common interface for CommandBuffer implementations. 23 // Common interface for CommandBuffer implementations.
19 class GPU_EXPORT CommandBuffer { 24 class GPU_EXPORT CommandBuffer {
20 public: 25 public:
21 struct State { 26 struct State {
22 State() 27 State()
23 : num_entries(0), 28 : num_entries(0),
24 get_offset(0), 29 get_offset(0),
25 put_offset(0), 30 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 139 // RendererGLContext::MakeCurrent prior to every GL call. It saves returning 6
135 // ints redundantly when only the error is needed for the CommandBufferProxy 140 // ints redundantly when only the error is needed for the CommandBufferProxy
136 // implementation. 141 // implementation.
137 virtual error::Error GetLastError(); 142 virtual error::Error GetLastError();
138 #endif 143 #endif
139 144
140 // Inserts a sync point, returning its ID. Sync point IDs are global and can 145 // Inserts a sync point, returning its ID. Sync point IDs are global and can
141 // be used for cross-context synchronization. 146 // be used for cross-context synchronization.
142 virtual uint32 InsertSyncPoint() = 0; 147 virtual uint32 InsertSyncPoint() = 0;
143 148
149 // Create a gpu memory buffer of the given dimensions and format. Returns
kaanb 2013/07/31 23:44:05 optional: I prefer using third-person in comments,
reveman 2013/08/01 13:32:18 I prefer to keep it consistent with CreateTransfer
150 // its ID or -1 on error.
151 virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer(
piman 2013/08/01 21:19:30 I would prefer if we didn't load up CommandBuffer
no sievers 2013/08/01 21:30:04 Or can it just go through GpuCommandBufferStub? We
reveman 2013/08/08 23:19:00 I've limited the CommandBuffer changes to adding C
152 size_t width,
153 size_t height,
154 unsigned internalformat,
155 int32* id) = 0;
156
157 // Destroy a gpu memory buffer. The ID must be positive.
158 virtual void DestroyGpuMemoryBuffer(int32 id) = 0;
159
160 // Get the image associated with an ID. Returns a null image for ID 0.
161 virtual gfx::GLImage* GetImage(int32 id) = 0;
162
144 private: 163 private:
145 DISALLOW_COPY_AND_ASSIGN(CommandBuffer); 164 DISALLOW_COPY_AND_ASSIGN(CommandBuffer);
146 }; 165 };
147 166
148 } // namespace gpu 167 } // namespace gpu
149 168
150 #endif // GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_ 169 #endif // GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698