Skip to content
Snippets Groups Projects
Commit bcc48044 authored by Keith Whitwell's avatar Keith Whitwell
Browse files

When clearing, refresh the cx/y/w/h values as they may have been

invalidated by a new window position or size picked up when we did
LOCK_HARDWARE above.  The values passed by mesa are not reliable.
parent a03b2390
No related branches found
No related tags found
No related merge requests found
......@@ -323,6 +323,18 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield mask, GLboolean all,
drm_clip_rect_t clear;
int i;
/* Refresh the cx/y/w/h values as they may have been invalidated
* by a new window position or size picked up when we did
* LOCK_HARDWARE above. The values passed by mesa are not
* reliable.
*/
{
cx = ctx->DrawBuffer->_Xmin;
cy = ctx->DrawBuffer->_Ymin;
ch = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
cw = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
}
if (intel->ctx.DrawBuffer->Name == 0) {
/* clearing a window */
......
......@@ -282,7 +282,20 @@ static void intelClearWithTris(struct intel_context *intel,
intel->vtbl.install_meta_state(intel);
/* note: regardless of 'all', cx, cy, cw, ch are correct */
/* Refresh the cx/y/w/h values as they may have been invalidated
* by a new window position or size picked up when we did
* LOCK_HARDWARE above. The values passed by mesa are not
* reliable.
*/
{
cx = ctx->DrawBuffer->_Xmin;
cy = ctx->DrawBuffer->_Ymin;
ch = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
cw = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
}
/* note: regardless of 'all', cx, cy, cw, ch are now correct */
clear.x1 = cx;
clear.y1 = cy;
clear.x2 = cx + cw;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment