• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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     Optional<gl::Version> getMaxSupportedDesktopVersion() const override;
58 
59     SurfaceImpl *createWindowSurface(const egl::SurfaceState &state,
60                                      EGLNativeWindowType window,
61                                      const egl::AttributeMap &attribs) override;
62     SurfaceImpl *createPbufferSurface(const egl::SurfaceState &state,
63                                       const egl::AttributeMap &attribs) override;
64     SurfaceImpl *createPbufferFromClientBuffer(const egl::SurfaceState &state,
65                                                EGLenum buftype,
66                                                EGLClientBuffer buffer,
67                                                const egl::AttributeMap &attribs) override;
68     SurfaceImpl *createPixmapSurface(const egl::SurfaceState &state,
69                                      NativePixmapType nativePixmap,
70                                      const egl::AttributeMap &attribs) override;
71 
72     ImageImpl *createImage(const egl::ImageState &state,
73                            const gl::Context *context,
74                            EGLenum target,
75                            const egl::AttributeMap &attribs) override;
76 
77     ContextImpl *createContext(const gl::State &state,
78                                gl::ErrorSet *errorSet,
79                                const egl::Config *configuration,
80                                const gl::Context *shareContext,
81                                const egl::AttributeMap &attribs) override;
82 
83     StreamProducerImpl *createStreamProducerD3DTexture(egl::Stream::ConsumerType consumerType,
84                                                        const egl::AttributeMap &attribs) override;
85 
86     ShareGroupImpl *createShareGroup(const egl::ShareGroupState &state) override;
87 
populateFeatureList(angle::FeatureList * features)88     void populateFeatureList(angle::FeatureList *features) override {}
89 
90   private:
91     void generateExtensions(egl::DisplayExtensions *outExtensions) const override;
92     void generateCaps(egl::Caps *outCaps) const override;
93 
94     std::unique_ptr<AllocationTrackerNULL> mAllocationTracker;
95 };
96 
97 }  // namespace rx
98 
99 #endif  // LIBANGLE_RENDERER_NULL_DISPLAYNULL_H_
100