summaryrefslogtreecommitdiff
path: root/src/render/OpenGL.hpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2025-09-18 22:10:30 +0200
committerGitHub <noreply@github.com>2025-09-18 22:10:30 +0200
commit4fc95d646dbbe71744fb4e02ca0e995b652bffe5 (patch)
treed2cfad68788de39712289d3e5aab54ebb20ef22e /src/render/OpenGL.hpp
parent91f592a87509436dc6f6ea7b3d6705ed7c5af046 (diff)
renderer: asynchronously load background tex (#11749)
Bumps required hyprgraphics to 0.1.6 --------- Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
Diffstat (limited to 'src/render/OpenGL.hpp')
-rw-r--r--src/render/OpenGL.hpp71
1 files changed, 37 insertions, 34 deletions
diff --git a/src/render/OpenGL.hpp b/src/render/OpenGL.hpp
index 9e61106b..a69ebbfe 100644
--- a/src/render/OpenGL.hpp
+++ b/src/render/OpenGL.hpp
@@ -28,6 +28,7 @@
#include <GLES2/gl2ext.h>
#include <aquamarine/buffer/Buffer.hpp>
#include <hyprutils/os/FileDescriptor.hpp>
+#include <hyprgraphics/resource/resources/ImageResource.hpp>
#include "../debug/TracyDefines.hpp"
#include "../protocols/core/Compositor.hpp"
@@ -261,13 +262,13 @@ class CHyprOpenGLImpl {
void renderOffToMain(CFramebuffer* off);
void bindBackOnMain();
+ std::string resolveAssetPath(const std::string& file);
SP<CTexture> loadAsset(const std::string& file);
+ SP<CTexture> texFromCairo(cairo_surface_t* cairo);
SP<CTexture> renderText(const std::string& text, CHyprColor col, int pt, bool italic = false, const std::string& fontFamily = "", int maxWidth = 0, int weight = 400);
void setDamage(const CRegion& damage, std::optional<CRegion> finalDamage = {});
- void ensureBackgroundTexturePresence();
-
uint32_t getPreferredReadFormat(PHLMONITOR pMonitor);
std::vector<SDRMFormat> getDRMFormats();
EGLImageKHR createEGLImage(const Aquamarine::SDMABUFAttrs& attrs);
@@ -348,38 +349,40 @@ class CHyprOpenGLImpl {
GLsizei height = 0;
} m_lastViewport;
- std::unordered_map<int, bool> m_capStatus;
-
- std::vector<SDRMFormat> m_drmFormats;
- bool m_hasModifiers = false;
-
- int m_drmFD = -1;
- std::string m_extensions;
-
- bool m_fakeFrame = false;
- bool m_applyFinalShader = false;
- bool m_blend = false;
- bool m_offloadedFramebuffer = false;
- bool m_cmSupported = true;
-
- bool m_monitorTransformEnabled = false; // do not modify directly
- std::stack<bool> m_monitorTransformStack;
- SP<CTexture> m_missingAssetTexture;
- SP<CTexture> m_backgroundTexture;
- SP<CTexture> m_lockDeadTexture;
- SP<CTexture> m_lockDead2Texture;
- SP<CTexture> m_lockTtyTextTexture;
- SShader m_finalScreenShader;
- CTimer m_globalTimer;
- GLuint m_currentProgram;
-
- void logShaderError(const GLuint&, bool program = false, bool silent = false);
- void createBGTextureForMonitor(PHLMONITOR);
- void initDRMFormats();
- void initEGL(bool gbm);
- EGLDeviceEXT eglDeviceFromDRMFD(int drmFD);
- void initAssets();
- void initMissingAssetTexture();
+ std::unordered_map<int, bool> m_capStatus;
+
+ std::vector<SDRMFormat> m_drmFormats;
+ bool m_hasModifiers = false;
+
+ int m_drmFD = -1;
+ std::string m_extensions;
+
+ bool m_fakeFrame = false;
+ bool m_applyFinalShader = false;
+ bool m_blend = false;
+ bool m_offloadedFramebuffer = false;
+ bool m_cmSupported = true;
+
+ bool m_monitorTransformEnabled = false; // do not modify directly
+ std::stack<bool> m_monitorTransformStack;
+ SP<CTexture> m_missingAssetTexture;
+ SP<CTexture> m_lockDeadTexture;
+ SP<CTexture> m_lockDead2Texture;
+ SP<CTexture> m_lockTtyTextTexture;
+ SShader m_finalScreenShader;
+ CTimer m_globalTimer;
+ GLuint m_currentProgram;
+ ASP<Hyprgraphics::CImageResource> m_backgroundResource;
+ bool m_backgroundResourceFailed = false;
+
+ void logShaderError(const GLuint&, bool program = false, bool silent = false);
+ void createBGTextureForMonitor(PHLMONITOR);
+ void initDRMFormats();
+ void initEGL(bool gbm);
+ EGLDeviceEXT eglDeviceFromDRMFD(int drmFD);
+ void initAssets();
+ void initMissingAssetTexture();
+ void requestBackgroundResource();
//
std::optional<std::vector<uint64_t>> getModsForFormat(EGLint format);