| 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 // This file is here so other GLES2 related files can have a common set of | 5 // This file is here so other GLES2 related files can have a common set of |
| 6 // includes where appropriate. | 6 // includes where appropriate. |
| 7 | 7 |
| 8 #ifndef GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ | 8 #ifndef GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ |
| 9 #define GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ | 9 #define GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ |
| 10 | 10 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 static uint32 GetChannelsNeededForAttachmentType(int type); | 139 static uint32 GetChannelsNeededForAttachmentType(int type); |
| 140 | 140 |
| 141 static bool IsNPOT(uint32 value) { | 141 static bool IsNPOT(uint32 value) { |
| 142 return value > 0 && (value & (value - 1)) != 0; | 142 return value > 0 && (value & (value - 1)) != 0; |
| 143 } | 143 } |
| 144 | 144 |
| 145 static std::string GetStringEnum(uint32 value); | 145 static std::string GetStringEnum(uint32 value); |
| 146 static std::string GetStringBool(uint32 value); | 146 static std::string GetStringBool(uint32 value); |
| 147 static std::string GetStringError(uint32 value); | 147 static std::string GetStringError(uint32 value); |
| 148 | 148 |
| 149 // Parses a uniform name. |
| 150 // array_pos: the position of the last '[' character in name. |
| 151 // element_index: the index of the array element specifed in the name. |
| 152 // getting_array: True if name refers to array. |
| 153 // returns true of parsing was successful. Returing true does NOT mean |
| 154 // it's a valid uniform name. On the otherhand, returning false does mean |
| 155 // it's an invalid uniform name. |
| 156 static bool ParseUniformName( |
| 157 const std::string& name, |
| 158 size_t* array_pos, |
| 159 int* element_index, |
| 160 bool* getting_array); |
| 161 |
| 149 #include "../common/gles2_cmd_utils_autogen.h" | 162 #include "../common/gles2_cmd_utils_autogen.h" |
| 150 | 163 |
| 151 private: | 164 private: |
| 152 static std::string GetQualifiedEnumString( | 165 static std::string GetQualifiedEnumString( |
| 153 const EnumToString* table, size_t count, uint32 value); | 166 const EnumToString* table, size_t count, uint32 value); |
| 154 | 167 |
| 155 static const EnumToString* enum_to_string_table_; | 168 static const EnumToString* enum_to_string_table_; |
| 156 static const size_t enum_to_string_table_len_; | 169 static const size_t enum_to_string_table_len_; |
| 157 | 170 |
| 158 int num_compressed_texture_formats_; | 171 int num_compressed_texture_formats_; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 176 bool buffer_preserved_; | 189 bool buffer_preserved_; |
| 177 bool share_resources_; | 190 bool share_resources_; |
| 178 bool bind_generates_resource_; | 191 bool bind_generates_resource_; |
| 179 }; | 192 }; |
| 180 | 193 |
| 181 } // namespace gles2 | 194 } // namespace gles2 |
| 182 } // namespace gpu | 195 } // namespace gpu |
| 183 | 196 |
| 184 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ | 197 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ |
| 185 | 198 |
| OLD | NEW |