mirror of
https://github.com/gnustep/libs-back.git
synced 2025-02-24 12:21:34 +00:00
Faster non-backing store display.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@14422 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
83b509bec5
commit
5bb6dc27ca
2 changed files with 57 additions and 4 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2002-09-08 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
|
* Source/x11/XGServerWindow.m ([XGServer
|
||||||
|
-_XWinFrameToOSWinFrame:for:]): New.
|
||||||
|
([XGServer -_addExposedRectangle::]): Convert rect to OS coords.
|
||||||
|
([XGServer -_processExposedRectangles:]): Invalidate exposed
|
||||||
|
rects in view. (patch from Frederic De Jaeger).
|
||||||
|
|
||||||
2002-09-06 Adam Fedor <fedor@gnu.org>
|
2002-09-06 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
* Source/gsc/GSContext.m (-initWithContextInfo:): Fix
|
* Source/gsc/GSContext.m (-initWithContextInfo:): Fix
|
||||||
|
|
|
@ -393,6 +393,23 @@ NSDebugLLog(@"Frame", @"O2H %d, %@, %@", win->number,
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Convert a window frame in X coordinates relative to the X-window to a frame
|
||||||
|
* in OpenStep coordinates relative to the window by flipping.
|
||||||
|
*/
|
||||||
|
- (NSRect) _XWinFrameToOSWinFrame: (NSRect)x for: (void*)window
|
||||||
|
{
|
||||||
|
gswindow_device_t *win = (gswindow_device_t*)window;
|
||||||
|
NSRect o;
|
||||||
|
o.size.width = x.size.width;
|
||||||
|
o.size.height = x.size.height;
|
||||||
|
o.origin.x = x.origin.x;
|
||||||
|
o.origin.y = win->siz_hints.height - x.origin.y;
|
||||||
|
o.origin.y = o.origin.y - o.size.height;
|
||||||
|
NSDebugLLog(@"GGFrame", @"%@ %@", NSStringFromRect(x), NSStringFromRect(o));
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convert a window frame in X absolute screen coordinates to a frame
|
* Convert a window frame in X absolute screen coordinates to a frame
|
||||||
* in OpenStep absolute screen coordinates by flipping an applying
|
* in OpenStep absolute screen coordinates by flipping an applying
|
||||||
|
@ -415,6 +432,7 @@ NSDebugLLog(@"Frame", @"X2O %d, %@, %@", win->number,
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (XGWMProtocols) _checkWindowManager
|
- (XGWMProtocols) _checkWindowManager
|
||||||
{
|
{
|
||||||
int wmflags;
|
int wmflags;
|
||||||
|
@ -2015,11 +2033,15 @@ NSDebugLLog(@"Frame", @"X2O %d, %@, %@", win->number,
|
||||||
|
|
||||||
// Transform the rectangle's coordinates to PS coordinates and add
|
// Transform the rectangle's coordinates to PS coordinates and add
|
||||||
// this new rectangle to the list of exposed rectangles.
|
// this new rectangle to the list of exposed rectangles.
|
||||||
rect.origin = NSMakePoint((float)rectangle.x, rectangle.y);
|
{
|
||||||
rect.size = NSMakeSize(rectangle.width, rectangle.height);
|
rect = [self _XWinFrameToOSWinFrame:
|
||||||
|
NSMakeRect(rectangle.x, rectangle.y,
|
||||||
|
rectangle.width, rectangle.height)
|
||||||
|
for: window];
|
||||||
[window->exposedRects addObject: [NSValue valueWithRect: rect]];
|
[window->exposedRects addObject: [NSValue valueWithRect: rect]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (void) flushwindowrect: (NSRect)rect : (int)win
|
- (void) flushwindowrect: (NSRect)rect : (int)win
|
||||||
{
|
{
|
||||||
|
@ -2082,7 +2104,9 @@ NSDebugLLog(@"Frame", @"X2O %d, %@, %@", win->number,
|
||||||
// handle X expose events
|
// handle X expose events
|
||||||
- (void) _processExposedRectangles: (int)win
|
- (void) _processExposedRectangles: (int)win
|
||||||
{
|
{
|
||||||
|
int n;
|
||||||
gswindow_device_t *window;
|
gswindow_device_t *window;
|
||||||
|
NSWindow *gui_win;
|
||||||
|
|
||||||
window = WINDOW_WITH_TAG(win);
|
window = WINDOW_WITH_TAG(win);
|
||||||
if (!window)
|
if (!window)
|
||||||
|
@ -2098,7 +2122,28 @@ NSDebugLLog(@"Frame", @"X2O %d, %@, %@", win->number,
|
||||||
// We should determine the views that need to be redisplayed. Until we
|
// We should determine the views that need to be redisplayed. Until we
|
||||||
// fully support scalation and rotation of views redisplay everything.
|
// fully support scalation and rotation of views redisplay everything.
|
||||||
// FIXME: It seems wierd to trigger a front-end method from here...
|
// FIXME: It seems wierd to trigger a front-end method from here...
|
||||||
[GSWindowWithNumber(win) display];
|
|
||||||
|
// We simply invalidate the
|
||||||
|
// corresponding rectangle of the contentview.
|
||||||
|
|
||||||
|
gui_win = GSWindowWithNumber(win);
|
||||||
|
|
||||||
|
n = [window->exposedRects count];
|
||||||
|
if( n > 0 )
|
||||||
|
{
|
||||||
|
NSView *v;
|
||||||
|
NSValue *val[n];
|
||||||
|
int i;
|
||||||
|
|
||||||
|
v = [gui_win contentView];
|
||||||
|
|
||||||
|
[window->exposedRects getObjects: val];
|
||||||
|
for( i = 0; i < n; ++i)
|
||||||
|
{
|
||||||
|
NSRect rect = [val[i] rectValue];
|
||||||
|
[v setNeedsDisplayInRect: rect];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Restore the exposed rectangles and the region
|
// Restore the exposed rectangles and the region
|
||||||
[window->exposedRects removeAllObjects];
|
[window->exposedRects removeAllObjects];
|
||||||
|
|
Loading…
Reference in a new issue