mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 21:50:46 +00:00
Optimise display update.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4386 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
df72c2d544
commit
827af8bf22
2 changed files with 27 additions and 8 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Thu Jun 10 19:45:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||||
|
|
||||||
|
* Source/NSView.m: Optimise display routines - avoid unneeded
|
||||||
|
re-displays.
|
||||||
|
|
||||||
Wed Jun 9 8:35:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
Wed Jun 9 8:35:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||||
|
|
||||||
* Headers/AppKit/DPSOperators.h: Add DPSmouselocation()
|
* Headers/AppKit/DPSOperators.h: Add DPSmouselocation()
|
||||||
|
|
|
@ -1175,6 +1175,8 @@ static SEL invalidateSel = @selector(_invalidateCoordinates);
|
||||||
|
|
||||||
if (coordinates_valid == NO)
|
if (coordinates_valid == NO)
|
||||||
[self _rebuildCoordinates];
|
[self _rebuildCoordinates];
|
||||||
|
|
||||||
|
invalidRect = NSIntersectionRect(invalidRect, visibleRect);
|
||||||
aRect = NSIntersectionRect(aRect, visibleRect);
|
aRect = NSIntersectionRect(aRect, visibleRect);
|
||||||
|
|
||||||
redrawRect = NSIntersectionRect(aRect, invalidRect);
|
redrawRect = NSIntersectionRect(aRect, invalidRect);
|
||||||
|
@ -1244,17 +1246,20 @@ static SEL invalidateSel = @selector(_invalidateCoordinates);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If our invalid rectangle is entirely contained with the area we
|
* If the rect we displayed contains the invalidRect for the view
|
||||||
* have just redisplayed, then we set the invalid rectangle to zero
|
* then we can empty invalidRect. All subviews will have been
|
||||||
|
* fully displayed, so the 'stillNeedsDisplay' flag will be NO.
|
||||||
*/
|
*/
|
||||||
redrawRect = NSUnionRect(invalidRect, aRect);
|
redrawRect = NSUnionRect(invalidRect, aRect);
|
||||||
if (NSEqualRects(aRect, redrawRect) == YES)
|
if (NSEqualRects(aRect, redrawRect) == YES)
|
||||||
{
|
{
|
||||||
invalidRect = NSZeroRect;
|
invalidRect = NSZeroRect;
|
||||||
needs_display = stillNeedsDisplay;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
needs_display = YES;
|
{
|
||||||
|
stillNeedsDisplay = YES;
|
||||||
|
}
|
||||||
|
needs_display = stillNeedsDisplay;
|
||||||
|
|
||||||
[window flushWindow];
|
[window flushWindow];
|
||||||
}
|
}
|
||||||
|
@ -1288,6 +1293,16 @@ static SEL invalidateSel = @selector(_invalidateCoordinates);
|
||||||
if (coordinates_valid == NO)
|
if (coordinates_valid == NO)
|
||||||
[self _rebuildCoordinates];
|
[self _rebuildCoordinates];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* we limit the invalid rect to the visible area - since we can't
|
||||||
|
* display beyond that anyway.
|
||||||
|
*/
|
||||||
|
if (needs_display)
|
||||||
|
invalidRect = NSIntersectionRect(invalidRect, visibleRect);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Now we draw this view.
|
||||||
|
*/
|
||||||
ctxt = GSCurrentContext();
|
ctxt = GSCurrentContext();
|
||||||
[ctxt lockFocusView: self inRect: aRect];
|
[ctxt lockFocusView: self inRect: aRect];
|
||||||
[self drawRect: aRect];
|
[self drawRect: aRect];
|
||||||
|
@ -1329,8 +1344,9 @@ static SEL invalidateSel = @selector(_invalidateCoordinates);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the rect we displayed contains the invalidRect
|
* If the rect we displayed contains the invalidRect for the view
|
||||||
* for the view then we can empty invalidRect.
|
* then we can empty invalidRect. All subviews will have been
|
||||||
|
* fully displayed, so the 'stillNeedsDisplay' flag will be NO.
|
||||||
*/
|
*/
|
||||||
rect = NSUnionRect(invalidRect, aRect);
|
rect = NSUnionRect(invalidRect, aRect);
|
||||||
if (NSEqualRects(rect, aRect) == YES)
|
if (NSEqualRects(rect, aRect) == YES)
|
||||||
|
@ -1352,8 +1368,6 @@ static SEL invalidateSel = @selector(_invalidateCoordinates);
|
||||||
{
|
{
|
||||||
if (coordinates_valid == NO)
|
if (coordinates_valid == NO)
|
||||||
[self _rebuildCoordinates];
|
[self _rebuildCoordinates];
|
||||||
if (needs_display)
|
|
||||||
invalidRect = NSIntersectionRect(invalidRect, visibleRect);
|
|
||||||
return visibleRect;
|
return visibleRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue