• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
setPresentationTime(EGLnsecsANDROID time)41 egl::Error SurfaceImpl::setPresentationTime(EGLnsecsANDROID time)
42 {
43     UNREACHABLE();
44     return egl::EglBadSurface() << "setPresentationTime implementation missing.";
45 }
46 
setFixedWidth(EGLint width)47 void SurfaceImpl::setFixedWidth(EGLint width)
48 {
49     UNREACHABLE();
50 }
51 
setFixedHeight(EGLint height)52 void SurfaceImpl::setFixedHeight(EGLint height)
53 {
54     UNREACHABLE();
55 }
56 
setTimestampsEnabled(bool enabled)57 void SurfaceImpl::setTimestampsEnabled(bool enabled)
58 {
59     UNREACHABLE();
60 }
61 
getD3DTextureColorFormat() const62 const angle::Format *SurfaceImpl::getD3DTextureColorFormat() const
63 {
64     UNREACHABLE();
65     return nullptr;
66 }
67 
getSupportedCompositorTimings() const68 egl::SupportedCompositorTimings SurfaceImpl::getSupportedCompositorTimings() const
69 {
70     UNREACHABLE();
71     return egl::SupportedCompositorTimings();
72 }
73 
getCompositorTiming(EGLint numTimestamps,const EGLint * names,EGLnsecsANDROID * values) const74 egl::Error SurfaceImpl::getCompositorTiming(EGLint numTimestamps,
75                                             const EGLint *names,
76                                             EGLnsecsANDROID *values) const
77 {
78     UNREACHABLE();
79     return egl::EglBadDisplay();
80 }
81 
getNextFrameId(EGLuint64KHR * frameId) const82 egl::Error SurfaceImpl::getNextFrameId(EGLuint64KHR *frameId) const
83 {
84     UNREACHABLE();
85     return egl::EglBadDisplay();
86 }
87 
getSupportedTimestamps() const88 egl::SupportedTimestamps SurfaceImpl::getSupportedTimestamps() const
89 {
90     UNREACHABLE();
91     return egl::SupportedTimestamps();
92 }
93 
getFrameTimestamps(EGLuint64KHR frameId,EGLint numTimestamps,const EGLint * timestamps,EGLnsecsANDROID * values) const94 egl::Error SurfaceImpl::getFrameTimestamps(EGLuint64KHR frameId,
95                                            EGLint numTimestamps,
96                                            const EGLint *timestamps,
97                                            EGLnsecsANDROID *values) const
98 {
99     UNREACHABLE();
100     return egl::EglBadDisplay();
101 }
102 
swapWithFrameToken(const gl::Context * context,EGLFrameTokenANGLE frameToken)103 egl::Error SurfaceImpl::swapWithFrameToken(const gl::Context *context,
104                                            EGLFrameTokenANGLE frameToken)
105 {
106     UNREACHABLE();
107     return egl::EglBadDisplay();
108 }
109 
getUserWidth(const egl::Display * display,EGLint * value) const110 egl::Error SurfaceImpl::getUserWidth(const egl::Display *display, EGLint *value) const
111 {
112     *value = getWidth();
113     return egl::NoError();
114 }
115 
getUserHeight(const egl::Display * display,EGLint * value) const116 egl::Error SurfaceImpl::getUserHeight(const egl::Display *display, EGLint *value) const
117 {
118     *value = getHeight();
119     return egl::NoError();
120 }
121 
getBufferAge(const gl::Context * context,EGLint * age)122 egl::Error SurfaceImpl::getBufferAge(const gl::Context *context, EGLint *age)
123 {
124     *age = 0;
125     return egl::NoError();
126 }
127 
lockSurface(const egl::Display * display,EGLint usageHint,bool preservePixels,uint8_t ** bufferPtrOut,EGLint * bufferPitchOut)128 egl::Error SurfaceImpl::lockSurface(const egl::Display *display,
129                                     EGLint usageHint,
130                                     bool preservePixels,
131                                     uint8_t **bufferPtrOut,
132                                     EGLint *bufferPitchOut)
133 {
134     UNREACHABLE();
135     return egl::EglBadMatch();
136 }
137 
unlockSurface(const egl::Display * display,bool preservePixels)138 egl::Error SurfaceImpl::unlockSurface(const egl::Display *display, bool preservePixels)
139 {
140     UNREACHABLE();
141     return egl::EglBadMatch();
142 }
143 
origin() const144 EGLint SurfaceImpl::origin() const
145 {
146     return EGL_LOWER_LEFT_KHR;
147 }
148 
setRenderBuffer(EGLint renderBuffer)149 egl::Error SurfaceImpl::setRenderBuffer(EGLint renderBuffer)
150 {
151     return egl::NoError();
152 }
153 }  // namespace rx
154