[client] egl: remove font management

This commit is contained in:
Quantum 2021-07-23 06:04:37 -04:00 committed by Geoffrey McRae
parent dd0edc1394
commit cb9774bbd2

View File

@ -28,7 +28,6 @@
#include "common/locking.h"
#include "app.h"
#include "util.h"
#include "dynamic/fonts.h"
#include <EGL/egl.h>
#include <GLES3/gl32.h>
@ -100,10 +99,6 @@ struct Inst
float mouseScaleX, mouseScaleY;
bool showDamage;
const LG_Font * font;
LG_FontObj fontObj;
unsigned fontSize;
struct CursorState cursorLast;
bool hadOverlay;
@ -184,26 +179,6 @@ void egl_setup(void)
option_register(egl_options);
}
static bool egl_update_font(struct Inst * this)
{
unsigned size = round(16.0f * this->uiScale);
if (size == this->fontSize)
return true;
LG_FontObj fontObj;
if (!this->font->create(&fontObj, NULL, size))
{
DEBUG_ERROR("Failed to create a font instance");
return false;
}
if (this->fontObj)
this->font->destroy(this->fontObj);
this->fontObj = fontObj;
return true;
}
bool egl_create(void ** opaque, const LG_RendererParams params, bool * needsOpenGL)
{
// check if EGL is even available
@ -235,10 +210,6 @@ bool egl_create(void ** opaque, const LG_RendererParams params, bool * needsOpen
atomic_init(&this->desktopDamage, NULL);
this->font = LG_Fonts[0];
if (!egl_update_font(this))
return false;
*needsOpenGL = false;
return true;
}
@ -257,12 +228,6 @@ void egl_deinitialize(void * opaque)
if (this->imgui)
ImGui_ImplOpenGL3_Shutdown();
if (this->font)
{
if (this->fontObj)
this->font->destroy(this->fontObj);
}
egl_desktop_free(&this->desktop);
egl_cursor_free (&this->cursor);
egl_splash_free (&this->splash);
@ -446,7 +411,6 @@ void egl_on_resize(void * opaque, const int width, const int height, const doubl
this->screenScaleY = 1.0f / this->height;
egl_calc_mouse_state(this);
egl_update_font(this);
struct DesktopDamage * damage = malloc(sizeof(struct DesktopDamage));
if (!damage)