mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-15 08:56:26 -05:00
Make sure we don't use others' prefixes
This commit is contained in:
parent
f9f75a1362
commit
71ca45e2c0
33 changed files with 207 additions and 203 deletions
|
|
@ -34,7 +34,7 @@ static void gles2_begin(struct wlr_renderer *wlr_renderer, uint32_t width,
|
|||
struct wlr_gles2_renderer *renderer =
|
||||
gles2_get_renderer_in_context(wlr_renderer);
|
||||
|
||||
GLES2_DEBUG_PUSH;
|
||||
PUSH_GLES2_DEBUG;
|
||||
|
||||
glViewport(0, 0, width, height);
|
||||
renderer->viewport_width = width;
|
||||
|
|
@ -47,7 +47,7 @@ static void gles2_begin(struct wlr_renderer *wlr_renderer, uint32_t width,
|
|||
// XXX: maybe we should save output projection and remove some of the need
|
||||
// for users to sling matricies themselves
|
||||
|
||||
GLES2_DEBUG_POP;
|
||||
POP_GLES2_DEBUG;
|
||||
}
|
||||
|
||||
static void gles2_end(struct wlr_renderer *wlr_renderer) {
|
||||
|
|
@ -59,10 +59,10 @@ static void gles2_clear(struct wlr_renderer *wlr_renderer,
|
|||
const float color[static 4]) {
|
||||
gles2_get_renderer_in_context(wlr_renderer);
|
||||
|
||||
GLES2_DEBUG_PUSH;
|
||||
PUSH_GLES2_DEBUG;
|
||||
glClearColor(color[0], color[1], color[2], color[3]);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
GLES2_DEBUG_POP;
|
||||
POP_GLES2_DEBUG;
|
||||
}
|
||||
|
||||
static void gles2_scissor(struct wlr_renderer *wlr_renderer,
|
||||
|
|
@ -70,7 +70,7 @@ static void gles2_scissor(struct wlr_renderer *wlr_renderer,
|
|||
struct wlr_gles2_renderer *renderer =
|
||||
gles2_get_renderer_in_context(wlr_renderer);
|
||||
|
||||
GLES2_DEBUG_PUSH;
|
||||
PUSH_GLES2_DEBUG;
|
||||
if (box != NULL) {
|
||||
struct wlr_box gl_box;
|
||||
wlr_box_transform(box, WL_OUTPUT_TRANSFORM_FLIPPED_180,
|
||||
|
|
@ -81,7 +81,7 @@ static void gles2_scissor(struct wlr_renderer *wlr_renderer,
|
|||
} else {
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
}
|
||||
GLES2_DEBUG_POP;
|
||||
POP_GLES2_DEBUG;
|
||||
}
|
||||
|
||||
static void draw_quad() {
|
||||
|
|
@ -116,7 +116,7 @@ static bool gles2_render_texture_with_matrix(struct wlr_renderer *wlr_renderer,
|
|||
struct wlr_gles2_renderer *renderer =
|
||||
gles2_get_renderer_in_context(wlr_renderer);
|
||||
struct wlr_gles2_texture *texture =
|
||||
gles2_get_texture_in_context(wlr_texture);
|
||||
get_gles2_texture_in_context(wlr_texture);
|
||||
|
||||
GLuint prog = 0;
|
||||
GLenum target = 0;
|
||||
|
|
@ -139,7 +139,7 @@ static bool gles2_render_texture_with_matrix(struct wlr_renderer *wlr_renderer,
|
|||
float transposition[9];
|
||||
wlr_matrix_transpose(transposition, matrix);
|
||||
|
||||
GLES2_DEBUG_PUSH;
|
||||
PUSH_GLES2_DEBUG;
|
||||
|
||||
GLuint tex_id = texture->type == WLR_GLES2_TEXTURE_GLTEX ?
|
||||
texture->gl_tex : texture->image_tex;
|
||||
|
|
@ -157,7 +157,7 @@ static bool gles2_render_texture_with_matrix(struct wlr_renderer *wlr_renderer,
|
|||
|
||||
draw_quad();
|
||||
|
||||
GLES2_DEBUG_POP;
|
||||
POP_GLES2_DEBUG;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -172,12 +172,12 @@ static void gles2_render_quad_with_matrix(struct wlr_renderer *wlr_renderer,
|
|||
float transposition[9];
|
||||
wlr_matrix_transpose(transposition, matrix);
|
||||
|
||||
GLES2_DEBUG_PUSH;
|
||||
PUSH_GLES2_DEBUG;
|
||||
glUseProgram(renderer->shaders.quad);
|
||||
glUniformMatrix3fv(0, 1, GL_FALSE, transposition);
|
||||
glUniform4f(1, color[0], color[1], color[2], color[3]);
|
||||
draw_quad();
|
||||
GLES2_DEBUG_POP;
|
||||
POP_GLES2_DEBUG;
|
||||
}
|
||||
|
||||
static void gles2_render_ellipse_with_matrix(struct wlr_renderer *wlr_renderer,
|
||||
|
|
@ -190,17 +190,17 @@ static void gles2_render_ellipse_with_matrix(struct wlr_renderer *wlr_renderer,
|
|||
float transposition[9];
|
||||
wlr_matrix_transpose(transposition, matrix);
|
||||
|
||||
GLES2_DEBUG_PUSH;
|
||||
PUSH_GLES2_DEBUG;
|
||||
glUseProgram(renderer->shaders.ellipse);
|
||||
glUniformMatrix3fv(0, 1, GL_FALSE, transposition);
|
||||
glUniform4f(1, color[0], color[1], color[2], color[3]);
|
||||
draw_quad();
|
||||
GLES2_DEBUG_POP;
|
||||
POP_GLES2_DEBUG;
|
||||
}
|
||||
|
||||
static const enum wl_shm_format *gles2_renderer_formats(
|
||||
struct wlr_renderer *wlr_renderer, size_t *len) {
|
||||
return gles2_formats(len);
|
||||
return get_gles2_formats(len);
|
||||
}
|
||||
|
||||
static bool gles2_resource_is_wl_drm_buffer(struct wlr_renderer *wlr_renderer,
|
||||
|
|
@ -254,13 +254,13 @@ static bool gles2_read_pixels(struct wlr_renderer *wlr_renderer,
|
|||
uint32_t dst_y, void *data) {
|
||||
gles2_get_renderer_in_context(wlr_renderer);
|
||||
|
||||
const struct gles2_pixel_format *fmt = gles2_format_from_wl(wl_fmt);
|
||||
const struct wlr_gles2_pixel_format *fmt = get_gles2_format_from_wl(wl_fmt);
|
||||
if (fmt == NULL) {
|
||||
wlr_log(L_ERROR, "Cannot read pixels: unsupported pixel format");
|
||||
return false;
|
||||
}
|
||||
|
||||
GLES2_DEBUG_PUSH;
|
||||
PUSH_GLES2_DEBUG;
|
||||
|
||||
// Make sure any pending drawing is finished before we try to read it
|
||||
glFinish();
|
||||
|
|
@ -273,14 +273,14 @@ static bool gles2_read_pixels(struct wlr_renderer *wlr_renderer,
|
|||
fmt->gl_type, p + i * stride + dst_x * fmt->bpp / 8);
|
||||
}
|
||||
|
||||
GLES2_DEBUG_POP;
|
||||
POP_GLES2_DEBUG;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool gles2_format_supported(struct wlr_renderer *wlr_renderer,
|
||||
enum wl_shm_format wl_fmt) {
|
||||
return gles2_format_from_wl(wl_fmt) != NULL;
|
||||
return get_gles2_format_from_wl(wl_fmt) != NULL;
|
||||
}
|
||||
|
||||
static struct wlr_texture *gles2_texture_from_pixels(
|
||||
|
|
@ -309,13 +309,13 @@ static void gles2_destroy(struct wlr_renderer *wlr_renderer) {
|
|||
|
||||
wlr_egl_make_current(renderer->egl, EGL_NO_SURFACE, NULL);
|
||||
|
||||
GLES2_DEBUG_PUSH;
|
||||
PUSH_GLES2_DEBUG;
|
||||
glDeleteProgram(renderer->shaders.quad);
|
||||
glDeleteProgram(renderer->shaders.ellipse);
|
||||
glDeleteProgram(renderer->shaders.tex_rgba);
|
||||
glDeleteProgram(renderer->shaders.tex_rgbx);
|
||||
glDeleteProgram(renderer->shaders.tex_ext);
|
||||
GLES2_DEBUG_POP;
|
||||
POP_GLES2_DEBUG;
|
||||
|
||||
if (glDebugMessageCallbackKHR) {
|
||||
glDisable(GL_DEBUG_OUTPUT_KHR);
|
||||
|
|
@ -347,7 +347,7 @@ static const struct wlr_renderer_impl renderer_impl = {
|
|||
.texture_from_dmabuf = gles2_texture_from_dmabuf,
|
||||
};
|
||||
|
||||
void gles2_push_marker(const char *file, const char *func) {
|
||||
void push_gles2_marker(const char *file, const char *func) {
|
||||
if (!glPushDebugGroupKHR) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -358,7 +358,7 @@ void gles2_push_marker(const char *file, const char *func) {
|
|||
glPushDebugGroupKHR(GL_DEBUG_SOURCE_APPLICATION_KHR, 1, -1, str);
|
||||
}
|
||||
|
||||
void gles2_pop_marker(void) {
|
||||
void pop_gles2_marker(void) {
|
||||
if (glPopDebugGroupKHR) {
|
||||
glPopDebugGroupKHR();
|
||||
}
|
||||
|
|
@ -385,7 +385,7 @@ static void gles2_log(GLenum src, GLenum type, GLuint id, GLenum severity,
|
|||
}
|
||||
|
||||
static GLuint compile_shader(GLuint type, const GLchar *src) {
|
||||
GLES2_DEBUG_PUSH;
|
||||
PUSH_GLES2_DEBUG;
|
||||
|
||||
GLuint shader = glCreateShader(type);
|
||||
glShaderSource(shader, 1, &src, NULL);
|
||||
|
|
@ -398,12 +398,12 @@ static GLuint compile_shader(GLuint type, const GLchar *src) {
|
|||
shader = 0;
|
||||
}
|
||||
|
||||
GLES2_DEBUG_POP;
|
||||
POP_GLES2_DEBUG;
|
||||
return shader;
|
||||
}
|
||||
|
||||
static GLuint link_program(const GLchar *vert_src, const GLchar *frag_src) {
|
||||
GLES2_DEBUG_PUSH;
|
||||
PUSH_GLES2_DEBUG;
|
||||
|
||||
GLuint vert = compile_shader(GL_VERTEX_SHADER, vert_src);
|
||||
if (!vert) {
|
||||
|
|
@ -433,11 +433,11 @@ static GLuint link_program(const GLchar *vert_src, const GLchar *frag_src) {
|
|||
goto error;
|
||||
}
|
||||
|
||||
GLES2_DEBUG_POP;
|
||||
POP_GLES2_DEBUG;
|
||||
return prog;
|
||||
|
||||
error:
|
||||
GLES2_DEBUG_POP;
|
||||
POP_GLES2_DEBUG;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -481,7 +481,7 @@ struct wlr_renderer *wlr_gles2_renderer_create(struct wlr_egl *egl) {
|
|||
GL_DONT_CARE, 0, NULL, GL_FALSE);
|
||||
}
|
||||
|
||||
GLES2_DEBUG_PUSH;
|
||||
PUSH_GLES2_DEBUG;
|
||||
|
||||
renderer->shaders.quad = link_program(quad_vertex_src, quad_fragment_src);
|
||||
if (!renderer->shaders.quad) {
|
||||
|
|
@ -510,7 +510,7 @@ struct wlr_renderer *wlr_gles2_renderer_create(struct wlr_egl *egl) {
|
|||
}
|
||||
}
|
||||
|
||||
GLES2_DEBUG_POP;
|
||||
POP_GLES2_DEBUG;
|
||||
|
||||
return &renderer->wlr_renderer;
|
||||
|
||||
|
|
@ -521,7 +521,7 @@ error:
|
|||
glDeleteProgram(renderer->shaders.tex_rgbx);
|
||||
glDeleteProgram(renderer->shaders.tex_ext);
|
||||
|
||||
GLES2_DEBUG_POP;
|
||||
POP_GLES2_DEBUG;
|
||||
|
||||
if (glDebugMessageCallbackKHR) {
|
||||
glDisable(GL_DEBUG_OUTPUT_KHR);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue