OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 // Sets the size of the bucket. | 67 // Sets the size of the bucket. |
68 void SetSize(size_t size); | 68 void SetSize(size_t size); |
69 | 69 |
70 // Sets a part of the bucket. | 70 // Sets a part of the bucket. |
71 // Returns false if offset or size is out of range. | 71 // Returns false if offset or size is out of range. |
72 bool SetData(const void* src, size_t offset, size_t size); | 72 bool SetData(const void* src, size_t offset, size_t size); |
73 | 73 |
74 // Sets the bucket data from a string. Strings are passed NULL terminated to | 74 // Sets the bucket data from a string. Strings are passed NULL terminated to |
75 // distinguish between empty string and no string. | 75 // distinguish between empty string and no string. |
76 void SetFromString(const std::string& str); | 76 void SetFromString(const char* str); |
77 | 77 |
78 // Gets the bucket data as a string. Strings are passed NULL terminated to | 78 // Gets the bucket data as a string. Strings are passed NULL terminated to |
79 // distrinquish between empty string and no string. Returns False if there | 79 // distrinquish between empty string and no string. Returns False if there |
80 // is no string. | 80 // is no string. |
81 bool GetAsString(std::string* str); | 81 bool GetAsString(std::string* str); |
82 | 82 |
83 private: | 83 private: |
84 bool OffsetSizeValid(size_t offset, size_t size) const { | 84 bool OffsetSizeValid(size_t offset, size_t size) const { |
85 size_t temp = offset + size; | 85 size_t temp = offset + size; |
86 return temp <= size_ && temp >= offset; | 86 return temp <= size_ && temp >= offset; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 uint32 offset; | 174 uint32 offset; |
175 }; | 175 }; |
176 std::stack<CommandAddress> call_stack_; | 176 std::stack<CommandAddress> call_stack_; |
177 }; | 177 }; |
178 | 178 |
179 } // namespace gpu | 179 } // namespace gpu |
180 | 180 |
181 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_ | 181 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_ |
182 | 182 |
OLD | NEW |