for (i = 0; i < nbox; i++, pbox++) {
drm_clip_rect_t box;
+ drm_clip_rect_t sbox;
if (pbox->x1 > pbox->x2 ||
pbox->y1 > pbox->y2 ||
continue;
}
+ sbox.x1 = box.x1 - dPriv->x;
+ sbox.y1 = box.y1 - dPriv->y;
+
BEGIN_BATCH(8, INTEL_BATCH_NO_CLIPRECTS);
OUT_BATCH(CMD);
OUT_BATCH(BR13);
OUT_RELOC(frontRegion->buffer, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE,
DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, 0);
- OUT_BATCH((pbox->y1 << 16) | pbox->x1);
+ OUT_BATCH((sbox.y1 << 16) | sbox.x1);
OUT_BATCH((srcpitch * cpp) & 0xffff);
OUT_RELOC(backRegion->buffer, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ,
DRM_BO_MASK_MEM | DRM_BO_FLAG_READ, 0);
intel->drawY = 0;
}
+/**
+ * As above, but for rendering private front/back buffer of a window.
+ * \sa intelSetPrivbufClipRects
+ */
+
+static void
+intelSetPrivbufClipRects(struct intel_context *intel)
+{
+ __DRIdrawablePrivate *dPriv = intel->driDrawable;
+ if (!dPriv)
+ return;
+
+ intel->fakeClipRect.x1 = 0;
+ intel->fakeClipRect.y1 = 0;
+ intel->fakeClipRect.x2 = dPriv->w;
+ intel->fakeClipRect.y2 = dPriv->h;
+ intel->pClipRects = &intel->fakeClipRect;
+ intel->numClipRects = 1;
+ intel->drawX = 0;
+ intel->drawY = 0;
+}
/**
* As above, but for rendering to front buffer of a window.
/* when would this happen? -BP */
intelSetFrontClipRects(intel);
}
- else if (intel->ctx.DrawBuffer->Name != 0) {
+ else if (1 || intel->ctx.DrawBuffer->Name != 0) {
/* drawing to user-created FBO - do nothing */
/* Cliprects would be set from intelDrawBuffer() */
}
if (ctx->Visual.doubleBufferMode) {
drm_clip_rect_t rect;
+#if 1
rect.x1 = x + dPriv->x;
rect.y1 = (dPriv->h - y - h) + dPriv->y;
rect.x2 = rect.x1 + w;
rect.y2 = rect.y1 + h;
+#else
+ rect.x1 = x;
+ rect.y1 = dPriv->h - y;
+ rect.x2 = rect.x1 + w;
+ rect.y2 = rect.y1 + h;
+#endif
_mesa_notifySwapBuffers(ctx); /* flush pending rendering comands */
intelCopyBuffer(dPriv, &rect);
}
return;
}
- /* Do this here, note core Mesa, since this function is called from
+ /* Do this here, not core Mesa, since this function is called from
* many places within the driver.
*/
if (ctx->NewState & (_NEW_BUFFERS | _NEW_COLOR | _NEW_PIXEL)) {
if (fb->Name == 0) {
/* drawing to window system buffer */
if (front) {
+#if 0
intelSetFrontClipRects(intel);
+#else
+ intelSetPrivbufClipRects(intel);
+#endif
colorRegion = intel_get_rb_region(fb, BUFFER_FRONT_LEFT);
}
else {
+#if 0
intelSetBackClipRects(intel);
+#else
+ intelSetPrivbufClipRects(intel);
+#endif
colorRegion = intel_get_rb_region(fb, BUFFER_BACK_LEFT);
}
}