chromium/gpu/command_buffer/tests/gl_test_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/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "gpu/command_buffer/tests/gl_test_utils.h"

#include <GLES2/gl2extchromium.h>
#include <stdint.h>
#include <stdio.h>

#include <memory>
#include <string>

#include "base/command_line.h"
#include "base/containers/contains.h"
#include "base/containers/heap_array.h"
#include "base/logging.h"
#include "build/build_config.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "gpu/config/gpu_driver_bug_workarounds.h"
#include "gpu/config/gpu_info_collector.h"
#include "gpu/config/gpu_preferences.h"
#include "gpu/config/gpu_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gl/gl_version_info.h"
#include "ui/gl/init/gl_factory.h"

namespace gpu {

// GCC requires these declarations, but MSVC requires they not be present.
#ifndef COMPILER_MSVC
const uint8_t GLTestHelper::kCheckClearValue;
#endif

gl::GLDisplay* GLTestHelper::InitializeGL(gl::GLImplementation gl_impl) {}

gl::GLDisplay* GLTestHelper::InitializeGLDefault() {}

bool GLTestHelper::HasExtension(const char* extension) {}

bool GLTestHelper::CheckGLError(const char* msg, int line) {}

GLuint GLTestHelper::CompileShader(GLenum type, const char* shaderSrc) {}

GLuint GLTestHelper::LoadShader(GLenum type, const char* shaderSrc) {}

GLuint GLTestHelper::LinkProgram(
    GLuint vertex_shader, GLuint fragment_shader) {}

GLuint GLTestHelper::SetupProgram(
    GLuint vertex_shader, GLuint fragment_shader) {}

GLuint GLTestHelper::LoadProgram(
    const char* vertex_shader_source,
    const char* fragment_shader_source) {}

GLuint GLTestHelper::SetupUnitQuad(GLint position_location) {}

std::vector<GLuint> GLTestHelper::SetupIndexedUnitQuad(
    GLint position_location) {}

GLuint GLTestHelper::SetupColorsForUnitQuad(
    GLint location, const GLfloat color[4], GLenum usage) {}

bool GLTestHelper::CheckPixels(GLint x,
                               GLint y,
                               GLsizei width,
                               GLsizei height,
                               GLint tolerance,
                               const uint8_t* color,
                               const uint8_t* mask) {}

bool GLTestHelper::CheckPixels(GLint x,
                               GLint y,
                               GLsizei width,
                               GLsizei height,
                               GLint tolerance,
                               const std::vector<uint8_t>& expected,
                               const uint8_t* mask) {}

namespace {

void Set16BitValue(uint8_t dest[2], uint16_t value) {}

void Set32BitValue(uint8_t dest[4], uint32_t value) {}

struct BitmapHeaderFile {};

struct BitmapInfoHeader{};

}  // namespace

bool GLTestHelper::SaveBackbufferAsBMP(
    const char* filename, int width, int height) {}

void GLTestHelper::DrawTextureQuad(const GLenum texture_target,
                                   const char* vertex_src,
                                   const char* fragment_src,
                                   const char* position_name,
                                   const char* sampler_name,
                                   const char* face_name) {}

GpuCommandBufferTestEGL::GpuCommandBufferTestEGL() :{}

GpuCommandBufferTestEGL::~GpuCommandBufferTestEGL() {}

bool GpuCommandBufferTestEGL::InitializeEGL(int width, int height) {}

void GpuCommandBufferTestEGL::RestoreGLDefault() {}

}  // namespace gpu