core/surface/buffer: Buffer lock/release fixes (#7110)

This commit is contained in:
Vaxry
2024-07-31 20:47:26 +01:00
committed by GitHub
parent 5489682799
commit 37e1411e8d
27 changed files with 304 additions and 129 deletions

View File

@@ -54,13 +54,13 @@ CViewportResource::CViewportResource(SP<CWpViewport> resource_, SP<CWLSurfaceRes
});
listeners.surfacePrecommit = surface->events.precommit.registerListener([this](std::any d) {
if (!surface || !surface->pending.buffer)
if (!surface || !surface->pending.texture)
return;
if (surface->pending.viewport.hasSource) {
auto& src = surface->pending.viewport.source;
if (src.w + src.x > surface->pending.buffer->size.x || src.h + src.y > surface->pending.buffer->size.y) {
if (src.w + src.x > surface->pending.bufferSize.x || src.h + src.y > surface->pending.bufferSize.y) {
resource->error(WP_VIEWPORT_ERROR_BAD_VALUE, "Box doesn't fit");
surface->pending.rejected = true;
return;