| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // Utilties for GLES2 support. | 55 // Utilties for GLES2 support. |
| 56 class GLES2Util { | 56 class GLES2Util { |
| 57 public: | 57 public: |
| 58 static const int kNumFaces = 6; | 58 static const int kNumFaces = 6; |
| 59 | 59 |
| 60 struct EnumToString { | 60 struct EnumToString { |
| 61 uint32 value; | 61 uint32 value; |
| 62 const char* name; | 62 const char* name; |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 explicit GLES2Util( | 65 GLES2Util() |
| 66 int num_compressed_texture_formats) | 66 : num_compressed_texture_formats_(0), |
| 67 : num_compressed_texture_formats_(num_compressed_texture_formats) { | 67 num_shader_binary_formats_(0) { |
| 68 } |
| 69 |
| 70 int num_compressed_texture_formats() const { |
| 71 return num_compressed_texture_formats_; |
| 72 } |
| 73 |
| 74 void set_num_compressed_texture_formats(int num_compressed_texture_formats) { |
| 75 num_compressed_texture_formats_ = num_compressed_texture_formats; |
| 76 } |
| 77 |
| 78 int num_shader_binary_formats() const { |
| 79 return num_shader_binary_formats_; |
| 80 } |
| 81 |
| 82 void set_num_shader_binary_formats(int num_shader_binary_formats) { |
| 83 num_shader_binary_formats_ = num_shader_binary_formats; |
| 68 } | 84 } |
| 69 | 85 |
| 70 // Gets the number of values a particular id will return when a glGet | 86 // Gets the number of values a particular id will return when a glGet |
| 71 // function is called. If 0 is returned the id is invalid. | 87 // function is called. If 0 is returned the id is invalid. |
| 72 int GLGetNumValuesReturned(int id) const; | 88 int GLGetNumValuesReturned(int id) const; |
| 73 | 89 |
| 74 // Computes the size of image data for TexImage2D and TexSubImage2D. | 90 // Computes the size of image data for TexImage2D and TexSubImage2D. |
| 75 static bool ComputeImageDataSize( | 91 static bool ComputeImageDataSize( |
| 76 int width, int height, int format, int type, int unpack_alignment, | 92 int width, int height, int format, int type, int unpack_alignment, |
| 77 uint32* size); | 93 uint32* size); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 104 #include "../common/gles2_cmd_utils_autogen.h" | 120 #include "../common/gles2_cmd_utils_autogen.h" |
| 105 | 121 |
| 106 private: | 122 private: |
| 107 static std::string GetQualifiedEnumString( | 123 static std::string GetQualifiedEnumString( |
| 108 const EnumToString* table, size_t count, uint32 value); | 124 const EnumToString* table, size_t count, uint32 value); |
| 109 | 125 |
| 110 static const EnumToString* enum_to_string_table_; | 126 static const EnumToString* enum_to_string_table_; |
| 111 static const size_t enum_to_string_table_len_; | 127 static const size_t enum_to_string_table_len_; |
| 112 | 128 |
| 113 int num_compressed_texture_formats_; | 129 int num_compressed_texture_formats_; |
| 130 int num_shader_binary_formats_; |
| 114 }; | 131 }; |
| 115 | 132 |
| 116 } // namespace gles2 | 133 } // namespace gles2 |
| 117 } // namespace gpu | 134 } // namespace gpu |
| 118 | 135 |
| 119 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ | 136 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ |
| 120 | 137 |
| OLD | NEW |