#ifdef UNSAFE_BUFFERS_BUILD
#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) { … }
}
class GLCopyTextureCHROMIUMTest
: public testing::Test,
public ::testing::WithParamInterface<CopyType> { … };
class GLCopyTextureCHROMIUMES3Test : public GLCopyTextureCHROMIUMTest { … };
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
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_F(GLCopyTextureCHROMIUMTest, RedefineDestinationTexture) { … }
namespace {
void glEnableDisable(GLint param, GLboolean value) { … }
}
TEST_P(GLCopyTextureCHROMIUMTest, BasicStatePreservation) { … }
TEST_P(GLCopyTextureCHROMIUMES3Test, SamplerStatePreserved) { … }
TEST_P(GLCopyTextureCHROMIUMTest, TextureStatePreserved) { … }
TEST_P(GLCopyTextureCHROMIUMTest, FBOStatePreserved) { … }
TEST_P(GLCopyTextureCHROMIUMTest, ProgramStatePreservation) { … }
TEST_P(GLCopyTextureCHROMIUMTest, UninitializedSource) { … }
TEST_F(GLCopyTextureCHROMIUMTest, CopySubTextureDimension) { … }
TEST_F(GLCopyTextureCHROMIUMTest, CopyTextureInvalidTextureIds) { … }
TEST_F(GLCopyTextureCHROMIUMTest, CopySubTextureInvalidTextureIds) { … }
TEST_F(GLCopyTextureCHROMIUMTest, CopySubTextureOffset) { … }
}