xref: /aosp_15_r20/external/angle/src/libANGLE/renderer/SurfaceImpl.cpp (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1 //
2 // Copyright 2002 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 
7 // SurfaceImpl.cpp: Implementation of Surface stub method class
8 
9 #include "libANGLE/renderer/SurfaceImpl.h"
10 
11 namespace rx
12 {
13 
SurfaceImpl(const egl::SurfaceState & state)14 SurfaceImpl::SurfaceImpl(const egl::SurfaceState &state) : mState(state) {}
15 
~SurfaceImpl()16 SurfaceImpl::~SurfaceImpl() {}
17 
makeCurrent(const gl::Context * context)18 egl::Error SurfaceImpl::makeCurrent(const gl::Context *context)
19 {
20     return egl::NoError();
21 }
22 
unMakeCurrent(const gl::Context * context)23 egl::Error SurfaceImpl::unMakeCurrent(const gl::Context *context)
24 {
25     return egl::NoError();
26 }
27 
prepareSwap(const gl::Context *)28 egl::Error SurfaceImpl::prepareSwap(const gl::Context *)
29 {
30     return angle::ResultToEGL(angle::Result::Continue);
31 }
32 
swapWithDamage(const gl::Context * context,const EGLint * rects,EGLint n_rects)33 egl::Error SurfaceImpl::swapWithDamage(const gl::Context *context,
34                                        const EGLint *rects,
35                                        EGLint n_rects)
36 {
37     UNREACHABLE();
38     return egl::EglBadSurface() << "swapWithDamage implementation missing.";
39 }
40 
swapWithFrameToken(const gl::Context * context,EGLFrameTokenANGLE frameToken)41 egl::Error SurfaceImpl::swapWithFrameToken(const gl::Context *context,
42                                            EGLFrameTokenANGLE frameToken)
43 {
44     UNREACHABLE();
45     return egl::EglBadDisplay();
46 }
47 
postSubBuffer(const gl::Context * context,EGLint x,EGLint y,EGLint width,EGLint height)48 egl::Error SurfaceImpl::postSubBuffer(const gl::Context *context,
49                                       EGLint x,
50                                       EGLint y,
51                                       EGLint width,
52                                       EGLint height)
53 {
54     UNREACHABLE();
55     return egl::EglBadSurface() << "getMscRate implementation missing.";
56 }
57 
setPresentationTime(EGLnsecsANDROID time)58 egl::Error SurfaceImpl::setPresentationTime(EGLnsecsANDROID time)
59 {
60     UNREACHABLE();
61     return egl::EglBadSurface() << "setPresentationTime implementation missing.";
62 }
63 
querySurfacePointerANGLE(EGLint attribute,void ** value)64 egl::Error SurfaceImpl::querySurfacePointerANGLE(EGLint attribute, void **value)
65 {
66     UNREACHABLE();
67     return egl::EglBadSurface() << "querySurfacePointerANGLE implementation missing.";
68 }
69 
getSyncValues(EGLuint64KHR * ust,EGLuint64KHR * msc,EGLuint64KHR * sbc)70 egl::Error SurfaceImpl::getSyncValues(EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc)
71 {
72     UNREACHABLE();
73     return egl::EglBadSurface() << "getSyncValues implementation missing.";
74 }
75 
getMscRate(EGLint * numerator,EGLint * denominator)76 egl::Error SurfaceImpl::getMscRate(EGLint *numerator, EGLint *denominator)
77 {
78     UNREACHABLE();
79     return egl::EglBadSurface() << "getMscRate implementation missing.";
80 }
81 
setFixedWidth(EGLint width)82 void SurfaceImpl::setFixedWidth(EGLint width)
83 {
84     UNREACHABLE();
85 }
86 
setFixedHeight(EGLint height)87 void SurfaceImpl::setFixedHeight(EGLint height)
88 {
89     UNREACHABLE();
90 }
91 
setTimestampsEnabled(bool enabled)92 void SurfaceImpl::setTimestampsEnabled(bool enabled)
93 {
94     UNREACHABLE();
95 }
96 
getD3DTextureColorFormat() const97 const angle::Format *SurfaceImpl::getD3DTextureColorFormat() const
98 {
99     UNREACHABLE();
100     return nullptr;
101 }
102 
getSupportedCompositorTimings() const103 egl::SupportedCompositorTimings SurfaceImpl::getSupportedCompositorTimings() const
104 {
105     UNREACHABLE();
106     return egl::SupportedCompositorTimings();
107 }
108 
getCompositorTiming(EGLint numTimestamps,const EGLint * names,EGLnsecsANDROID * values) const109 egl::Error SurfaceImpl::getCompositorTiming(EGLint numTimestamps,
110                                             const EGLint *names,
111                                             EGLnsecsANDROID *values) const
112 {
113     UNREACHABLE();
114     return egl::EglBadDisplay();
115 }
116 
getNextFrameId(EGLuint64KHR * frameId) const117 egl::Error SurfaceImpl::getNextFrameId(EGLuint64KHR *frameId) const
118 {
119     UNREACHABLE();
120     return egl::EglBadDisplay();
121 }
122 
getSupportedTimestamps() const123 egl::SupportedTimestamps SurfaceImpl::getSupportedTimestamps() const
124 {
125     UNREACHABLE();
126     return egl::SupportedTimestamps();
127 }
128 
getFrameTimestamps(EGLuint64KHR frameId,EGLint numTimestamps,const EGLint * timestamps,EGLnsecsANDROID * values) const129 egl::Error SurfaceImpl::getFrameTimestamps(EGLuint64KHR frameId,
130                                            EGLint numTimestamps,
131                                            const EGLint *timestamps,
132                                            EGLnsecsANDROID *values) const
133 {
134     UNREACHABLE();
135     return egl::EglBadDisplay();
136 }
getUserWidth(const egl::Display * display,EGLint * value) const137 egl::Error SurfaceImpl::getUserWidth(const egl::Display *display, EGLint *value) const
138 {
139     *value = getWidth();
140     return egl::NoError();
141 }
142 
getUserHeight(const egl::Display * display,EGLint * value) const143 egl::Error SurfaceImpl::getUserHeight(const egl::Display *display, EGLint *value) const
144 {
145     *value = getHeight();
146     return egl::NoError();
147 }
148 
isPostSubBufferSupported() const149 EGLint SurfaceImpl::isPostSubBufferSupported() const
150 {
151     UNREACHABLE();
152     return EGL_FALSE;
153 }
154 
getBufferAge(const gl::Context * context,EGLint * age)155 egl::Error SurfaceImpl::getBufferAge(const gl::Context *context, EGLint *age)
156 {
157     *age = 0;
158     return egl::NoError();
159 }
160 
setAutoRefreshEnabled(bool enabled)161 egl::Error SurfaceImpl::setAutoRefreshEnabled(bool enabled)
162 {
163     return egl::EglBadMatch();
164 }
165 
lockSurface(const egl::Display * display,EGLint usageHint,bool preservePixels,uint8_t ** bufferPtrOut,EGLint * bufferPitchOut)166 egl::Error SurfaceImpl::lockSurface(const egl::Display *display,
167                                     EGLint usageHint,
168                                     bool preservePixels,
169                                     uint8_t **bufferPtrOut,
170                                     EGLint *bufferPitchOut)
171 {
172     UNREACHABLE();
173     return egl::EglBadMatch();
174 }
175 
unlockSurface(const egl::Display * display,bool preservePixels)176 egl::Error SurfaceImpl::unlockSurface(const egl::Display *display, bool preservePixels)
177 {
178     UNREACHABLE();
179     return egl::EglBadMatch();
180 }
181 
origin() const182 EGLint SurfaceImpl::origin() const
183 {
184     return EGL_LOWER_LEFT_KHR;
185 }
186 
setRenderBuffer(EGLint renderBuffer)187 egl::Error SurfaceImpl::setRenderBuffer(EGLint renderBuffer)
188 {
189     return egl::NoError();
190 }
191 }  // namespace rx
192