Hyprland/src/render/Renderer.hpp

49 lines
1.7 KiB
C++
Raw Normal View History

2022-03-17 20:22:29 +01:00
#pragma once
#include "../defines.hpp"
2022-03-19 14:37:40 +01:00
#include <list>
#include "../helpers/Monitor.hpp"
2022-03-21 19:18:33 +01:00
#include "../helpers/Workspace.hpp"
2022-03-19 16:13:19 +01:00
#include "../Window.hpp"
2022-04-05 20:49:15 +02:00
#include "OpenGL.hpp"
2022-03-17 20:22:29 +01:00
2022-04-19 19:01:23 +02:00
struct SMonitorRule;
2022-04-14 16:43:29 +02:00
// TODO: add fuller damage tracking for updating only parts of a window
enum DAMAGETRACKINGMODES {
DAMAGE_TRACKING_INVALID = -1,
DAMAGE_TRACKING_NONE = 0,
DAMAGE_TRACKING_MONITOR,
DAMAGE_TRACKING_FULL
};
2022-03-17 20:22:29 +01:00
class CHyprRenderer {
public:
void renderAllClientsForMonitor(const int&, timespec*);
2022-03-19 14:07:18 +01:00
void outputMgrApplyTest(wlr_output_configuration_v1*, bool);
2022-03-19 14:37:40 +01:00
void arrangeLayersForMonitor(const int&);
2022-04-14 16:43:29 +02:00
void damageSurface(wlr_surface*, double, double);
void damageWindow(CWindow*);
void damageBox(wlr_box*);
void damageBox(const int& x, const int& y, const int& w, const int& h);
2022-04-14 16:43:29 +02:00
void damageMonitor(SMonitor*);
2022-04-19 19:01:23 +02:00
void applyMonitorRule(SMonitor*, SMonitorRule*, bool force = false);
bool shouldRenderWindow(CWindow*, SMonitor*);
bool shouldRenderWindow(CWindow*);
2022-04-14 16:43:29 +02:00
DAMAGETRACKINGMODES damageTrackingModeFromStr(const std::string&);
2022-03-17 20:22:29 +01:00
private:
2022-03-21 17:00:17 +01:00
void arrangeLayerArray(SMonitor*, const std::list<SLayerSurface*>&, bool, wlr_box*);
void renderWorkspaceWithFullscreenWindow(SMonitor*, CWorkspace*, timespec*);
2022-03-21 19:18:33 +01:00
void renderWindow(CWindow*, SMonitor*, timespec*, bool);
void renderLayer(SLayerSurface*, SMonitor*, timespec*);
2022-03-31 17:25:23 +02:00
void renderDragIcon(SMonitor*, timespec*);
2022-04-05 20:49:15 +02:00
friend class CHyprOpenGLImpl;
2022-03-17 20:22:29 +01:00
};
inline std::unique_ptr<CHyprRenderer> g_pHyprRenderer;