Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
mock_epoxy.cc File Reference
#include "flutter/shell/platform/linux/testing/mock_epoxy.h"
#include <string.h>
#include <vector>
#include "flutter/fml/logging.h"

Go to the source code of this file.

Classes

struct  MockConfig
 
struct  MockDisplay
 
struct  MockContext
 
struct  MockSurface
 
struct  MockImage
 

Functions

static bool check_display (EGLDisplay dpy)
 
static bool check_initialized (EGLDisplay dpy)
 
static bool check_config (EGLConfig config)
 
static EGLBoolean bool_success ()
 
static EGLBoolean bool_failure (EGLint error)
 
EGLBoolean _eglBindAPI (EGLenum api)
 
EGLBoolean _eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config)
 
EGLContext _eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list)
 
EGLContext _eglGetCurrentContext ()
 
EGLSurface _eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list)
 
EGLSurface _eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list)
 
EGLBoolean _eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value)
 
EGLDisplay _eglGetDisplay (EGLNativeDisplayType display_id)
 
EGLDisplay _eglGetCurrentDisplay ()
 
EGLDisplay _eglGetPlatformDisplayEXT (EGLenum platform, void *native_display, const EGLint *attrib_list)
 
EGLint _eglGetError ()
 
EGLBoolean _eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor)
 
EGLBoolean _eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx)
 
EGLBoolean _eglQueryContext (EGLDisplay display, EGLContext context, EGLint attribute, EGLint *value)
 
EGLBoolean _eglSwapBuffers (EGLDisplay dpy, EGLSurface surface)
 
EGLImageKHR _eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list)
 
EGLBoolean _eglDestroyImageKHR (EGLDisplay dpy, EGLImage image)
 
static void _setEnable (GLenum cap, GLboolean value)
 
void _glAttachShader (GLuint program, GLuint shader)
 
static void _glBindFramebuffer (GLenum target, GLuint framebuffer)
 
static void _glBindRenderbuffer (GLenum target, GLuint framebuffer)
 
static void _glBindTexture (GLenum target, GLuint texture)
 
static void _glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
 
GLuint _glCreateProgram ()
 
void _glCompileShader (GLuint shader)
 
void _glClearColor (GLfloat r, GLfloat g, GLfloat b, GLfloat a)
 
GLuint _glCreateShader (GLenum shaderType)
 
void _glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers)
 
void _glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers)
 
void _glDeleteShader (GLuint shader)
 
void _glDeleteTextures (GLsizei n, const GLuint *textures)
 
static void _glDisable (GLenum cap)
 
static void _glEnable (GLenum cap)
 
static void _glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
 
static void _glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
 
static void _glGenTextures (GLsizei n, GLuint *textures)
 
static void _glGenFramebuffers (GLsizei n, GLuint *framebuffers)
 
static void _glGenRenderbuffers (GLsizei n, GLuint *renderbuffers)
 
static void _glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params)
 
static void _glGetIntegerv (GLenum pname, GLint *data)
 
static void _glGetProgramiv (GLuint program, GLenum pname, GLint *params)
 
static void _glGetProgramInfoLog (GLuint program, GLsizei maxLength, GLsizei *length, GLchar *infoLog)
 
static void _glGetShaderiv (GLuint shader, GLenum pname, GLint *params)
 
static void _glGetShaderInfoLog (GLuint shader, GLsizei maxLength, GLsizei *length, GLchar *infoLog)
 
static const GLubyte * _glGetString (GLenum pname)
 
static GLboolean _glIsEnabled (GLenum cap)
 
static void _glTexParameterf (GLenum target, GLenum pname, GLfloat param)
 
static void _glTexParameteri (GLenum target, GLenum pname, GLint param)
 
static void _glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels)
 
static GLenum _glGetError ()
 
void _glLinkProgram (GLuint program)
 
void _glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
 
void _glShaderSource (GLuint shader, GLsizei count, const GLchar *const *string, const GLint *length)
 
bool epoxy_has_gl_extension (const char *extension)
 
bool epoxy_is_desktop_gl (void)
 
int epoxy_gl_version (void)
 
static void library_init ()
 

Variables

static MockEpoxymock = nullptr
 
static bool display_initialized = false
 
static MockDisplay mock_display
 
static MockConfig mock_config
 
static MockContext mock_context
 
static MockSurface mock_surface
 
static MockImage mock_image
 
static EGLint mock_error = EGL_SUCCESS
 
void(*)(void) _eglGetProcAddress (const char *procname)
 
static GLuint bound_texture_2d
 
static std::map< GLenum, GLuint > framebuffer_renderbuffers
 
static GLboolean enable_blend = GL_FALSE
 
static GLboolean enable_scissor_test = GL_FALSE
 
EGLBoolean(* epoxy_eglBindAPI )(EGLenum api)
 
EGLBoolean(* epoxy_eglChooseConfig )(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config)
 
EGLContext(* epoxy_eglCreateContext )(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list)
 
EGLSurface(* epoxy_eglCreatePbufferSurface )(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list)
 
EGLSurface(* epoxy_eglCreateWindowSurface )(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list)
 
EGLBoolean(* epoxy_eglGetConfigAttrib )(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value)
 
EGLDisplay(* epoxy_eglGetDisplay )(EGLNativeDisplayType display_id)
 
EGLDisplay(* epoxy_eglGetPlatformDisplayEXT )(EGLenum platform, void *native_display, const EGLint *attrib_list)
 
EGLint(* epoxy_eglGetError )()
 
void(*(* epoxy_eglGetProcAddress )(const char *procname))(void)
 
EGLBoolean(* epoxy_eglInitialize )(EGLDisplay dpy, EGLint *major, EGLint *minor)
 
EGLBoolean(* epoxy_eglMakeCurrent )(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx)
 
EGLBoolean(* epoxy_eglSwapBuffers )(EGLDisplay dpy, EGLSurface surface)
 
EGLImageKHR(* epoxy_eglCreateImageKHR )(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list)
 
EGLBoolean(* epoxy_eglDestroyImageKHR )(EGLDisplay dpy, EGLImage image)
 
void(* epoxy_glAttachShader )(GLuint program, GLuint shader)
 
void(* epoxy_glBindFramebuffer )(GLenum target, GLuint framebuffer)
 
void(* epoxy_glBindRenderbuffer )(GLenum target, GLuint renderbuffer)
 
void(* epoxy_glBindTexture )(GLenum target, GLuint texture)
 
void(* epoxy_glBlitFramebuffer )(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
 
void(* epoxy_glCompileShader )(GLuint shader)
 
GLuint(* epoxy_glCreateProgram )()
 
GLuint(* epoxy_glCreateShader )(GLenum shaderType)
 
void(* epoxy_glDeleteFramebuffers )(GLsizei n, const GLuint *framebuffers)
 
void(* expoxy_glDeleteShader )(GLuint shader)
 
void(* epoxy_glDeleteTextures )(GLsizei n, const GLuint *textures)
 
void(* epoxy_glFramebufferRenderbuffer )(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
 
void(* epoxy_glFramebufferTexture2D )(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
 
void(* epoxy_glGetFramebufferAttachmentParameteriv )(GLenum target, GLenum attachment, GLenum pname, GLint *params)
 
void(* epoxy_glGenFramebuffers )(GLsizei n, GLuint *framebuffers)
 
void(* epoxy_glGenTextures )(GLsizei n, GLuint *textures)
 
void(* epoxy_glLinkProgram )(GLuint program)
 
void(* epoxy_glRenderbufferStorage )(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
 
void(* epoxy_glShaderSource )(GLuint shader, GLsizei count, const GLchar *const *string, const GLint *length)
 
void(* epoxy_glTexParameterf )(GLenum target, GLenum pname, GLfloat param)
 
void(* epoxy_glTexParameteri )(GLenum target, GLenum pname, GLint param)
 
void(* epoxy_glTexImage2D )(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels)
 
GLenum(* epoxy_glGetError )()
 

Function Documentation

◆ _eglBindAPI()

EGLBoolean _eglBindAPI ( EGLenum  api)

Definition at line 112 of file mock_epoxy.cc.

112 {
113 return bool_success();
114}
static EGLBoolean bool_success()

References bool_success().

Referenced by library_init().

◆ _eglChooseConfig()

EGLBoolean _eglChooseConfig ( EGLDisplay  dpy,
const EGLint *  attrib_list,
EGLConfig *  configs,
EGLint  config_size,
EGLint *  num_config 
)

Definition at line 116 of file mock_epoxy.cc.

120 {
121 if (!check_display(dpy) || !check_initialized(dpy)) {
122 return EGL_FALSE;
123 }
124
125 if (configs == nullptr) {
126 if (num_config != nullptr) {
127 *num_config = 1;
128 }
129 return bool_success();
130 }
131
132 EGLint n_returned = 0;
133 if (config_size >= 1) {
134 configs[0] = &mock_config;
135 n_returned++;
136 }
137
138 if (num_config != nullptr) {
139 *num_config = n_returned;
140 }
141
142 return bool_success();
143}
static bool check_initialized(EGLDisplay dpy)
Definition mock_epoxy.cc:84
static MockConfig mock_config
Definition mock_epoxy.cc:58
static bool check_display(EGLDisplay dpy)
Definition mock_epoxy.cc:75

References bool_success(), check_display(), check_initialized(), and mock_config.

Referenced by library_init().

◆ _eglCreateContext()

EGLContext _eglCreateContext ( EGLDisplay  dpy,
EGLConfig  config,
EGLContext  share_context,
const EGLint *  attrib_list 
)

Definition at line 145 of file mock_epoxy.cc.

148 {
149 if (!check_display(dpy) || !check_initialized(dpy) || !check_config(config)) {
150 return EGL_NO_CONTEXT;
151 }
152
153 mock_error = EGL_SUCCESS;
154 return &mock_context;
155}
static bool check_config(EGLConfig config)
Definition mock_epoxy.cc:93
static MockContext mock_context
Definition mock_epoxy.cc:59
static EGLint mock_error
Definition mock_epoxy.cc:63

References check_config(), check_display(), check_initialized(), mock_context, and mock_error.

Referenced by library_init().

◆ _eglCreateImageKHR()

EGLImageKHR _eglCreateImageKHR ( EGLDisplay  dpy,
EGLContext  ctx,
EGLenum  target,
EGLClientBuffer  buffer,
const EGLint *  attrib_list 
)

Definition at line 380 of file mock_epoxy.cc.

384 {
385 mock->eglCreateImageKHR(dpy, ctx, target, buffer, attrib_list);
386 return &mock_image;
387}
uint32_t * target
static MockImage mock_image
Definition mock_epoxy.cc:61
static MockEpoxy * mock
Definition mock_epoxy.cc:55

References mock, mock_image, and target.

Referenced by library_init().

◆ _eglCreatePbufferSurface()

EGLSurface _eglCreatePbufferSurface ( EGLDisplay  dpy,
EGLConfig  config,
const EGLint *  attrib_list 
)

Definition at line 161 of file mock_epoxy.cc.

163 {
164 if (!check_display(dpy) || !check_initialized(dpy) || !check_config(config)) {
165 return EGL_NO_SURFACE;
166 }
167
168 mock_error = EGL_SUCCESS;
169 return &mock_surface;
170}
static MockSurface mock_surface
Definition mock_epoxy.cc:60

References check_config(), check_display(), check_initialized(), mock_error, and mock_surface.

Referenced by library_init().

◆ _eglCreateWindowSurface()

EGLSurface _eglCreateWindowSurface ( EGLDisplay  dpy,
EGLConfig  config,
EGLNativeWindowType  win,
const EGLint *  attrib_list 
)

Definition at line 172 of file mock_epoxy.cc.

175 {
176 if (!check_display(dpy) || !check_initialized(dpy) || !check_config(config)) {
177 return EGL_NO_SURFACE;
178 }
179
180 mock_error = EGL_SUCCESS;
181 return &mock_surface;
182}

References check_config(), check_display(), check_initialized(), mock_error, and mock_surface.

Referenced by library_init().

◆ _eglDestroyImageKHR()

EGLBoolean _eglDestroyImageKHR ( EGLDisplay  dpy,
EGLImage  image 
)

Definition at line 389 of file mock_epoxy.cc.

389 {
390 return mock->eglDestroyImageKHR(dpy, image);
391}
FlutterVulkanImage * image

References image, and mock.

Referenced by library_init().

◆ _eglGetConfigAttrib()

EGLBoolean _eglGetConfigAttrib ( EGLDisplay  dpy,
EGLConfig  config,
EGLint  attribute,
EGLint *  value 
)

Definition at line 184 of file mock_epoxy.cc.

187 {
188 if (!check_display(dpy) || !check_initialized(dpy) || !check_config(config)) {
189 return EGL_FALSE;
190 }
191
192 MockConfig* c = static_cast<MockConfig*>(config);
193 switch (attribute) {
194 case EGL_CONFIG_ID:
195 *value = c->config_id;
196 return bool_success();
197 case EGL_BUFFER_SIZE:
198 *value = c->buffer_size;
199 return bool_success();
200 case EGL_COLOR_BUFFER_TYPE:
201 *value = c->color_buffer_type;
202 return bool_success();
203 case EGL_TRANSPARENT_TYPE:
204 *value = c->transparent_type;
205 return bool_success();
206 case EGL_LEVEL:
207 *value = c->level;
208 return bool_success();
209 case EGL_RED_SIZE:
210 *value = c->red_size;
211 return bool_success();
212 case EGL_GREEN_SIZE:
213 *value = c->green_size;
214 return bool_success();
215 case EGL_BLUE_SIZE:
216 *value = c->blue_size;
217 return bool_success();
218 case EGL_ALPHA_SIZE:
219 *value = c->alpha_size;
220 return bool_success();
221 case EGL_DEPTH_SIZE:
222 *value = c->depth_size;
223 return bool_success();
224 case EGL_STENCIL_SIZE:
225 *value = c->stencil_size;
226 return bool_success();
227 case EGL_SAMPLES:
228 *value = c->samples;
229 return bool_success();
230 case EGL_SAMPLE_BUFFERS:
231 *value = c->sample_buffers;
232 return bool_success();
233 case EGL_NATIVE_VISUAL_ID:
234 *value = c->native_visual_id;
235 return bool_success();
236 case EGL_NATIVE_VISUAL_TYPE:
237 *value = c->native_visual_type;
238 return bool_success();
239 case EGL_NATIVE_RENDERABLE:
240 *value = c->native_renderable;
241 return bool_success();
242 case EGL_CONFIG_CAVEAT:
243 *value = c->config_caveat;
244 return bool_success();
245 case EGL_BIND_TO_TEXTURE_RGB:
246 *value = c->bind_to_texture_rgb;
247 return bool_success();
248 case EGL_BIND_TO_TEXTURE_RGBA:
249 *value = c->bind_to_texture_rgba;
250 return bool_success();
251 case EGL_RENDERABLE_TYPE:
252 *value = c->renderable_type;
253 return bool_success();
254 case EGL_CONFORMANT:
255 *value = c->conformant;
256 return bool_success();
257 case EGL_SURFACE_TYPE:
258 *value = c->surface_type;
259 return bool_success();
260 case EGL_MAX_PBUFFER_WIDTH:
261 *value = c->max_pbuffer_width;
262 return bool_success();
263 case EGL_MAX_PBUFFER_HEIGHT:
264 *value = c->max_pbuffer_height;
265 return bool_success();
266 case EGL_MAX_PBUFFER_PIXELS:
267 *value = c->max_pbuffer_pixels;
268 return bool_success();
269 case EGL_MIN_SWAP_INTERVAL:
270 *value = c->min_swap_interval;
271 return bool_success();
272 case EGL_MAX_SWAP_INTERVAL:
273 *value = c->max_swap_interval;
274 return bool_success();
275 default:
276 return bool_failure(EGL_BAD_ATTRIBUTE);
277 }
278}
int32_t value
static EGLBoolean bool_failure(EGLint error)

References bool_failure(), bool_success(), c, check_config(), check_display(), check_initialized(), and value.

Referenced by library_init().

◆ _eglGetCurrentContext()

EGLContext _eglGetCurrentContext ( )

Definition at line 157 of file mock_epoxy.cc.

157 {
158 return &mock_context;
159}

References mock_context.

Referenced by library_init().

◆ _eglGetCurrentDisplay()

EGLDisplay _eglGetCurrentDisplay ( )

Definition at line 284 of file mock_epoxy.cc.

284 {
285 return &mock_display;
286}
static MockDisplay mock_display
Definition mock_epoxy.cc:57

References mock_display.

Referenced by library_init().

◆ _eglGetDisplay()

EGLDisplay _eglGetDisplay ( EGLNativeDisplayType  display_id)

Definition at line 280 of file mock_epoxy.cc.

280 {
281 return &mock_display;
282}

References mock_display.

Referenced by library_init().

◆ _eglGetError()

EGLint _eglGetError ( )

Definition at line 294 of file mock_epoxy.cc.

294 {
295 EGLint error = mock_error;
296 mock_error = EGL_SUCCESS;
297 return error;
298}
const uint8_t uint32_t uint32_t GError ** error

References error, and mock_error.

Referenced by library_init().

◆ _eglGetPlatformDisplayEXT()

EGLDisplay _eglGetPlatformDisplayEXT ( EGLenum  platform,
void *  native_display,
const EGLint *  attrib_list 
)

Definition at line 288 of file mock_epoxy.cc.

290 {
291 return &mock_display;
292}

References mock_display.

Referenced by library_init().

◆ _eglInitialize()

EGLBoolean _eglInitialize ( EGLDisplay  dpy,
EGLint *  major,
EGLint *  minor 
)

Definition at line 305 of file mock_epoxy.cc.

305 {
306 if (!check_display(dpy)) {
307 return EGL_FALSE;
308 }
309
310 if (!display_initialized) {
313 mock_config.color_buffer_type = EGL_RGB_BUFFER;
314 mock_config.transparent_type = EGL_NONE;
315 mock_config.level = 1;
327 mock_config.config_caveat = EGL_NONE;
330 mock_config.renderable_type = EGL_OPENGL_ES2_BIT;
331 mock_config.conformant = EGL_OPENGL_ES2_BIT;
332 mock_config.surface_type = EGL_WINDOW_BIT | EGL_PBUFFER_BIT;
335 mock_config.max_pbuffer_pixels = 1024 * 1024;
338 display_initialized = true;
339 }
340
341 if (major != nullptr) {
342 *major = 1;
343 }
344 if (minor != nullptr) {
345 *minor = 5;
346 }
347
348 return bool_success();
349}
static bool display_initialized
Definition mock_epoxy.cc:56
EGLint depth_size
Definition mock_epoxy.cc:23
EGLint renderable_type
Definition mock_epoxy.cc:33
EGLint native_renderable
Definition mock_epoxy.cc:29
EGLint bind_to_texture_rgba
Definition mock_epoxy.cc:32
EGLint native_visual_type
Definition mock_epoxy.cc:28
EGLint max_pbuffer_width
Definition mock_epoxy.cc:36
EGLint conformant
Definition mock_epoxy.cc:34
EGLint green_size
Definition mock_epoxy.cc:20
EGLint config_id
Definition mock_epoxy.cc:14
EGLint buffer_size
Definition mock_epoxy.cc:15
EGLint surface_type
Definition mock_epoxy.cc:35
EGLint level
Definition mock_epoxy.cc:18
EGLint config_caveat
Definition mock_epoxy.cc:30
EGLint color_buffer_type
Definition mock_epoxy.cc:16
EGLint min_swap_interval
Definition mock_epoxy.cc:39
EGLint native_visual_id
Definition mock_epoxy.cc:27
EGLint max_pbuffer_pixels
Definition mock_epoxy.cc:38
EGLint red_size
Definition mock_epoxy.cc:19
EGLint max_pbuffer_height
Definition mock_epoxy.cc:37
EGLint sample_buffers
Definition mock_epoxy.cc:26
EGLint max_swap_interval
Definition mock_epoxy.cc:40
EGLint stencil_size
Definition mock_epoxy.cc:24
EGLint samples
Definition mock_epoxy.cc:25
EGLint blue_size
Definition mock_epoxy.cc:21
EGLint alpha_size
Definition mock_epoxy.cc:22
EGLint transparent_type
Definition mock_epoxy.cc:17
EGLint bind_to_texture_rgb
Definition mock_epoxy.cc:31

References MockConfig::alpha_size, MockConfig::bind_to_texture_rgb, MockConfig::bind_to_texture_rgba, MockConfig::blue_size, bool_success(), MockConfig::buffer_size, check_display(), MockConfig::color_buffer_type, MockConfig::config_caveat, MockConfig::config_id, MockConfig::conformant, MockConfig::depth_size, display_initialized, MockConfig::green_size, MockConfig::level, MockConfig::max_pbuffer_height, MockConfig::max_pbuffer_pixels, MockConfig::max_pbuffer_width, MockConfig::max_swap_interval, MockConfig::min_swap_interval, mock_config, MockConfig::native_renderable, MockConfig::native_visual_id, MockConfig::native_visual_type, MockConfig::red_size, MockConfig::renderable_type, MockConfig::sample_buffers, MockConfig::samples, MockConfig::stencil_size, MockConfig::surface_type, and MockConfig::transparent_type.

Referenced by library_init().

◆ _eglMakeCurrent()

EGLBoolean _eglMakeCurrent ( EGLDisplay  dpy,
EGLSurface  draw,
EGLSurface  read,
EGLContext  ctx 
)

Definition at line 351 of file mock_epoxy.cc.

354 {
355 if (!check_display(dpy) || !check_initialized(dpy)) {
356 return EGL_FALSE;
357 }
358
359 return bool_success();
360}

References bool_success(), check_display(), and check_initialized().

Referenced by library_init().

◆ _eglQueryContext()

EGLBoolean _eglQueryContext ( EGLDisplay  display,
EGLContext  context,
EGLint  attribute,
EGLint *  value 
)

Definition at line 361 of file mock_epoxy.cc.

364 {
365 if (attribute == EGL_CONTEXT_CLIENT_TYPE) {
366 *value = EGL_OPENGL_API;
367 return EGL_TRUE;
368 }
369 return EGL_FALSE;
370}

References value.

Referenced by library_init().

◆ _eglSwapBuffers()

EGLBoolean _eglSwapBuffers ( EGLDisplay  dpy,
EGLSurface  surface 
)

Definition at line 372 of file mock_epoxy.cc.

372 {
373 if (!check_display(dpy) || !check_initialized(dpy)) {
374 return EGL_FALSE;
375 }
376
377 return bool_success();
378}

References bool_success(), check_display(), and check_initialized().

Referenced by library_init().

◆ _glAttachShader()

void _glAttachShader ( GLuint  program,
GLuint  shader 
)

Definition at line 408 of file mock_epoxy.cc.

408{}

Referenced by library_init().

◆ _glBindFramebuffer()

static void _glBindFramebuffer ( GLenum  target,
GLuint  framebuffer 
)
static

Definition at line 410 of file mock_epoxy.cc.

410{}

Referenced by library_init().

◆ _glBindRenderbuffer()

static void _glBindRenderbuffer ( GLenum  target,
GLuint  framebuffer 
)
static

Definition at line 412 of file mock_epoxy.cc.

412{}

Referenced by library_init().

◆ _glBindTexture()

static void _glBindTexture ( GLenum  target,
GLuint  texture 
)
static

Definition at line 414 of file mock_epoxy.cc.

414 {
415 if (target == GL_TEXTURE_2D) {
417 }
418}
static GLuint bound_texture_2d
FlTexture * texture

References bound_texture_2d, target, and texture.

Referenced by library_init().

◆ _glBlitFramebuffer()

static void _glBlitFramebuffer ( GLint  srcX0,
GLint  srcY0,
GLint  srcX1,
GLint  srcY1,
GLint  dstX0,
GLint  dstY0,
GLint  dstX1,
GLint  dstY1,
GLbitfield  mask,
GLenum  filter 
)
static

Definition at line 420 of file mock_epoxy.cc.

429 {
430 mock->glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1,
431 dstY1, mask, filter);
432}

References mock.

Referenced by library_init().

◆ _glClearColor()

void _glClearColor ( GLfloat  r,
GLfloat  g,
GLfloat  b,
GLfloat  a 
)

Definition at line 440 of file mock_epoxy.cc.

440 {
441 mock->glClearColor(r, g, b, a);
442}

References mock.

Referenced by library_init().

◆ _glCompileShader()

void _glCompileShader ( GLuint  shader)

Definition at line 438 of file mock_epoxy.cc.

438{}

Referenced by library_init().

◆ _glCreateProgram()

GLuint _glCreateProgram ( )

Definition at line 434 of file mock_epoxy.cc.

434 {
435 return 0;
436}

Referenced by library_init().

◆ _glCreateShader()

GLuint _glCreateShader ( GLenum  shaderType)

Definition at line 444 of file mock_epoxy.cc.

444 {
445 return 0;
446}

Referenced by library_init().

◆ _glDeleteFramebuffers()

void _glDeleteFramebuffers ( GLsizei  n,
const GLuint *  framebuffers 
)

Definition at line 448 of file mock_epoxy.cc.

448 {
449 if (mock) {
450 mock->glDeleteFramebuffers(n, framebuffers);
451 }
452}

References mock.

Referenced by library_init().

◆ _glDeleteRenderbuffers()

void _glDeleteRenderbuffers ( GLsizei  n,
const GLuint *  renderbuffers 
)

Definition at line 454 of file mock_epoxy.cc.

454 {
455 if (mock) {
456 mock->glDeleteRenderbuffers(n, renderbuffers);
457 }
458}

References mock.

Referenced by library_init().

◆ _glDeleteShader()

void _glDeleteShader ( GLuint  shader)

Definition at line 460 of file mock_epoxy.cc.

460{}

Referenced by library_init().

◆ _glDeleteTextures()

void _glDeleteTextures ( GLsizei  n,
const GLuint *  textures 
)

Definition at line 462 of file mock_epoxy.cc.

462 {
463 if (mock) {
464 mock->glDeleteTextures(n, textures);
465 }
466}

References mock.

Referenced by library_init().

◆ _glDisable()

static void _glDisable ( GLenum  cap)
static

Definition at line 468 of file mock_epoxy.cc.

468 {
469 _setEnable(cap, GL_FALSE);
470}
static void _setEnable(GLenum cap, GLboolean value)

References _setEnable().

Referenced by library_init().

◆ _glEnable()

static void _glEnable ( GLenum  cap)
static

Definition at line 472 of file mock_epoxy.cc.

472 {
473 _setEnable(cap, GL_TRUE);
474}

References _setEnable().

Referenced by library_init().

◆ _glFramebufferRenderbuffer()

static void _glFramebufferRenderbuffer ( GLenum  target,
GLenum  attachment,
GLenum  renderbuffertarget,
GLuint  renderbuffer 
)
static

Definition at line 476 of file mock_epoxy.cc.

479 {
480 framebuffer_renderbuffers[attachment] = renderbuffer;
481}
static std::map< GLenum, GLuint > framebuffer_renderbuffers

References framebuffer_renderbuffers.

Referenced by library_init().

◆ _glFramebufferTexture2D()

static void _glFramebufferTexture2D ( GLenum  target,
GLenum  attachment,
GLenum  textarget,
GLuint  texture,
GLint  level 
)
static

Definition at line 483 of file mock_epoxy.cc.

487 {}

Referenced by library_init().

◆ _glGenFramebuffers()

static void _glGenFramebuffers ( GLsizei  n,
GLuint *  framebuffers 
)
static

Definition at line 498 of file mock_epoxy.cc.

498 {
499 for (GLsizei i = 0; i < n; i++) {
500 framebuffers[i] = 0;
501 }
502 if (mock) {
503 mock->glGenFramebuffers(n, framebuffers);
504 }
505}

References i, and mock.

Referenced by library_init().

◆ _glGenRenderbuffers()

static void _glGenRenderbuffers ( GLsizei  n,
GLuint *  renderbuffers 
)
static

Definition at line 507 of file mock_epoxy.cc.

507 {
508 for (GLsizei i = 0; i < n; i++) {
509 renderbuffers[i] = 0;
510 }
511 if (mock) {
512 mock->glGenRenderbuffers(n, renderbuffers);
513 }
514}

References i, and mock.

Referenced by library_init().

◆ _glGenTextures()

static void _glGenTextures ( GLsizei  n,
GLuint *  textures 
)
static

Definition at line 489 of file mock_epoxy.cc.

489 {
490 for (GLsizei i = 0; i < n; i++) {
491 textures[i] = 0;
492 }
493 if (mock) {
494 mock->glGenTextures(n, textures);
495 }
496}

References i, and mock.

Referenced by library_init().

◆ _glGetError()

static GLenum _glGetError ( )
static

Definition at line 597 of file mock_epoxy.cc.

597 {
598 return GL_NO_ERROR;
599}

Referenced by library_init().

◆ _glGetFramebufferAttachmentParameteriv()

static void _glGetFramebufferAttachmentParameteriv ( GLenum  target,
GLenum  attachment,
GLenum  pname,
GLint *  params 
)
static

Definition at line 516 of file mock_epoxy.cc.

519 {
520 if (pname == GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) {
521 auto it = framebuffer_renderbuffers.find(attachment);
522 *params =
523 (it != framebuffer_renderbuffers.end()) ? GL_RENDERBUFFER : GL_NONE;
524 } else if (pname == GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) {
525 auto it = framebuffer_renderbuffers.find(attachment);
526 *params = (it != framebuffer_renderbuffers.end()) ? it->second : 0;
527 }
528}
const EmbeddedViewParams * params

References framebuffer_renderbuffers, and params.

Referenced by library_init().

◆ _glGetIntegerv()

static void _glGetIntegerv ( GLenum  pname,
GLint *  data 
)
static

Definition at line 530 of file mock_epoxy.cc.

530 {
531 if (pname == GL_TEXTURE_BINDING_2D) {
533 }
534}
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition switch_defs.h:36

References bound_texture_2d, and flutter::data.

Referenced by library_init().

◆ _glGetProgramInfoLog()

static void _glGetProgramInfoLog ( GLuint  program,
GLsizei  maxLength,
GLsizei *  length,
GLchar *  infoLog 
)
static

Definition at line 542 of file mock_epoxy.cc.

545 {}

Referenced by library_init().

◆ _glGetProgramiv()

static void _glGetProgramiv ( GLuint  program,
GLenum  pname,
GLint *  params 
)
static

Definition at line 536 of file mock_epoxy.cc.

536 {
537 if (pname == GL_LINK_STATUS) {
538 *params = GL_TRUE;
539 }
540}

References params.

Referenced by library_init().

◆ _glGetShaderInfoLog()

static void _glGetShaderInfoLog ( GLuint  shader,
GLsizei  maxLength,
GLsizei *  length,
GLchar *  infoLog 
)
static

Definition at line 553 of file mock_epoxy.cc.

556 {}

Referenced by library_init().

◆ _glGetShaderiv()

static void _glGetShaderiv ( GLuint  shader,
GLenum  pname,
GLint *  params 
)
static

Definition at line 547 of file mock_epoxy.cc.

547 {
548 if (pname == GL_COMPILE_STATUS) {
549 *params = GL_TRUE;
550 }
551}

References params.

Referenced by library_init().

◆ _glGetString()

static const GLubyte * _glGetString ( GLenum  pname)
static

Definition at line 558 of file mock_epoxy.cc.

558 {
559 return mock->glGetString(pname);
560}

References mock.

Referenced by library_init().

◆ _glIsEnabled()

static GLboolean _glIsEnabled ( GLenum  cap)
static

Definition at line 562 of file mock_epoxy.cc.

562 {
563 if (cap == GL_BLEND) {
564 return enable_blend;
565 } else if (cap == GL_SCISSOR_TEST) {
566 return enable_scissor_test;
567 } else {
568 return GL_FALSE;
569 }
570}
static GLboolean enable_blend
static GLboolean enable_scissor_test

References enable_blend, and enable_scissor_test.

Referenced by library_init().

◆ _glLinkProgram()

void _glLinkProgram ( GLuint  program)

Definition at line 601 of file mock_epoxy.cc.

601{}

Referenced by library_init().

◆ _glRenderbufferStorage()

void _glRenderbufferStorage ( GLenum  target,
GLenum  internalformat,
GLsizei  width,
GLsizei  height 
)

Definition at line 603 of file mock_epoxy.cc.

606 {}

Referenced by library_init().

◆ _glShaderSource()

void _glShaderSource ( GLuint  shader,
GLsizei  count,
const GLchar *const *  string,
const GLint *  length 
)

Definition at line 608 of file mock_epoxy.cc.

611 {}

Referenced by library_init().

◆ _glTexImage2D()

static void _glTexImage2D ( GLenum  target,
GLint  level,
GLint  internalformat,
GLsizei  width,
GLsizei  height,
GLint  border,
GLenum  format,
GLenum  type,
const void *  pixels 
)
static

Definition at line 576 of file mock_epoxy.cc.

584 {
585 if (pixels != nullptr) {
586 FML_CHECK(internalformat == GL_RGBA || internalformat == GL_RGBA8);
587 FML_CHECK(format == GL_RGBA);
588 FML_CHECK(type == GL_UNSIGNED_BYTE);
589
590 // Simple mock read to detect out-of-bounds reads in tests.
591 size_t size = width * height * 4;
592 std::vector<uint8_t> temp(size);
593 memcpy(temp.data(), pixels, size);
594 }
595}
#define FML_CHECK(condition)
Definition logging.h:104
it will be possible to load the file into Perfetto s trace viewer use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
impeller::ShaderType type
int32_t height
int32_t width

References FML_CHECK, format, height, flutter::size, type, and width.

Referenced by library_init().

◆ _glTexParameterf()

static void _glTexParameterf ( GLenum  target,
GLenum  pname,
GLfloat  param 
)
static

Definition at line 572 of file mock_epoxy.cc.

572{}

Referenced by library_init().

◆ _glTexParameteri()

static void _glTexParameteri ( GLenum  target,
GLenum  pname,
GLint  param 
)
static

Definition at line 574 of file mock_epoxy.cc.

574{}

Referenced by library_init().

◆ _setEnable()

static void _setEnable ( GLenum  cap,
GLboolean  value 
)
static

Definition at line 400 of file mock_epoxy.cc.

400 {
401 if (cap == GL_BLEND) {
403 } else if (cap == GL_SCISSOR_TEST) {
405 }
406}

References enable_blend, enable_scissor_test, and value.

Referenced by _glDisable(), and _glEnable().

◆ bool_failure()

static EGLBoolean bool_failure ( EGLint  error)
static

Definition at line 107 of file mock_epoxy.cc.

107 {
109 return EGL_FALSE;
110}

References error, and mock_error.

Referenced by _eglGetConfigAttrib().

◆ bool_success()

static EGLBoolean bool_success ( )
static

Definition at line 102 of file mock_epoxy.cc.

102 {
103 mock_error = EGL_SUCCESS;
104 return EGL_TRUE;
105}

References mock_error.

Referenced by _eglBindAPI(), _eglChooseConfig(), _eglGetConfigAttrib(), _eglInitialize(), _eglMakeCurrent(), and _eglSwapBuffers().

◆ check_config()

static bool check_config ( EGLConfig  config)
static

Definition at line 93 of file mock_epoxy.cc.

93 {
94 if (config == nullptr) {
95 mock_error = EGL_BAD_CONFIG;
96 return false;
97 }
98
99 return true;
100}

References mock_error.

Referenced by _eglCreateContext(), _eglCreatePbufferSurface(), _eglCreateWindowSurface(), and _eglGetConfigAttrib().

◆ check_display()

static bool check_display ( EGLDisplay  dpy)
static

Definition at line 75 of file mock_epoxy.cc.

75 {
76 if (dpy == nullptr) {
77 mock_error = EGL_BAD_DISPLAY;
78 return false;
79 }
80
81 return true;
82}

References mock_error.

Referenced by _eglChooseConfig(), _eglCreateContext(), _eglCreatePbufferSurface(), _eglCreateWindowSurface(), _eglGetConfigAttrib(), _eglInitialize(), _eglMakeCurrent(), and _eglSwapBuffers().

◆ check_initialized()

static bool check_initialized ( EGLDisplay  dpy)
static

Definition at line 84 of file mock_epoxy.cc.

84 {
86 mock_error = EGL_NOT_INITIALIZED;
87 return false;
88 }
89
90 return true;
91}

References display_initialized, and mock_error.

Referenced by _eglChooseConfig(), _eglCreateContext(), _eglCreatePbufferSurface(), _eglCreateWindowSurface(), _eglGetConfigAttrib(), _eglMakeCurrent(), and _eglSwapBuffers().

◆ epoxy_gl_version()

int epoxy_gl_version ( void  )

Definition at line 621 of file mock_epoxy.cc.

621 {
622 return mock->epoxy_gl_version();
623}

References mock.

Referenced by TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().

◆ epoxy_has_gl_extension()

bool epoxy_has_gl_extension ( const char *  extension)

Definition at line 613 of file mock_epoxy.cc.

613 {
614 return mock->epoxy_has_gl_extension(extension);
615}

References mock.

Referenced by create_opengl_backing_store(), fl_compositor_opengl_present_layers(), and TEST_F().

◆ epoxy_is_desktop_gl()

bool epoxy_is_desktop_gl ( void  )

Definition at line 617 of file mock_epoxy.cc.

617 {
618 return mock->epoxy_is_desktop_gl();
619}

References mock.

Referenced by TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().

◆ library_init()

static void library_init ( )
static

Definition at line 742 of file mock_epoxy.cc.

742 {
746 epoxy_eglGetCurrentContext = _eglGetCurrentContext;
751 epoxy_eglGetCurrentDisplay = _eglGetCurrentDisplay;
757 epoxy_eglQueryContext = _eglQueryContext;
761
768 epoxy_glClearColor = _glClearColor;
772 epoxy_glDeleteRenderbuffers = _glDeleteRenderbuffers;
773 epoxy_glDeleteShader = _glDeleteShader;
775 epoxy_glDisable = _glDisable;
776 epoxy_glEnable = _glEnable;
780 epoxy_glGenRenderbuffers = _glGenRenderbuffers;
784 epoxy_glGetIntegerv = _glGetIntegerv;
785 epoxy_glGetProgramiv = _glGetProgramiv;
786 epoxy_glGetProgramInfoLog = _glGetProgramInfoLog;
787 epoxy_glGetShaderiv = _glGetShaderiv;
788 epoxy_glGetShaderInfoLog = _glGetShaderInfoLog;
789 epoxy_glGetString = _glGetString;
790 epoxy_glIsEnabled = _glIsEnabled;
798}
void(* epoxy_glCompileShader)(GLuint shader)
static void _glGenFramebuffers(GLsizei n, GLuint *framebuffers)
GLuint(* epoxy_glCreateProgram)()
void(* epoxy_glRenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
void(* epoxy_glBindTexture)(GLenum target, GLuint texture)
EGLBoolean _eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value)
EGLSurface(* epoxy_eglCreateWindowSurface)(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list)
EGLBoolean _eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config)
void(* epoxy_glGetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint *params)
void _glShaderSource(GLuint shader, GLsizei count, const GLchar *const *string, const GLint *length)
void _glClearColor(GLfloat r, GLfloat g, GLfloat b, GLfloat a)
void(* epoxy_glShaderSource)(GLuint shader, GLsizei count, const GLchar *const *string, const GLint *length)
void(* epoxy_glDeleteTextures)(GLsizei n, const GLuint *textures)
EGLBoolean _eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
static void _glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
EGLBoolean _eglQueryContext(EGLDisplay display, EGLContext context, EGLint attribute, EGLint *value)
void(* epoxy_glBindRenderbuffer)(GLenum target, GLuint renderbuffer)
void _glDeleteShader(GLuint shader)
static void _glGetProgramiv(GLuint program, GLenum pname, GLint *params)
void(* epoxy_glGenFramebuffers)(GLsizei n, GLuint *framebuffers)
void(* epoxy_glAttachShader)(GLuint program, GLuint shader)
static void _glGetProgramInfoLog(GLuint program, GLsizei maxLength, GLsizei *length, GLchar *infoLog)
void(* epoxy_glTexParameteri)(GLenum target, GLenum pname, GLint param)
EGLImageKHR(* epoxy_eglCreateImageKHR)(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list)
static void _glGenRenderbuffers(GLsizei n, GLuint *renderbuffers)
static void _glBindRenderbuffer(GLenum target, GLuint framebuffer)
static void _glEnable(GLenum cap)
void(* epoxy_glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels)
static void _glTexParameteri(GLenum target, GLenum pname, GLint param)
static void _glTexParameterf(GLenum target, GLenum pname, GLfloat param)
EGLBoolean(* epoxy_eglDestroyImageKHR)(EGLDisplay dpy, EGLImage image)
void(*(* epoxy_eglGetProcAddress)(const char *procname))(void)
EGLSurface _eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list)
EGLBoolean _eglBindAPI(EGLenum api)
EGLContext(* epoxy_eglCreateContext)(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list)
static void _glGetShaderInfoLog(GLuint shader, GLsizei maxLength, GLsizei *length, GLchar *infoLog)
EGLImageKHR _eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list)
static void _glBindFramebuffer(GLenum target, GLuint framebuffer)
GLuint(* epoxy_glCreateShader)(GLenum shaderType)
static void _glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint *params)
EGLBoolean(* epoxy_eglGetConfigAttrib)(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value)
void _glDeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers)
static GLboolean _glIsEnabled(GLenum cap)
EGLint _eglGetError()
GLuint _glCreateShader(GLenum shaderType)
void _glAttachShader(GLuint program, GLuint shader)
static const GLubyte * _glGetString(GLenum pname)
static void _glGetShaderiv(GLuint shader, GLenum pname, GLint *params)
void(* epoxy_glDeleteFramebuffers)(GLsizei n, const GLuint *framebuffers)
void(* epoxy_glTexParameterf)(GLenum target, GLenum pname, GLfloat param)
EGLBoolean(* epoxy_eglInitialize)(EGLDisplay dpy, EGLint *major, EGLint *minor)
static void _glBindTexture(GLenum target, GLuint texture)
EGLDisplay _eglGetDisplay(EGLNativeDisplayType display_id)
GLuint _glCreateProgram()
void(* epoxy_glGenTextures)(GLsizei n, GLuint *textures)
void _glDeleteTextures(GLsizei n, const GLuint *textures)
EGLBoolean _eglDestroyImageKHR(EGLDisplay dpy, EGLImage image)
void(* epoxy_glBindFramebuffer)(GLenum target, GLuint framebuffer)
EGLContext _eglGetCurrentContext()
EGLSurface _eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list)
EGLSurface(* epoxy_eglCreatePbufferSurface)(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list)
void _glDeleteFramebuffers(GLsizei n, const GLuint *framebuffers)
static void _glGenTextures(GLsizei n, GLuint *textures)
void _glCompileShader(GLuint shader)
EGLDisplay(* epoxy_eglGetPlatformDisplayEXT)(EGLenum platform, void *native_display, const EGLint *attrib_list)
void(*)(void) _eglGetProcAddress(const char *procname)
void(* epoxy_glFramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
EGLDisplay(* epoxy_eglGetDisplay)(EGLNativeDisplayType display_id)
EGLint(* epoxy_eglGetError)()
static void _glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
static void _glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels)
void(* epoxy_glLinkProgram)(GLuint program)
GLenum(* epoxy_glGetError)()
EGLDisplay _eglGetPlatformDisplayEXT(EGLenum platform, void *native_display, const EGLint *attrib_list)
static void _glDisable(GLenum cap)
static void _glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
EGLBoolean(* epoxy_eglSwapBuffers)(EGLDisplay dpy, EGLSurface surface)
EGLContext _eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list)
EGLBoolean _eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx)
EGLBoolean(* epoxy_eglMakeCurrent)(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx)
EGLBoolean(* epoxy_eglBindAPI)(EGLenum api)
static void _glGetIntegerv(GLenum pname, GLint *data)
EGLDisplay _eglGetCurrentDisplay()
EGLBoolean(* epoxy_eglChooseConfig)(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config)
void _glLinkProgram(GLuint program)
void(* epoxy_glFramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
EGLBoolean _eglSwapBuffers(EGLDisplay dpy, EGLSurface surface)
void _glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
void(* epoxy_glBlitFramebuffer)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
static GLenum _glGetError()

References _eglBindAPI(), _eglChooseConfig(), _eglCreateContext(), _eglCreateImageKHR(), _eglCreatePbufferSurface(), _eglCreateWindowSurface(), _eglDestroyImageKHR(), _eglGetConfigAttrib(), _eglGetCurrentContext(), _eglGetCurrentDisplay(), _eglGetDisplay(), _eglGetError(), _eglGetPlatformDisplayEXT(), _eglGetProcAddress, _eglInitialize(), _eglMakeCurrent(), _eglQueryContext(), _eglSwapBuffers(), _glAttachShader(), _glBindFramebuffer(), _glBindRenderbuffer(), _glBindTexture(), _glBlitFramebuffer(), _glClearColor(), _glCompileShader(), _glCreateProgram(), _glCreateShader(), _glDeleteFramebuffers(), _glDeleteRenderbuffers(), _glDeleteShader(), _glDeleteTextures(), _glDisable(), _glEnable(), _glFramebufferRenderbuffer(), _glFramebufferTexture2D(), _glGenFramebuffers(), _glGenRenderbuffers(), _glGenTextures(), _glGetError(), _glGetFramebufferAttachmentParameteriv(), _glGetIntegerv(), _glGetProgramInfoLog(), _glGetProgramiv(), _glGetShaderInfoLog(), _glGetShaderiv(), _glGetString(), _glIsEnabled(), _glLinkProgram(), _glRenderbufferStorage(), _glShaderSource(), _glTexImage2D(), _glTexParameterf(), _glTexParameteri(), epoxy_eglBindAPI, epoxy_eglChooseConfig, epoxy_eglCreateContext, epoxy_eglCreateImageKHR, epoxy_eglCreatePbufferSurface, epoxy_eglCreateWindowSurface, epoxy_eglDestroyImageKHR, epoxy_eglGetConfigAttrib, epoxy_eglGetDisplay, epoxy_eglGetError, epoxy_eglGetPlatformDisplayEXT, epoxy_eglGetProcAddress, epoxy_eglInitialize, epoxy_eglMakeCurrent, epoxy_eglSwapBuffers, epoxy_glAttachShader, epoxy_glBindFramebuffer, epoxy_glBindRenderbuffer, epoxy_glBindTexture, epoxy_glBlitFramebuffer, epoxy_glCompileShader, epoxy_glCreateProgram, epoxy_glCreateShader, epoxy_glDeleteFramebuffers, epoxy_glDeleteTextures, epoxy_glFramebufferRenderbuffer, epoxy_glFramebufferTexture2D, epoxy_glGenFramebuffers, epoxy_glGenTextures, epoxy_glGetError, epoxy_glGetFramebufferAttachmentParameteriv, epoxy_glLinkProgram, epoxy_glRenderbufferStorage, epoxy_glShaderSource, epoxy_glTexImage2D, epoxy_glTexParameterf, and epoxy_glTexParameteri.

Variable Documentation

◆ _eglGetProcAddress

void(*)(void) _eglGetProcAddress(const char *procname) ( const char *  procname)

Definition at line 300 of file mock_epoxy.cc.

300 {
301 mock_error = EGL_SUCCESS;
302 return nullptr;
303}

Referenced by library_init().

◆ bound_texture_2d

GLuint bound_texture_2d
static

Definition at line 393 of file mock_epoxy.cc.

Referenced by _glBindTexture(), and _glGetIntegerv().

◆ display_initialized

bool display_initialized = false
static

Definition at line 56 of file mock_epoxy.cc.

Referenced by _eglInitialize(), and check_initialized().

◆ enable_blend

GLboolean enable_blend = GL_FALSE
static

Definition at line 397 of file mock_epoxy.cc.

Referenced by _glIsEnabled(), and _setEnable().

◆ enable_scissor_test

GLboolean enable_scissor_test = GL_FALSE
static

Definition at line 398 of file mock_epoxy.cc.

Referenced by _glIsEnabled(), and _setEnable().

◆ epoxy_eglBindAPI

EGLBoolean(* epoxy_eglBindAPI) (EGLenum api) ( EGLenum  api)

Definition at line 645 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_eglChooseConfig

EGLBoolean(* epoxy_eglChooseConfig) (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config) ( EGLDisplay  dpy,
const EGLint *  attrib_list,
EGLConfig *  configs,
EGLint  config_size,
EGLint *  num_config 
)

Definition at line 646 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_eglCreateContext

EGLContext(* epoxy_eglCreateContext) (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list) ( EGLDisplay  dpy,
EGLConfig  config,
EGLContext  share_context,
const EGLint *  attrib_list 
)

Definition at line 651 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_eglCreateImageKHR

EGLImageKHR(* epoxy_eglCreateImageKHR) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list) ( EGLDisplay  dpy,
EGLContext  ctx,
EGLenum  target,
EGLClientBuffer  buffer,
const EGLint *  attrib_list 
)

Definition at line 678 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_eglCreatePbufferSurface

EGLSurface(* epoxy_eglCreatePbufferSurface) (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list) ( EGLDisplay  dpy,
EGLConfig  config,
const EGLint *  attrib_list 
)

Definition at line 655 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_eglCreateWindowSurface

EGLSurface(* epoxy_eglCreateWindowSurface) (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list) ( EGLDisplay  dpy,
EGLConfig  config,
EGLNativeWindowType  win,
const EGLint *  attrib_list 
)

Definition at line 658 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_eglDestroyImageKHR

EGLBoolean(* epoxy_eglDestroyImageKHR) (EGLDisplay dpy, EGLImage image) ( EGLDisplay  dpy,
EGLImage  image 
)

Definition at line 683 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_eglGetConfigAttrib

EGLBoolean(* epoxy_eglGetConfigAttrib) (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value) ( EGLDisplay  dpy,
EGLConfig  config,
EGLint  attribute,
EGLint *  value 
)

Definition at line 662 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_eglGetDisplay

EGLDisplay(* epoxy_eglGetDisplay) (EGLNativeDisplayType display_id) ( EGLNativeDisplayType  display_id)

Definition at line 666 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_eglGetError

EGLint(* epoxy_eglGetError) () ( )

Definition at line 670 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_eglGetPlatformDisplayEXT

EGLDisplay(* epoxy_eglGetPlatformDisplayEXT) (EGLenum platform, void *native_display, const EGLint *attrib_list) ( EGLenum  platform,
void *  native_display,
const EGLint *  attrib_list 
)

Definition at line 667 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_eglGetProcAddress

void(*(* epoxy_eglGetProcAddress) (const char *procname))(void) ( const char *  procname)

Definition at line 671 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_eglInitialize

EGLBoolean(* epoxy_eglInitialize) (EGLDisplay dpy, EGLint *major, EGLint *minor) ( EGLDisplay  dpy,
EGLint *  major,
EGLint *  minor 
)

Definition at line 672 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_eglMakeCurrent

EGLBoolean(* epoxy_eglMakeCurrent) (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx) ( EGLDisplay  dpy,
EGLSurface  draw,
EGLSurface  read,
EGLContext  ctx 
)

Definition at line 673 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_eglSwapBuffers

EGLBoolean(* epoxy_eglSwapBuffers) (EGLDisplay dpy, EGLSurface surface) ( EGLDisplay  dpy,
EGLSurface  surface 
)

Definition at line 677 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_glAttachShader

void(* epoxy_glAttachShader) (GLuint program, GLuint shader) ( GLuint  program,
GLuint  shader 
)

Definition at line 685 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_glBindFramebuffer

void(* epoxy_glBindFramebuffer) (GLenum target, GLuint framebuffer) ( GLenum  target,
GLuint  framebuffer 
)

Definition at line 686 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_glBindRenderbuffer

void(* epoxy_glBindRenderbuffer) (GLenum target, GLuint renderbuffer) ( GLenum  target,
GLuint  renderbuffer 
)

Definition at line 687 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_glBindTexture

void(* epoxy_glBindTexture) (GLenum target, GLuint texture) ( GLenum  target,
GLuint  texture 
)

Definition at line 688 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_glBlitFramebuffer

void(* epoxy_glBlitFramebuffer) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) ( GLint  srcX0,
GLint  srcY0,
GLint  srcX1,
GLint  srcY1,
GLint  dstX0,
GLint  dstY0,
GLint  dstX1,
GLint  dstY1,
GLbitfield  mask,
GLenum  filter 
)

Definition at line 689 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_glCompileShader

void(* epoxy_glCompileShader) (GLuint shader) ( GLuint  shader)

Definition at line 699 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_glCreateProgram

GLuint(* epoxy_glCreateProgram) () ( )

Definition at line 700 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_glCreateShader

GLuint(* epoxy_glCreateShader) (GLenum shaderType) ( GLenum  shaderType)

Definition at line 701 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_glDeleteFramebuffers

void(* epoxy_glDeleteFramebuffers) (GLsizei n, const GLuint *framebuffers) ( GLsizei  n,
const GLuint *  framebuffers 
)

Definition at line 702 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_glDeleteTextures

void(* epoxy_glDeleteTextures) (GLsizei n, const GLuint *textures) ( GLsizei  n,
const GLuint *  textures 
)

Definition at line 704 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_glFramebufferRenderbuffer

void(* epoxy_glFramebufferRenderbuffer) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) ( GLenum  target,
GLenum  attachment,
GLenum  renderbuffertarget,
GLuint  renderbuffer 
)

Definition at line 705 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_glFramebufferTexture2D

void(* epoxy_glFramebufferTexture2D) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) ( GLenum  target,
GLenum  attachment,
GLenum  textarget,
GLuint  texture,
GLint  level 
)

Definition at line 709 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_glGenFramebuffers

void(* epoxy_glGenFramebuffers) (GLsizei n, GLuint *framebuffers) ( GLsizei  n,
GLuint *  framebuffers 
)

Definition at line 718 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_glGenTextures

void(* epoxy_glGenTextures) (GLsizei n, GLuint *textures) ( GLsizei  n,
GLuint *  textures 
)

Definition at line 719 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_glGetError

GLenum(* epoxy_glGetError) () ( )

Definition at line 740 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_glGetFramebufferAttachmentParameteriv

void(* epoxy_glGetFramebufferAttachmentParameteriv) (GLenum target, GLenum attachment, GLenum pname, GLint *params) ( GLenum  target,
GLenum  attachment,
GLenum  pname,
GLint *  params 
)

Definition at line 714 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_glLinkProgram

void(* epoxy_glLinkProgram) (GLuint program) ( GLuint  program)

Definition at line 720 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_glRenderbufferStorage

void(* epoxy_glRenderbufferStorage) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height) ( GLenum  target,
GLenum  internalformat,
GLsizei  width,
GLsizei  height 
)

Definition at line 721 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_glShaderSource

void(* epoxy_glShaderSource) (GLuint shader, GLsizei count, const GLchar *const *string, const GLint *length) ( GLuint  shader,
GLsizei  count,
const GLchar *const *  string,
const GLint *  length 
)

Definition at line 725 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_glTexImage2D

void(* epoxy_glTexImage2D) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels) ( GLenum  target,
GLint  level,
GLint  internalformat,
GLsizei  width,
GLsizei  height,
GLint  border,
GLenum  format,
GLenum  type,
const void *  pixels 
)

Definition at line 731 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_glTexParameterf

void(* epoxy_glTexParameterf) (GLenum target, GLenum pname, GLfloat param) ( GLenum  target,
GLenum  pname,
GLfloat  param 
)

Definition at line 729 of file mock_epoxy.cc.

Referenced by library_init().

◆ epoxy_glTexParameteri

void(* epoxy_glTexParameteri) (GLenum target, GLenum pname, GLint param) ( GLenum  target,
GLenum  pname,
GLint  param 
)

Definition at line 730 of file mock_epoxy.cc.

Referenced by library_init().

◆ expoxy_glDeleteShader

void(* expoxy_glDeleteShader) (GLuint shader) ( GLuint  shader)

Definition at line 703 of file mock_epoxy.cc.

◆ framebuffer_renderbuffers

std::map<GLenum, GLuint> framebuffer_renderbuffers
static

◆ mock

◆ mock_config

MockConfig mock_config
static

Definition at line 58 of file mock_epoxy.cc.

Referenced by _eglChooseConfig(), and _eglInitialize().

◆ mock_context

MockContext mock_context
static

Definition at line 59 of file mock_epoxy.cc.

Referenced by _eglCreateContext(), and _eglGetCurrentContext().

◆ mock_display

MockDisplay mock_display
static

Definition at line 57 of file mock_epoxy.cc.

Referenced by _eglGetCurrentDisplay(), _eglGetDisplay(), and _eglGetPlatformDisplayEXT().

◆ mock_error

◆ mock_image

MockImage mock_image
static

Definition at line 61 of file mock_epoxy.cc.

Referenced by _eglCreateImageKHR().

◆ mock_surface

MockSurface mock_surface
static

Definition at line 60 of file mock_epoxy.cc.

Referenced by _eglCreatePbufferSurface(), and _eglCreateWindowSurface().