| 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> |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // Gets a pointer to a section the bucket. Returns NULL if offset or size is | 60 // Gets a pointer to a section the bucket. Returns NULL if offset or size is |
| 61 // out of range. | 61 // out of range. |
| 62 void* GetData(size_t offset, size_t size) const; | 62 void* GetData(size_t offset, size_t size) const; |
| 63 | 63 |
| 64 template <typename T> | 64 template <typename T> |
| 65 T GetDataAs(size_t offset, size_t size) const { | 65 T GetDataAs(size_t offset, size_t size) const { |
| 66 return reinterpret_cast<T>(GetData(offset, size)); | 66 return reinterpret_cast<T>(GetData(offset, size)); |
| 67 } | 67 } |
| 68 | 68 |
| 69 // Sets the size of the bucket. | 69 // Sets the size of the bucket. |
| 70 bool SetSize(size_t size); | 70 void SetSize(size_t size); |
| 71 | 71 |
| 72 // Sets a part of the bucket. | 72 // Sets a part of the bucket. |
| 73 // Returns false if offset or size is out of range. | 73 // Returns false if offset or size is out of range. |
| 74 bool SetData(const void* src, size_t offset, size_t size); | 74 bool SetData(const void* src, size_t offset, size_t size); |
| 75 | 75 |
| 76 // Sets the bucket data from a string. Strings are passed NULL terminated to | 76 // Sets the bucket data from a string. Strings are passed NULL terminated to |
| 77 // distinguish between empty string and no string. | 77 // distinguish between empty string and no string. |
| 78 void SetFromString(const char* str); | 78 void SetFromString(const char* str); |
| 79 | 79 |
| 80 // Gets the bucket data as a string. Strings are passed NULL terminated to | 80 // Gets the bucket data as a string. Strings are passed NULL terminated to |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 CommandBufferEngine* engine_; | 166 CommandBufferEngine* engine_; |
| 167 | 167 |
| 168 typedef std::map<uint32, linked_ptr<Bucket> > BucketMap; | 168 typedef std::map<uint32, linked_ptr<Bucket> > BucketMap; |
| 169 BucketMap buckets_; | 169 BucketMap buckets_; |
| 170 }; | 170 }; |
| 171 | 171 |
| 172 } // namespace gpu | 172 } // namespace gpu |
| 173 | 173 |
| 174 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_ | 174 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_ |
| 175 | 175 |
| OLD | NEW |