chromium/gpu/command_buffer/common/gles2_cmd_utils.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

// This file is here so other GLES2 related files can have a common set of
// includes where appropriate.

#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 {};
}  // namespace gl_error_bit

int GLES2Util::GLGetNumValuesReturned(int id) const {}

namespace {

// Return the number of bytes per element, based on the element type.
uint32_t BytesPerElement(int type) {}

}  // anonymous namespace

// Return the number of elements per group of a specified format.
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) {}

// Returns the amount of data glTexImage*D or glTexSubImage*D will access.
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) {}

// static
void GLES2Util::MapUint64ToTwoUint32(
    uint64_t v64, uint32_t* v32_0, uint32_t* v32_1) {}

// static
uint64_t GLES2Util::MapTwoUint32ToUint64(uint32_t v32_0, uint32_t v32_1) {}

// static
uint32_t GLES2Util::MapBufferTargetToBindingEnum(uint32_t target) {}

// static
bool GLES2Util::IsUnsignedIntegerFormat(uint32_t internal_format) {}

// static
bool GLES2Util::IsSignedIntegerFormat(uint32_t internal_format) {}

// static
bool GLES2Util::IsIntegerFormat(uint32_t internal_format) {}

// static
bool GLES2Util::IsFloatFormat(uint32_t internal_format) {}

// static
bool GLES2Util::IsFloat32Format(uint32_t internal_format) {}

// static
uint32_t GLES2Util::ConvertToSizedFormat(uint32_t format, uint32_t type) {}

#include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h"

}  // namespace gles2
}  // namespace gpu