Chris Bracken 6226520c45 Extract TestGLContext to separate translation unit (flutter/engine#56647)
For consistency with the Test.*Context classes for other backends, which live in their own implementation file with their own header, extract TestEGLContext to its own header and TU so that in cases where only a TestEGLContext is required (e.g. EmbedderTestBackingStoreProducerGL), we don't need to include all the various test GL surface classes as well.

GetEGLError is used by both TestEGLContext and the TestGLSurface classes, so moves to its own utils file.

No tests because this is a refactoring with no semantic changes, and the code itself is test code.

Issue: https://github.com/flutter/flutter/issues/158998

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-18 21:56:05 +00:00

32 lines
838 B
C++

// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_TESTING_TEST_GL_CONTEXT_H_
#define FLUTTER_TESTING_TEST_GL_CONTEXT_H_
namespace flutter::testing {
struct TestEGLContext {
explicit TestEGLContext();
~TestEGLContext();
using EGLDisplay = void*;
using EGLContext = void*;
using EGLConfig = void*;
EGLDisplay display;
EGLContext onscreen_context;
EGLContext offscreen_context;
// EGLConfig is technically a property of the surfaces, no the context,
// but it's not that well separated in EGL (e.g. when
// EGL_KHR_no_config_context is not supported), so we just store it here.
EGLConfig config;
};
} // namespace flutter::testing
#endif // FLUTTER_TESTING_TEST_GL_CONTEXT_H_