| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-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 // 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 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "gpu/command_buffer/common/types.h" | 12 #include "gpu/command_buffer/common/types.h" |
| 13 | 13 |
| 14 namespace command_buffer { | 14 namespace gpu { |
| 15 namespace gles2 { | 15 namespace gles2 { |
| 16 | 16 |
| 17 // Utilties for GLES2 support. | 17 // Utilties for GLES2 support. |
| 18 class GLES2Util { | 18 class GLES2Util { |
| 19 public: | 19 public: |
| 20 explicit GLES2Util( | 20 explicit GLES2Util( |
| 21 int num_compressed_texture_formats) | 21 int num_compressed_texture_formats) |
| 22 : num_compressed_texture_formats_(num_compressed_texture_formats) { | 22 : num_compressed_texture_formats_(num_compressed_texture_formats) { |
| 23 } | 23 } |
| 24 | 24 |
| 25 // Gets the number of values a particular id will return when a glGet | 25 // Gets the number of values a particular id will return when a glGet |
| 26 // function is called. If 0 is returned the id is invalid. | 26 // function is called. If 0 is returned the id is invalid. |
| 27 int GLGetNumValuesReturned(int id) const; | 27 int GLGetNumValuesReturned(int id) const; |
| 28 | 28 |
| 29 // Computes the size of image data for TexImage2D and TexSubImage2D. | 29 // Computes the size of image data for TexImage2D and TexSubImage2D. |
| 30 static uint32 ComputeImageDataSize( | 30 static uint32 ComputeImageDataSize( |
| 31 int width, int height, int format, int type, int unpack_alignment); | 31 int width, int height, int format, int type, int unpack_alignment); |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 int num_compressed_texture_formats_; | 34 int num_compressed_texture_formats_; |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 } // namespace gles2 | 37 } // namespace gles2 |
| 38 } // namespace command_buffer | 38 } // namespace gpu |
| 39 | 39 |
| 40 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H | 40 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ |
| 41 | 41 |
| OLD | NEW |