#include "ui/gl/gl_gl_api_implementation.h"
#include <array>
#include <vector>
#include "base/command_line.h"
#include "base/containers/contains.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_state_restorer.h"
#include "ui/gl/gl_surface.h"
#include "ui/gl/gl_switches.h"
#include "ui/gl/gl_version_info.h"
#include "ui/gl/shader_tracking.h"
namespace gl {
static CurrentGL* g_no_context_current_gl = …;
static bool g_null_draw_bindings_enabled = …;
namespace {
static inline GLenum GetTexInternalFormat(const GLVersionInfo* version,
GLenum internal_format,
GLenum format,
GLenum type) { … }
static inline GLenum GetTexFormat(const GLVersionInfo* version, GLenum format) { … }
static inline GLenum GetPixelType(const GLVersionInfo* version,
GLenum type,
GLenum format) { … }
}
GLenum GetInternalFormat(const GLVersionInfo* version, GLenum internal_format) { … }
void InitializeStaticGLBindingsGL() { … }
CurrentGL*& ThreadLocalCurrentGL() { … }
CurrentGL* GetThreadLocalCurrentGL() { … }
void SetThreadLocalCurrentGL(CurrentGL* current) { … }
void ClearBindingsGL() { … }
bool SetNullDrawGLBindingsEnabled(bool enabled) { … }
bool GetNullDrawBindingsEnabled() { … }
GLApi::GLApi() = default;
GLApi::~GLApi() = default;
GLApiBase::GLApiBase() : … { … }
GLApiBase::~GLApiBase() = default;
void GLApiBase::InitializeBase(DriverGL* driver) { … }
RealGLApi::RealGLApi()
: … { … }
RealGLApi::~RealGLApi() = default;
void RealGLApi::Initialize(DriverGL* driver) { … }
void RealGLApi::glGetIntegervFn(GLenum pname, GLint* params) { … }
const GLubyte* RealGLApi::glGetStringFn(GLenum name) { … }
const GLubyte* RealGLApi::glGetStringiFn(GLenum name, GLuint index) { … }
void RealGLApi::glTexImage2DFn(GLenum target,
GLint level,
GLint internalformat,
GLsizei width,
GLsizei height,
GLint border,
GLenum format,
GLenum type,
const void* pixels) { … }
void RealGLApi::glTexSubImage2DFn(GLenum target,
GLint level,
GLint xoffset,
GLint yoffset,
GLsizei width,
GLsizei height,
GLenum format,
GLenum type,
const void* pixels) { … }
void RealGLApi::glTexStorage2DEXTFn(GLenum target,
GLsizei levels,
GLenum internalformat,
GLsizei width,
GLsizei height) { … }
void RealGLApi::glTexStorageMem2DEXTFn(GLenum target,
GLsizei levels,
GLenum internalformat,
GLsizei width,
GLsizei height,
GLuint memory,
GLuint64 offset) { … }
void RealGLApi::glTexStorageMemFlags2DANGLEFn(
GLenum target,
GLsizei levels,
GLenum internalformat,
GLsizei width,
GLsizei height,
GLuint memory,
GLuint64 offset,
GLbitfield createFlags,
GLbitfield usageFlags,
const void* imageCreateInfoPNext) { … }
void RealGLApi::glRenderbufferStorageEXTFn(GLenum target,
GLenum internalformat,
GLsizei width,
GLsizei height) { … }
void RealGLApi::glRenderbufferStorageMultisampleEXTFn(GLenum target,
GLsizei samples,
GLenum internalformat,
GLsizei width,
GLsizei height) { … }
void RealGLApi::glRenderbufferStorageMultisampleFn(GLenum target,
GLsizei samples,
GLenum internalformat,
GLsizei width,
GLsizei height) { … }
void RealGLApi::glReadPixelsFn(GLint x,
GLint y,
GLsizei width,
GLsizei height,
GLenum format,
GLenum type,
void* pixels) { … }
void RealGLApi::glClearFn(GLbitfield mask) { … }
void RealGLApi::glDrawArraysFn(GLenum mode, GLint first, GLsizei count) { … }
void RealGLApi::glDrawElementsFn(GLenum mode,
GLsizei count,
GLenum type,
const void* indices) { … }
void RealGLApi::glClearDepthFn(GLclampd depth) { … }
void RealGLApi::glDepthRangeFn(GLclampd z_near, GLclampd z_far) { … }
void RealGLApi::glUseProgramFn(GLuint program) { … }
void RealGLApi::InitializeFilteredExtensionsIfNeeded() { … }
void RealGLApi::SetDisabledExtensions(const std::string& disabled_extensions) { … }
void RealGLApi::ClearCachedGLExtensions() { … }
void RealGLApi::set_version(std::unique_ptr<GLVersionInfo> version) { … }
TraceGLApi::~TraceGLApi() = default;
LogGLApi::LogGLApi(GLApi* gl_api) : … { … }
LogGLApi::~LogGLApi() = default;
NoContextGLApi::NoContextGLApi() = default;
NoContextGLApi::~NoContextGLApi() = default;
}