1//
2// Copyright 2016 The ANGLE Project Authors. All rights reserved.
3// Use of this source code is governed by a BSD-style license that can be
4// found in the LICENSE file.
5//
6// EGLImplFactory.h:
7// Factory interface for EGL Impl objects.
8//
9
10#ifndef LIBANGLE_RENDERER_EGLIMPLFACTORY_H_
11#define LIBANGLE_RENDERER_EGLIMPLFACTORY_H_
12
13#include "libANGLE/Stream.h"
14
15namespace egl
16{
17class AttributeMap;
18struct Config;
19class ImageSibling;
20struct ImageState;
21class ShareGroupState;
22struct SurfaceState;
23} // namespace egl
24
25namespace gl
26{
27class Context;
28class ErrorSet;
29class State;
30} // namespace gl
31
32namespace rx
33{
34class ContextImpl;
35class EGLSyncImpl;
36class ImageImpl;
37class ExternalImageSiblingImpl;
38class SurfaceImpl;
39class ShareGroupImpl;
40
41class EGLImplFactory : angle::NonCopyable
42{
43 public:
44 EGLImplFactory() {}
45 virtual ~EGLImplFactory() {}
46
47 virtual SurfaceImpl *createWindowSurface(const egl::SurfaceState &state,
48 EGLNativeWindowType window,
49 const egl::AttributeMap &attribs) = 0;
50 virtual SurfaceImpl *createPbufferSurface(const egl::SurfaceState &state,
51 const egl::AttributeMap &attribs) = 0;
52 virtual SurfaceImpl *createPbufferFromClientBuffer(const egl::SurfaceState &state,
53 EGLenum buftype,
54 EGLClientBuffer clientBuffer,
55 const egl::AttributeMap &attribs) = 0;
56 virtual SurfaceImpl *createPixmapSurface(const egl::SurfaceState &state,
57 NativePixmapType nativePixmap,
58 const egl::AttributeMap &attribs) = 0;
59
60 virtual ImageImpl *createImage(const egl::ImageState &state,
61 const gl::Context *context,
62 EGLenum target,
63 const egl::AttributeMap &attribs) = 0;
64
65 virtual ContextImpl *createContext(const gl::State &state,
66 gl::ErrorSet *errorSet,
67 const egl::Config *configuration,
68 const gl::Context *shareContext,
69 const egl::AttributeMap &attribs) = 0;
70
71 virtual StreamProducerImpl *createStreamProducerD3DTexture(
72 egl::Stream::ConsumerType consumerType,
73 const egl::AttributeMap &attribs) = 0;
74
75 virtual ExternalImageSiblingImpl *createExternalImageSibling(const gl::Context *context,
76 EGLenum target,
77 EGLClientBuffer buffer,
78 const egl::AttributeMap &attribs);
79
80 virtual EGLSyncImpl *createSync(const egl::AttributeMap &attribs);
81
82 virtual ShareGroupImpl *createShareGroup(const egl::ShareGroupState &state) = 0;
83};
84
85inline ExternalImageSiblingImpl *EGLImplFactory::createExternalImageSibling(
86 const gl::Context *context,
87 EGLenum target,
88 EGLClientBuffer buffer,
89 const egl::AttributeMap &attribs)
90{
91 UNREACHABLE();
92 return nullptr;
93}
94
95inline EGLSyncImpl *EGLImplFactory::createSync(const egl::AttributeMap &attribs)
96{
97 UNREACHABLE();
98 return nullptr;
99}
100
101} // namespace rx
102
103#endif // LIBANGLE_RENDERER_EGLIMPLFACTORY_H_
104

source code of flutter_engine/third_party/angle/src/libANGLE/renderer/EGLImplFactory.h