Remove clipping against the bounding rect of paint region
This commit is contained in:
parent
050ea5010b
commit
76eb3c3391
1 changed files with 14 additions and 34 deletions
|
@ -479,44 +479,24 @@ void SceneOpenGL::Window::performPaint(int mask, QRegion region, WindowPaintData
|
|||
if (region != infiniteRegion() && !(mask & PAINT_WINDOW_TRANSFORMED)) {
|
||||
WindowQuadList quads;
|
||||
const QRegion filterRegion = region.translated(-x(), -y());
|
||||
const QRectF bounding = QRectF(filterRegion.boundingRect());
|
||||
// first step: split all quads according to the bounding rect
|
||||
// split all quads in bounding rect with the actual rects in the region
|
||||
foreach (const WindowQuad &quad, data.quads) {
|
||||
const QRectF quadRect(QPointF(quad.left(), quad.top()), QPointF(quad.right(), quad.bottom()));
|
||||
// case 1: completely contains
|
||||
if (bounding.contains(quadRect)) {
|
||||
quads << quad;
|
||||
continue;
|
||||
}
|
||||
// case 2: intersection
|
||||
if (bounding.intersects(quadRect)) {
|
||||
const QRectF intersected = bounding.intersected(quadRect);
|
||||
quads << quad.makeSubQuad(intersected.left(), intersected.top(), intersected.right(), intersected.bottom());
|
||||
}
|
||||
}
|
||||
if (filterRegion.numRects() > 1) {
|
||||
// second step: split all quads in bounding rect with the actual rects in the region
|
||||
WindowQuadList tempList;
|
||||
foreach (const WindowQuad &quad, quads) {
|
||||
foreach (const QRect &r, filterRegion.rects()) {
|
||||
const QRectF rf(r);
|
||||
const QRectF quadRect(QPointF(quad.left(), quad.top()), QPointF(quad.right(), quad.bottom()));
|
||||
// case 1: completely contains, include and do not check other rects
|
||||
if (rf.contains(quadRect)) {
|
||||
tempList << quad;
|
||||
break;
|
||||
}
|
||||
// case 2: intersection
|
||||
if (rf.intersects(quadRect)) {
|
||||
const QRectF intersected = rf.intersected(quadRect);
|
||||
tempList << quad.makeSubQuad(intersected.left(), intersected.top(), intersected.right(), intersected.bottom());
|
||||
}
|
||||
foreach (const QRect &r, filterRegion.rects()) {
|
||||
const QRectF rf(r);
|
||||
const QRectF quadRect(QPointF(quad.left(), quad.top()), QPointF(quad.right(), quad.bottom()));
|
||||
// case 1: completely contains, include and do not check other rects
|
||||
if (rf.contains(quadRect)) {
|
||||
quads << quad;
|
||||
break;
|
||||
}
|
||||
// case 2: intersection
|
||||
if (rf.intersects(quadRect)) {
|
||||
const QRectF intersected = rf.intersected(quadRect);
|
||||
quads << quad.makeSubQuad(intersected.left(), intersected.top(), intersected.right(), intersected.bottom());
|
||||
}
|
||||
}
|
||||
data.quads = tempList;
|
||||
} else {
|
||||
data.quads = quads;
|
||||
}
|
||||
data.quads = quads;
|
||||
}
|
||||
|
||||
if (!bindTexture())
|
||||
|
|
Loading…
Reference in a new issue