mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 08:38:20 +00:00
[client] egl: remove font management
This commit is contained in:
parent
dd0edc1394
commit
cb9774bbd2
@ -28,7 +28,6 @@
|
|||||||
#include "common/locking.h"
|
#include "common/locking.h"
|
||||||
#include "app.h"
|
#include "app.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "dynamic/fonts.h"
|
|
||||||
|
|
||||||
#include <EGL/egl.h>
|
#include <EGL/egl.h>
|
||||||
#include <GLES3/gl32.h>
|
#include <GLES3/gl32.h>
|
||||||
@ -100,10 +99,6 @@ struct Inst
|
|||||||
float mouseScaleX, mouseScaleY;
|
float mouseScaleX, mouseScaleY;
|
||||||
bool showDamage;
|
bool showDamage;
|
||||||
|
|
||||||
const LG_Font * font;
|
|
||||||
LG_FontObj fontObj;
|
|
||||||
unsigned fontSize;
|
|
||||||
|
|
||||||
struct CursorState cursorLast;
|
struct CursorState cursorLast;
|
||||||
|
|
||||||
bool hadOverlay;
|
bool hadOverlay;
|
||||||
@ -184,26 +179,6 @@ void egl_setup(void)
|
|||||||
option_register(egl_options);
|
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)
|
bool egl_create(void ** opaque, const LG_RendererParams params, bool * needsOpenGL)
|
||||||
{
|
{
|
||||||
// check if EGL is even available
|
// 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);
|
atomic_init(&this->desktopDamage, NULL);
|
||||||
|
|
||||||
this->font = LG_Fonts[0];
|
|
||||||
if (!egl_update_font(this))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
*needsOpenGL = false;
|
*needsOpenGL = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -257,12 +228,6 @@ void egl_deinitialize(void * opaque)
|
|||||||
if (this->imgui)
|
if (this->imgui)
|
||||||
ImGui_ImplOpenGL3_Shutdown();
|
ImGui_ImplOpenGL3_Shutdown();
|
||||||
|
|
||||||
if (this->font)
|
|
||||||
{
|
|
||||||
if (this->fontObj)
|
|
||||||
this->font->destroy(this->fontObj);
|
|
||||||
}
|
|
||||||
|
|
||||||
egl_desktop_free(&this->desktop);
|
egl_desktop_free(&this->desktop);
|
||||||
egl_cursor_free (&this->cursor);
|
egl_cursor_free (&this->cursor);
|
||||||
egl_splash_free (&this->splash);
|
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;
|
this->screenScaleY = 1.0f / this->height;
|
||||||
|
|
||||||
egl_calc_mouse_state(this);
|
egl_calc_mouse_state(this);
|
||||||
egl_update_font(this);
|
|
||||||
|
|
||||||
struct DesktopDamage * damage = malloc(sizeof(struct DesktopDamage));
|
struct DesktopDamage * damage = malloc(sizeof(struct DesktopDamage));
|
||||||
if (!damage)
|
if (!damage)
|
||||||
|
Loading…
Reference in New Issue
Block a user