EGLImplFactory.h (3565B)
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 15 namespace egl 16 { 17 class AttributeMap; 18 struct Config; 19 class ImageSibling; 20 struct ImageState; 21 struct SurfaceState; 22 } // namespace egl 23 24 namespace gl 25 { 26 class Context; 27 class ErrorSet; 28 class State; 29 } // namespace gl 30 31 namespace rx 32 { 33 class ContextImpl; 34 class EGLSyncImpl; 35 class ImageImpl; 36 class ExternalImageSiblingImpl; 37 class SurfaceImpl; 38 class ShareGroupImpl; 39 40 class EGLImplFactory : angle::NonCopyable 41 { 42 public: 43 EGLImplFactory() {} 44 virtual ~EGLImplFactory() {} 45 46 virtual SurfaceImpl *createWindowSurface(const egl::SurfaceState &state, 47 EGLNativeWindowType window, 48 const egl::AttributeMap &attribs) = 0; 49 virtual SurfaceImpl *createPbufferSurface(const egl::SurfaceState &state, 50 const egl::AttributeMap &attribs) = 0; 51 virtual SurfaceImpl *createPbufferFromClientBuffer(const egl::SurfaceState &state, 52 EGLenum buftype, 53 EGLClientBuffer clientBuffer, 54 const egl::AttributeMap &attribs) = 0; 55 virtual SurfaceImpl *createPixmapSurface(const egl::SurfaceState &state, 56 NativePixmapType nativePixmap, 57 const egl::AttributeMap &attribs) = 0; 58 59 virtual ImageImpl *createImage(const egl::ImageState &state, 60 const gl::Context *context, 61 EGLenum target, 62 const egl::AttributeMap &attribs) = 0; 63 64 virtual ContextImpl *createContext(const gl::State &state, 65 gl::ErrorSet *errorSet, 66 const egl::Config *configuration, 67 const gl::Context *shareContext, 68 const egl::AttributeMap &attribs) = 0; 69 70 virtual StreamProducerImpl *createStreamProducerD3DTexture( 71 egl::Stream::ConsumerType consumerType, 72 const egl::AttributeMap &attribs) = 0; 73 74 virtual ExternalImageSiblingImpl *createExternalImageSibling(const gl::Context *context, 75 EGLenum target, 76 EGLClientBuffer buffer, 77 const egl::AttributeMap &attribs); 78 79 virtual EGLSyncImpl *createSync(const egl::AttributeMap &attribs); 80 81 virtual ShareGroupImpl *createShareGroup() = 0; 82 83 virtual GLuint getNextSurfaceID() = 0; 84 }; 85 86 inline ExternalImageSiblingImpl *EGLImplFactory::createExternalImageSibling( 87 const gl::Context *context, 88 EGLenum target, 89 EGLClientBuffer buffer, 90 const egl::AttributeMap &attribs) 91 { 92 UNREACHABLE(); 93 return nullptr; 94 } 95 96 inline EGLSyncImpl *EGLImplFactory::createSync(const egl::AttributeMap &attribs) 97 { 98 UNREACHABLE(); 99 return nullptr; 100 } 101 102 } // namespace rx 103 104 #endif // LIBANGLE_RENDERER_EGLIMPLFACTORY_H_