Mercurial > dwindows
changeset 873:fe7a8dc9392c
Dynamically set the video memory backing location, only if there is a render control.
So we don't waste video memory on windows that won't get benefit from it.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 05 Apr 2011 00:35:31 +0000 |
parents | 13debcad9757 |
children | 18eab415ff0c |
files | mac/dw.m |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mac/dw.m Mon Apr 04 22:40:42 2011 +0000 +++ b/mac/dw.m Tue Apr 05 00:35:31 2011 +0000 @@ -2199,6 +2199,12 @@ DWRender *render = (DWRender *)handle; NSSize oldsize = [render size]; NSSize newsize = [render frame].size; + NSWindow *window = [render window]; + + if([window preferredBackingLocation] != NSWindowBackingLocationVideoMemory) + { + [window setPreferredBackingLocation:NSWindowBackingLocationVideoMemory]; + } /* Eliminate duplicate configure requests */ if(oldsize.width != newsize.width || oldsize.height != newsize.height) @@ -6303,7 +6309,6 @@ backing:NSBackingStoreBuffered defer:false]; - [window setPreferredBackingLocation:NSWindowBackingLocationVideoMemory]; [window setTitle:[ NSString stringWithUTF8String:title ]]; DWView *view = [[DWView alloc] init];