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 // DisplayNULL.h: 7 // Defines the class interface for DisplayNULL, implementing DisplayImpl. 8 // 9 10 #ifndef LIBANGLE_RENDERER_NULL_DISPLAYNULL_H_ 11 #define LIBANGLE_RENDERER_NULL_DISPLAYNULL_H_ 12 13 #include "libANGLE/renderer/DisplayImpl.h" 14 #include "libANGLE/renderer/ShareGroupImpl.h" 15 16 namespace rx 17 { 18 class ShareGroupNULL : public ShareGroupImpl 19 { 20 public: ShareGroupNULL(const egl::ShareGroupState & state)21 ShareGroupNULL(const egl::ShareGroupState &state) : ShareGroupImpl(state) {} 22 }; 23 24 class AllocationTrackerNULL; 25 26 class DisplayNULL : public DisplayImpl 27 { 28 public: 29 DisplayNULL(const egl::DisplayState &state); 30 ~DisplayNULL() override; 31 32 egl::Error initialize(egl::Display *display) override; 33 void terminate() override; 34 35 egl::Error makeCurrent(egl::Display *display, 36 egl::Surface *drawSurface, 37 egl::Surface *readSurface, 38 gl::Context *context) override; 39 40 egl::ConfigSet generateConfigs() override; 41 42 bool testDeviceLost() override; 43 egl::Error restoreLostDevice(const egl::Display *display) override; 44 45 bool isValidNativeWindow(EGLNativeWindowType window) const override; 46 47 std::string getRendererDescription() override; 48 std::string getVendorString() override; 49 std::string getVersionString(bool includeFullVersion) override; 50 51 DeviceImpl *createDevice() override; 52 53 egl::Error waitClient(const gl::Context *context) override; 54 egl::Error waitNative(const gl::Context *context, EGLint engine) override; 55 gl::Version getMaxSupportedESVersion() const override; 56 gl::Version getMaxConformantESVersion() const override; 57 58 SurfaceImpl *createWindowSurface(const egl::SurfaceState &state, 59 EGLNativeWindowType window, 60 const egl::AttributeMap &attribs) override; 61 SurfaceImpl *createPbufferSurface(const egl::SurfaceState &state, 62 const egl::AttributeMap &attribs) override; 63 SurfaceImpl *createPbufferFromClientBuffer(const egl::SurfaceState &state, 64 EGLenum buftype, 65 EGLClientBuffer buffer, 66 const egl::AttributeMap &attribs) override; 67 SurfaceImpl *createPixmapSurface(const egl::SurfaceState &state, 68 NativePixmapType nativePixmap, 69 const egl::AttributeMap &attribs) override; 70 71 ImageImpl *createImage(const egl::ImageState &state, 72 const gl::Context *context, 73 EGLenum target, 74 const egl::AttributeMap &attribs) override; 75 76 ContextImpl *createContext(const gl::State &state, 77 gl::ErrorSet *errorSet, 78 const egl::Config *configuration, 79 const gl::Context *shareContext, 80 const egl::AttributeMap &attribs) override; 81 82 StreamProducerImpl *createStreamProducerD3DTexture(egl::Stream::ConsumerType consumerType, 83 const egl::AttributeMap &attribs) override; 84 85 ShareGroupImpl *createShareGroup(const egl::ShareGroupState &state) override; 86 populateFeatureList(angle::FeatureList * features)87 void populateFeatureList(angle::FeatureList *features) override {} 88 89 private: 90 void generateExtensions(egl::DisplayExtensions *outExtensions) const override; 91 void generateCaps(egl::Caps *outCaps) const override; 92 93 std::unique_ptr<AllocationTrackerNULL> mAllocationTracker; 94 }; 95 96 } // namespace rx 97 98 #endif // LIBANGLE_RENDERER_NULL_DISPLAYNULL_H_ 99