chromium/gpu/command_buffer/tests/compressed_texture_test.cc

// Copyright 2013 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 <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <GLES2/gl2extchromium.h>
#include <stdint.h>

#include "gpu/command_buffer/tests/gl_manager.h"
#include "gpu/command_buffer/tests/gl_test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"

#define SHADER(src)

namespace gpu {

static const uint16_t kRedMask =;
static const uint16_t kGreenMask =;
static const uint16_t kBlueMask =;

// Color palette in 565 format.
static const uint16_t kPalette[] =;
static const unsigned kBlockSize =;
static const unsigned kPaletteSize =;
static const unsigned kTextureWidth =;
static const unsigned kTextureHeight =;

static const char* extension(GLenum format) {}

// Index that chooses the given colors (color_0 and color_1),
// not the interpolated colors (color_2 and color_3).
static const uint16_t kColor0 =;
static const uint16_t kColor1 =;

static GLuint LoadCompressedTexture(const void* data,
                                    GLsizeiptr size,
                                    GLenum format,
                                    GLsizei width,
                                    GLsizei height) {}

GLuint LoadTextureDXT1(bool alpha) {}

GLuint LoadTextureDXT3() {}

GLuint LoadTextureDXT5() {}

static void ToRGB888(uint16_t rgb565, uint8_t rgb888[]) {}

class CompressedTextureTest : public ::testing::TestWithParam<GLenum> {};

// The test draws a texture in the given format and verifies that the drawn
// pixels are of the same color as the texture.
// The texture consists of 4x4 blocks of texels (same as DXT), one for each
// color defined in kPalette.
TEST_P(CompressedTextureTest, Draw) {}

static const GLenum kFormats[] =;
INSTANTIATE_TEST_SUITE_P();

}  // namespace gpu