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