chromium/gpu/command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.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

#ifndef GL_GLEXT_PROTOTYPES
#define GL_GLEXT_PROTOTYPES
#endif

#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <GLES2/gl2extchromium.h>
#include <GLES3/gl3.h>
#include <stddef.h>
#include <stdint.h>

#include "base/logging.h"
#include "build/build_config.h"
#include "gpu/command_buffer/tests/gl_manager.h"
#include "gpu/command_buffer/tests/gl_test_utils.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gl/gl_enums.h"
#include "ui/gl/gl_version_info.h"

namespace gpu {

namespace {

enum CopyType {};
const CopyType kCopyTypes[] =;

struct FormatType {};

static const char* kSimpleVertexShaderES2 =;

static const char* kSimpleVertexShaderES3 =;

std::string GetFragmentShaderSource(GLenum target, GLenum format, bool is_es3) {}

void setColor(uint8_t r, uint8_t g, uint8_t b, uint8_t a, uint8_t* color) {}

void getExpectedColorAndMask(GLenum src_internal_format,
                             GLenum dest_internal_format,
                             const uint8_t* color,
                             uint8_t* expected_color,
                             uint8_t* expected_mask) {}

void getTextureDataAndExpectedRGBAs(FormatType src_format_type,
                                    FormatType dest_format_type,
                                    GLsizei width,
                                    GLsizei height,
                                    std::vector<uint8_t>* texture_data,
                                    std::vector<uint8_t>* expected_rgba_pixels,
                                    uint8_t* expected_mask) {}

}  // namespace

// A collection of tests that exercise the GL_CHROMIUM_copy_texture extension.
class GLCopyTextureCHROMIUMTest
    : public testing::Test,
      public ::testing::WithParamInterface<CopyType> {};

class GLCopyTextureCHROMIUMES3Test : public GLCopyTextureCHROMIUMTest {};

INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();

// Test to ensure that the basic functionality of the extension works.
TEST_P(GLCopyTextureCHROMIUMTest, Basic) {}

TEST_P(GLCopyTextureCHROMIUMES3Test, BigTexture) {}

TEST_P(GLCopyTextureCHROMIUMES3Test, FormatCombinationsFromLuminance) {}

TEST_P(GLCopyTextureCHROMIUMES3Test, FormatCombinationsFromRGB) {}

TEST_P(GLCopyTextureCHROMIUMES3Test, FormatCombinationsFromRGBA) {}

TEST_P(GLCopyTextureCHROMIUMES3Test, FormatCombinationsFromBGRA) {}

TEST_P(GLCopyTextureCHROMIUMES3Test, FormatCombinationsFromOther) {}

TEST_P(GLCopyTextureCHROMIUMTest, ImmutableTexture) {}

TEST_P(GLCopyTextureCHROMIUMTest, InternalFormat) {}

TEST_P(GLCopyTextureCHROMIUMTest, InternalFormatRGBFloat) {}

TEST_P(GLCopyTextureCHROMIUMTest, InternalFormatRGBAFloat) {}

TEST_P(GLCopyTextureCHROMIUMTest, InternalFormatNotSupported) {}

TEST_F(GLCopyTextureCHROMIUMTest, InternalFormatTypeCombinationNotSupported) {}

TEST_P(GLCopyTextureCHROMIUMTest, CopyTextureLevel) {}

TEST_P(GLCopyTextureCHROMIUMES3Test, CopyTextureLevel) {}

TEST_P(GLCopyTextureCHROMIUMTest, CopyTextureCubeMap) {}

TEST_P(GLCopyTextureCHROMIUMES3Test, CopyTextureCubeMap) {}

// Test to ensure that the destination texture is redefined if the properties
// are different.
TEST_F(GLCopyTextureCHROMIUMTest, RedefineDestinationTexture) {}

namespace {

void glEnableDisable(GLint param, GLboolean value) {}

}  // unnamed namespace

// Validate that some basic GL state is not touched upon execution of
// the extension.
TEST_P(GLCopyTextureCHROMIUMTest, BasicStatePreservation) {}

TEST_P(GLCopyTextureCHROMIUMES3Test, SamplerStatePreserved) {}

// Verify that invocation of the extension does not modify the bound
// texture state.
TEST_P(GLCopyTextureCHROMIUMTest, TextureStatePreserved) {}

// Verify that invocation of the extension does not perturb the currently
// bound FBO state.
TEST_P(GLCopyTextureCHROMIUMTest, FBOStatePreserved) {}

TEST_P(GLCopyTextureCHROMIUMTest, ProgramStatePreservation) {}

// Test that glCopyTextureCHROMIUM doesn't leak uninitialized textures.
TEST_P(GLCopyTextureCHROMIUMTest, UninitializedSource) {}

TEST_F(GLCopyTextureCHROMIUMTest, CopySubTextureDimension) {}

TEST_F(GLCopyTextureCHROMIUMTest, CopyTextureInvalidTextureIds) {}

TEST_F(GLCopyTextureCHROMIUMTest, CopySubTextureInvalidTextureIds) {}

TEST_F(GLCopyTextureCHROMIUMTest, CopySubTextureOffset) {}

}  // namespace gpu