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