mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 18:11:06 +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
8038d6628e
commit
046c7bb06b
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>
|
||||
|
||||
* Headers/AppKit/DPSOperators.h: Add DPSmouselocation()
|
||||
|
|
|
@ -1175,6 +1175,8 @@ static SEL invalidateSel = @selector(_invalidateCoordinates);
|
|||
|
||||
if (coordinates_valid == NO)
|
||||
[self _rebuildCoordinates];
|
||||
|
||||
invalidRect = NSIntersectionRect(invalidRect, visibleRect);
|
||||
aRect = NSIntersectionRect(aRect, visibleRect);
|
||||
|
||||
redrawRect = NSIntersectionRect(aRect, invalidRect);
|
||||
|
@ -1244,17 +1246,20 @@ static SEL invalidateSel = @selector(_invalidateCoordinates);
|
|||
}
|
||||
|
||||
/*
|
||||
* If our invalid rectangle is entirely contained with the area we
|
||||
* have just redisplayed, then we set the invalid rectangle to zero
|
||||
* If the rect we displayed contains the invalidRect for the view
|
||||
* then we can empty invalidRect. All subviews will have been
|
||||
* fully displayed, so the 'stillNeedsDisplay' flag will be NO.
|
||||
*/
|
||||
redrawRect = NSUnionRect(invalidRect, aRect);
|
||||
if (NSEqualRects(aRect, redrawRect) == YES)
|
||||
{
|
||||
invalidRect = NSZeroRect;
|
||||
needs_display = stillNeedsDisplay;
|
||||
}
|
||||
else
|
||||
needs_display = YES;
|
||||
{
|
||||
stillNeedsDisplay = YES;
|
||||
}
|
||||
needs_display = stillNeedsDisplay;
|
||||
|
||||
[window flushWindow];
|
||||
}
|
||||
|
@ -1288,6 +1293,16 @@ static SEL invalidateSel = @selector(_invalidateCoordinates);
|
|||
if (coordinates_valid == NO)
|
||||
[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 lockFocusView: self inRect: aRect];
|
||||
[self drawRect: aRect];
|
||||
|
@ -1329,8 +1344,9 @@ static SEL invalidateSel = @selector(_invalidateCoordinates);
|
|||
}
|
||||
|
||||
/*
|
||||
* If the rect we displayed contains the invalidRect
|
||||
* for the view then we can empty invalidRect.
|
||||
* If the rect we displayed contains the invalidRect for the view
|
||||
* then we can empty invalidRect. All subviews will have been
|
||||
* fully displayed, so the 'stillNeedsDisplay' flag will be NO.
|
||||
*/
|
||||
rect = NSUnionRect(invalidRect, aRect);
|
||||
if (NSEqualRects(rect, aRect) == YES)
|
||||
|
@ -1352,8 +1368,6 @@ static SEL invalidateSel = @selector(_invalidateCoordinates);
|
|||
{
|
||||
if (coordinates_valid == NO)
|
||||
[self _rebuildCoordinates];
|
||||
if (needs_display)
|
||||
invalidRect = NSIntersectionRect(invalidRect, visibleRect);
|
||||
return visibleRect;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue