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
|
2022-12-16 18:17:31 +01:00
|
|
|
enum DAMAGETRACKINGMODES
|
|
|
|
{
|
2022-04-14 16:43:29 +02:00
|
|
|
DAMAGE_TRACKING_INVALID = -1,
|
2022-12-16 18:17:31 +01:00
|
|
|
DAMAGE_TRACKING_NONE = 0,
|
2022-04-14 16:43:29 +02:00
|
|
|
DAMAGE_TRACKING_MONITOR,
|
|
|
|
DAMAGE_TRACKING_FULL
|
|
|
|
};
|
|
|
|
|
2022-12-16 18:17:31 +01:00
|
|
|
enum eRenderPassMode
|
|
|
|
{
|
2022-07-12 09:49:56 +02:00
|
|
|
RENDER_PASS_ALL = 0,
|
|
|
|
RENDER_PASS_MAIN,
|
|
|
|
RENDER_PASS_POPUP
|
|
|
|
};
|
|
|
|
|
2022-12-05 18:05:15 +01:00
|
|
|
class CToplevelExportProtocolManager;
|
|
|
|
|
2022-03-17 20:22:29 +01:00
|
|
|
class CHyprRenderer {
|
2022-12-16 18:17:31 +01:00
|
|
|
public:
|
2022-03-17 20:22:29 +01:00
|
|
|
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*);
|
2022-05-05 14:02:30 +02:00
|
|
|
void damageBox(const int& x, const int& y, const int& w, const int& h);
|
2022-07-16 12:44:45 +02:00
|
|
|
void damageRegion(pixman_region32_t*);
|
2022-07-27 12:32:00 +02:00
|
|
|
void damageMonitor(CMonitor*);
|
2022-09-13 15:25:42 +02:00
|
|
|
void damageMirrorsWith(CMonitor*, pixman_region32_t*);
|
2022-07-27 12:32:00 +02:00
|
|
|
bool applyMonitorRule(CMonitor*, SMonitorRule*, bool force = false);
|
|
|
|
bool shouldRenderWindow(CWindow*, CMonitor*);
|
2022-05-31 22:16:13 +02:00
|
|
|
bool shouldRenderWindow(CWindow*);
|
2022-06-24 23:27:02 +02:00
|
|
|
void ensureCursorRenderingMode();
|
2022-06-26 13:43:32 +02:00
|
|
|
bool shouldRenderCursor();
|
2022-08-28 10:14:43 +02:00
|
|
|
void calculateUVForWindowSurface(CWindow*, wlr_surface*, bool main = false);
|
2022-06-26 13:43:32 +02:00
|
|
|
|
|
|
|
bool m_bWindowRequestedCursorHide = false;
|
2022-12-16 18:17:31 +01:00
|
|
|
bool m_bBlockSurfaceFeedback = false;
|
2022-12-28 15:39:17 +01:00
|
|
|
bool m_bRenderingSnapshot = false;
|
2022-12-16 18:17:31 +01:00
|
|
|
CWindow* m_pLastScanout = nullptr;
|
2022-12-22 13:15:00 +01:00
|
|
|
CMonitor* m_pMostHzMonitor = nullptr;
|
2022-04-14 16:43:29 +02:00
|
|
|
|
|
|
|
DAMAGETRACKINGMODES damageTrackingModeFromStr(const std::string&);
|
2022-03-17 20:22:29 +01:00
|
|
|
|
2022-11-05 13:50:47 +01:00
|
|
|
bool attemptDirectScanout(CMonitor*);
|
|
|
|
void setWindowScanoutMode(CWindow*);
|
|
|
|
|
2022-12-16 18:17:31 +01:00
|
|
|
private:
|
|
|
|
void arrangeLayerArray(CMonitor*, const std::vector<std::unique_ptr<SLayerSurface>>&, bool, wlr_box*);
|
|
|
|
void renderWorkspaceWithFullscreenWindow(CMonitor*, CWorkspace*, timespec*);
|
|
|
|
void renderWindow(CWindow*, CMonitor*, timespec*, bool, eRenderPassMode, bool ignorePosition = false, bool ignoreAllGeometry = false);
|
|
|
|
void renderLayer(SLayerSurface*, CMonitor*, timespec*);
|
|
|
|
void renderDragIcon(CMonitor*, timespec*);
|
|
|
|
void renderIMEPopup(SIMEPopup*, CMonitor*, timespec*);
|
2022-06-24 23:27:02 +02:00
|
|
|
|
2022-12-16 18:17:31 +01:00
|
|
|
bool m_bHasARenderedCursor = true;
|
2022-04-05 20:49:15 +02:00
|
|
|
|
|
|
|
friend class CHyprOpenGLImpl;
|
2022-12-05 18:05:15 +01:00
|
|
|
friend class CToplevelExportProtocolManager;
|
2022-03-17 20:22:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
inline std::unique_ptr<CHyprRenderer> g_pHyprRenderer;
|