mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-31 20:03:48 -07:00
core/surface/buffer: Buffer lock/release fixes (#7110)
This commit is contained in:
@@ -84,13 +84,13 @@ class CWLSurfaceResource {
|
||||
} events;
|
||||
|
||||
struct SState {
|
||||
CRegion opaque, input = CBox{{}, {INT32_MAX, INT32_MAX}}, damage, bufferDamage = CBox{{}, {INT32_MAX, INT32_MAX}} /* initial damage */;
|
||||
wl_output_transform transform = WL_OUTPUT_TRANSFORM_NORMAL;
|
||||
int scale = 1;
|
||||
SP<IHLBuffer> buffer;
|
||||
SP<CTexture> texture;
|
||||
Vector2D offset;
|
||||
Vector2D size;
|
||||
CRegion opaque, input = CBox{{}, {INT32_MAX, INT32_MAX}}, damage, bufferDamage = CBox{{}, {INT32_MAX, INT32_MAX}} /* initial damage */;
|
||||
wl_output_transform transform = WL_OUTPUT_TRANSFORM_NORMAL;
|
||||
int scale = 1;
|
||||
SP<CHLBufferReference> buffer; // buffer ref will be released once the buffer is no longer locked. For checking if a buffer is attached to this state, check texture.
|
||||
SP<CTexture> texture;
|
||||
Vector2D offset;
|
||||
Vector2D size, bufferSize;
|
||||
struct {
|
||||
bool hasDestination = false;
|
||||
bool hasSource = false;
|
||||
@@ -116,7 +116,7 @@ class CWLSurfaceResource {
|
||||
std::vector<WP<CMonitor>> enteredOutputs;
|
||||
bool mapped = false;
|
||||
std::vector<WP<CWLSubsurfaceResource>> subsurfaces;
|
||||
WP<ISurfaceRole> role;
|
||||
SP<ISurfaceRole> role;
|
||||
WP<CViewportResource> viewportResource;
|
||||
WP<CDRMSyncobjSurfaceResource> syncobj; // may not be present
|
||||
|
||||
@@ -134,12 +134,21 @@ class CWLSurfaceResource {
|
||||
SP<CWlSurface> resource;
|
||||
wl_client* pClient = nullptr;
|
||||
|
||||
int stateLocks = 0;
|
||||
// this is for cursor dumb copy. Due to our (and wayland's...) architecture,
|
||||
// this stupid-ass hack is used
|
||||
WP<IHLBuffer> lastBuffer;
|
||||
|
||||
void destroy();
|
||||
void releaseBuffers(bool onlyCurrent = true);
|
||||
void commitPendingState();
|
||||
void bfHelper(std::vector<SP<CWLSurfaceResource>> nodes, std::function<void(SP<CWLSurfaceResource>, const Vector2D&, void*)> fn, void* data);
|
||||
int stateLocks = 0;
|
||||
|
||||
void destroy();
|
||||
void releaseBuffers(bool onlyCurrent = true);
|
||||
void dropPendingBuffer();
|
||||
void dropCurrentBuffer();
|
||||
void commitPendingState();
|
||||
void bfHelper(std::vector<SP<CWLSurfaceResource>> nodes, std::function<void(SP<CWLSurfaceResource>, const Vector2D&, void*)> fn, void* data);
|
||||
void updateCursorShm();
|
||||
|
||||
friend class CWLPointerResource;
|
||||
};
|
||||
|
||||
class CWLCompositorResource {
|
||||
|
Reference in New Issue
Block a user