xref: /aosp_15_r20/external/angle/src/libANGLE/renderer/null/SurfaceNULL.h (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
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 // SurfaceNULL.h:
7 //    Defines the class interface for SurfaceNULL, implementing SurfaceImpl.
8 //
9 
10 #ifndef LIBANGLE_RENDERER_NULL_SURFACENULL_H_
11 #define LIBANGLE_RENDERER_NULL_SURFACENULL_H_
12 
13 #include "libANGLE/renderer/SurfaceImpl.h"
14 
15 namespace rx
16 {
17 
18 class SurfaceNULL : public SurfaceImpl
19 {
20   public:
21     SurfaceNULL(const egl::SurfaceState &surfaceState);
22     ~SurfaceNULL() override;
23 
24     egl::Error initialize(const egl::Display *display) override;
25     egl::Error swap(const gl::Context *context) override;
26     egl::Error postSubBuffer(const gl::Context *context,
27                              EGLint x,
28                              EGLint y,
29                              EGLint width,
30                              EGLint height) override;
31     egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override;
32     egl::Error bindTexImage(const gl::Context *context,
33                             gl::Texture *texture,
34                             EGLint buffer) override;
35     egl::Error releaseTexImage(const gl::Context *context, EGLint buffer) override;
36     egl::Error getSyncValues(EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc) override;
37     egl::Error getMscRate(EGLint *numerator, EGLint *denominator) override;
38     void setSwapInterval(const egl::Display *display, EGLint interval) override;
39 
40     // width and height can change with client window resizing
41     EGLint getWidth() const override;
42     EGLint getHeight() const override;
43 
44     EGLint isPostSubBufferSupported() const override;
45     EGLint getSwapBehavior() const override;
46 
47     angle::Result initializeContents(const gl::Context *context,
48                                      GLenum binding,
49                                      const gl::ImageIndex &imageIndex) override;
50 
51     egl::Error attachToFramebuffer(const gl::Context *context,
52                                    gl::Framebuffer *framebuffer) override;
53     egl::Error detachFromFramebuffer(const gl::Context *context,
54                                      gl::Framebuffer *framebuffer) override;
55 };
56 
57 }  // namespace rx
58 
59 #endif  // LIBANGLE_RENDERER_NULL_SURFACENULL_H_
60