chromium/third_party/angle/src/tests/egl_tests/EGLContextCompatibilityTest.cpp

//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//

// EGLContextCompatibilityTest.cpp:
//   This test will try to use all combinations of context configs and
//   surface configs. If the configs are compatible, it checks that simple
//   rendering works, otherwise it checks an error is generated one MakeCurrent.
//

#include <gtest/gtest.h>

#include <unordered_set>
#include <vector>

#include "common/debug.h"
#include "test_utils/ANGLETest.h"
#include "test_utils/angle_test_configs.h"
#include "test_utils/angle_test_instantiate.h"
#include "util/OSWindow.h"
#include "util/random_utils.h"

usingnamespaceangle;

namespace
{
// The only configs with 16-bits for each of red, green, blue, and alpha is GL_RGBA16F
bool IsRGBA16FConfig(EGLDisplay display, EGLConfig config)
{}

bool IsRGB10_A2Config(EGLDisplay display, EGLConfig config)
{}

// Queries EGL config to determine if multisampled or not
bool IsMultisampledConfig(EGLDisplay display, EGLConfig config)
{}

bool ShouldSkipConfig(EGLDisplay display, EGLConfig config, bool windowSurfaceTest)
{}

std::vector<EGLConfig> GetConfigs(EGLDisplay display)
{}

PlatformParameters FromRenderer(EGLint renderer)
{}

std::string EGLConfigName(EGLDisplay display, EGLConfig config)
{}

const std::array<EGLint, 3> kContextAttribs =;

class EGLContextCompatibilityTest : public ANGLETestBase, public testing::Test
{};

// The test is split in several subtest so that simple cases
// are tested separately. Also each surface types are not tested
// together.

// Basic test checking contexts and windows created with the
// same config can render.
class EGLContextCompatibilityTest_WindowSameConfig : public EGLContextCompatibilityTest
{};

// Basic test checking contexts and pbuffers created with the
// same config can render.
class EGLContextCompatibilityTest_PbufferSameConfig : public EGLContextCompatibilityTest
{};

// Check that a context rendering to a window with a different
// config works or errors according to the EGL compatibility rules
class EGLContextCompatibilityTest_WindowDifferentConfig : public EGLContextCompatibilityTest
{};

// Check that a context rendering to a pbuffer with a different
// config works or errors according to the EGL compatibility rules
class EGLContextCompatibilityTest_PbufferDifferentConfig : public EGLContextCompatibilityTest
{};
}  // namespace

void RegisterContextCompatibilityTests()
{}