| 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 "base/memory/weak_ptr.h" |
| 13 #include "gpu/command_buffer/service/cmd_parser.h" | 14 #include "gpu/command_buffer/service/cmd_parser.h" |
| 14 #include "gpu/gpu_export.h" | 15 #include "gpu/gpu_export.h" |
| 15 | 16 |
| 16 namespace gpu { | 17 namespace gpu { |
| 17 | 18 |
| 18 class CommandBufferEngine; | 19 class CommandBufferEngine; |
| 19 | 20 |
| 20 // This class is a helper base class for implementing the common parts of the | 21 // This class is a helper base class for implementing the common parts of the |
| 21 // o3d/gl2 command buffer decoder. | 22 // o3d/gl2 command buffer decoder. |
| 22 class GPU_EXPORT CommonDecoder : NON_EXPORTED_BASE(public AsyncAPIInterface) { | 23 class GPU_EXPORT CommonDecoder : public base::SupportsWeakPtr<CommonDecoder>, |
| 24 NON_EXPORTED_BASE(public AsyncAPIInterface) { |
| 23 public: | 25 public: |
| 24 typedef error::Error Error; | 26 typedef error::Error Error; |
| 25 | 27 |
| 26 static const unsigned int kMaxStackDepth = 32; | 28 static const unsigned int kMaxStackDepth = 32; |
| 27 | 29 |
| 28 // A bucket is a buffer to help collect memory across a command buffer. When | 30 // A bucket is a buffer to help collect memory across a command buffer. When |
| 29 // creating a command buffer implementation of an existing API, sometimes that | 31 // creating a command buffer implementation of an existing API, sometimes that |
| 30 // API has functions that take a pointer to data. A good example is OpenGL's | 32 // API has functions that take a pointer to data. A good example is OpenGL's |
| 31 // glBufferData. Because the data is separated between client and service, | 33 // glBufferData. Because the data is separated between client and service, |
| 32 // there are 2 ways to get this data across. 1 is to put all the data in | 34 // there are 2 ways to get this data across. 1 is to put all the data in |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 176 |
| 175 uint32 offset; | 177 uint32 offset; |
| 176 }; | 178 }; |
| 177 std::stack<CommandAddress> call_stack_; | 179 std::stack<CommandAddress> call_stack_; |
| 178 }; | 180 }; |
| 179 | 181 |
| 180 } // namespace gpu | 182 } // namespace gpu |
| 181 | 183 |
| 182 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_ | 184 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_ |
| 183 | 185 |
| OLD | NEW |