#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <GLES2/gl2extchromium.h>
#include <GLES3/gl3.h>
#include <GLES3/gl31.h>
#include <sstream>
#include "base/check_op.h"
#include "base/notreached.h"
#include "base/numerics/safe_math.h"
#include "ui/gl/gl_enums.h"
namespace gpu {
namespace gles2 {
namespace gl_error_bit {
enum GLErrorBit { … };
}
int GLES2Util::GLGetNumValuesReturned(int id) const { … }
namespace {
uint32_t BytesPerElement(int type) { … }
}
uint32_t GLES2Util::ElementsPerGroup(int format, int type) { … }
uint32_t GLES2Util::ComputeImageGroupSize(int format, int type) { … }
bool GLES2Util::ComputeImageRowSizeHelper(int width,
uint32_t bytes_per_group,
int alignment,
uint32_t* rt_unpadded_row_size,
uint32_t* rt_padded_row_size,
uint32_t* rt_padding) { … }
bool GLES2Util::ComputeImagePaddedRowSize(int width,
int format,
int type,
int alignment,
uint32_t* padded_row_size) { … }
bool GLES2Util::ComputeImageDataSizes(int width,
int height,
int depth,
int format,
int type,
int alignment,
uint32_t* size,
uint32_t* opt_unpadded_row_size,
uint32_t* opt_padded_row_size) { … }
bool GLES2Util::ComputeImageDataSizesES3(
int width, int height, int depth, int format, int type,
const PixelStoreParams& params,
uint32_t* size, uint32_t* opt_unpadded_row_size,
uint32_t* opt_padded_row_size, uint32_t* opt_skip_size,
uint32_t* opt_padding) { … }
uint32_t GLES2Util::RenderbufferBytesPerPixel(int format) { … }
uint8_t GLES2Util::StencilBitsPerPixel(int format) { … }
uint32_t GLES2Util::GetElementSizeForUniformType(int type) { … }
uint32_t GLES2Util::GetElementCountForUniformType(int type) { … }
uint32_t GLES2Util::GetGLTypeSizeForTextures(uint32_t type) { … }
uint32_t GLES2Util::GetGLTypeSizeForBuffers(uint32_t type) { … }
uint32_t GLES2Util::GetGroupSizeForBufferType(uint32_t count, uint32_t type) { … }
uint32_t GLES2Util::GLErrorToErrorBit(uint32_t error) { … }
uint32_t GLES2Util::GLErrorBitToGLError(uint32_t error_bit) { … }
uint32_t GLES2Util::IndexToGLFaceTarget(int index) { … }
size_t GLES2Util::GLTargetToFaceIndex(uint32_t target) { … }
uint32_t GLES2Util::GLFaceTargetToTextureTarget(uint32_t target) { … }
uint32_t GLES2Util::GetGLReadPixelsImplementationFormat(
uint32_t internal_format,
uint32_t texture_type,
bool supports_bgra) { … }
uint32_t GLES2Util::GetGLReadPixelsImplementationType(uint32_t internal_format,
uint32_t texture_type) { … }
uint32_t GLES2Util::GetChannelsForFormat(int format) { … }
bool GLES2Util::IsSizedColorFormat(uint32_t internal_format) { … }
GLint GLES2Util::GetColorEncodingFromInternalFormat(uint32_t internalformat) { … }
void GLES2Util::GetColorFormatComponentSizes(
uint32_t internal_format, uint32_t type, int* r, int* g, int* b, int* a) { … }
uint32_t GLES2Util::GetChannelsNeededForAttachmentType(
int type,
uint32_t max_color_attachments) { … }
std::string GLES2Util::GetStringEnum(uint32_t value) { … }
std::string GLES2Util::GetStringError(uint32_t value) { … }
std::string GLES2Util::GetStringBool(uint32_t value) { … }
std::string GLES2Util::GetQualifiedEnumString(const EnumToString* table,
size_t count,
uint32_t value) { … }
GLSLArrayName::GLSLArrayName(const std::string& name) : … { … }
uint32_t GLES2Util::CalcClearBufferivDataCount(int buffer) { … }
uint32_t GLES2Util::CalcClearBufferfvDataCount(int buffer) { … }
uint32_t GLES2Util::CalcClearBufferuivDataCount(int buffer) { … }
void GLES2Util::MapUint64ToTwoUint32(
uint64_t v64, uint32_t* v32_0, uint32_t* v32_1) { … }
uint64_t GLES2Util::MapTwoUint32ToUint64(uint32_t v32_0, uint32_t v32_1) { … }
uint32_t GLES2Util::MapBufferTargetToBindingEnum(uint32_t target) { … }
bool GLES2Util::IsUnsignedIntegerFormat(uint32_t internal_format) { … }
bool GLES2Util::IsSignedIntegerFormat(uint32_t internal_format) { … }
bool GLES2Util::IsIntegerFormat(uint32_t internal_format) { … }
bool GLES2Util::IsFloatFormat(uint32_t internal_format) { … }
bool GLES2Util::IsFloat32Format(uint32_t internal_format) { … }
uint32_t GLES2Util::ConvertToSizedFormat(uint32_t format, uint32_t type) { … }
#include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h"
}
}