OLD | NEW |
---|---|
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_SERVICE_COMMON_DECODER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <stack> | 9 #include <stack> |
10 #include <string> | 10 #include <string> |
11 #include "base/memory/linked_ptr.h" | 11 #include "base/memory/linked_ptr.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "gpu/command_buffer/common/buffer.h" | 13 #include "gpu/command_buffer/common/buffer.h" |
14 #include "gpu/command_buffer/service/cmd_parser.h" | 14 #include "gpu/command_buffer/service/cmd_parser.h" |
15 #include "gpu/gpu_export.h" | 15 #include "gpu/gpu_export.h" |
16 | 16 |
17 namespace gfx { | |
18 class GLImage; | |
19 } | |
20 | |
17 namespace gpu { | 21 namespace gpu { |
18 | 22 |
19 class CommandBufferEngine; | 23 class CommandBufferEngine; |
20 | 24 |
21 // This class is a helper base class for implementing the common parts of the | 25 // This class is a helper base class for implementing the common parts of the |
22 // o3d/gl2 command buffer decoder. | 26 // o3d/gl2 command buffer decoder. |
23 class GPU_EXPORT CommonDecoder : NON_EXPORTED_BASE(public AsyncAPIInterface) { | 27 class GPU_EXPORT CommonDecoder : NON_EXPORTED_BASE(public AsyncAPIInterface) { |
24 public: | 28 public: |
25 typedef error::Error Error; | 29 typedef error::Error Error; |
26 | 30 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
127 // Typed version of GetAddressAndCheckSize. | 131 // Typed version of GetAddressAndCheckSize. |
128 template <typename T> | 132 template <typename T> |
129 T GetSharedMemoryAs(unsigned int shm_id, unsigned int offset, | 133 T GetSharedMemoryAs(unsigned int shm_id, unsigned int offset, |
130 unsigned int size) { | 134 unsigned int size) { |
131 return static_cast<T>(GetAddressAndCheckSize(shm_id, offset, size)); | 135 return static_cast<T>(GetAddressAndCheckSize(shm_id, offset, size)); |
132 } | 136 } |
133 | 137 |
134 // Get the actual shared memory buffer. | 138 // Get the actual shared memory buffer. |
135 Buffer GetSharedMemoryBuffer(unsigned int shm_id); | 139 Buffer GetSharedMemoryBuffer(unsigned int shm_id); |
136 | 140 |
141 // Gets an image. Returns NULL if the image does not exist. | |
142 gfx::GLImage* GetImage(int32 image_id); | |
piman
2013/08/01 21:19:30
nit: I guess we try to keep CommonDecoder GL-agnos
reveman
2013/08/08 23:19:00
Removed this.
| |
143 | |
137 protected: | 144 protected: |
138 // Executes a common command. | 145 // Executes a common command. |
139 // Parameters: | 146 // Parameters: |
140 // command: the command index. | 147 // command: the command index. |
141 // arg_count: the number of CommandBufferEntry arguments. | 148 // arg_count: the number of CommandBufferEntry arguments. |
142 // cmd_data: the command data. | 149 // cmd_data: the command data. |
143 // Returns: | 150 // Returns: |
144 // error::kNoError if no error was found, one of | 151 // error::kNoError if no error was found, one of |
145 // error::Error otherwise. | 152 // error::Error otherwise. |
146 error::Error DoCommonCommand( | 153 error::Error DoCommonCommand( |
(...skipping 19 matching lines...) Expand all Loading... | |
166 CommandBufferEngine* engine_; | 173 CommandBufferEngine* engine_; |
167 | 174 |
168 typedef std::map<uint32, linked_ptr<Bucket> > BucketMap; | 175 typedef std::map<uint32, linked_ptr<Bucket> > BucketMap; |
169 BucketMap buckets_; | 176 BucketMap buckets_; |
170 }; | 177 }; |
171 | 178 |
172 } // namespace gpu | 179 } // namespace gpu |
173 | 180 |
174 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_ | 181 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_ |
175 | 182 |
OLD | NEW |