Changeset 58
- Timestamp:
- 11/30/06 09:54:26 (2 years ago)
- Files:
-
- trunk/changelog.txt (modified) (1 diff)
- trunk/host-cocoa/cocoaQemu.m (modified) (1 diff)
- trunk/host-cocoa/cocoaQemuQuartzView.h (modified) (1 diff)
- trunk/host-cocoa/cocoaQemuQuartzView.m (modified) (4 diffs)
- trunk/qcontrol/cocoaControlController.m (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/changelog.txt
r57 r58 1 Q-0.8.2d58 2 [new] Quartz: selective drawing code 3 [new] Quartz: is default now 4 1 5 Q-0.8.2d57 2 6 [fix] FSToolbar: added localization trunk/host-cocoa/cocoaQemu.m
r53 r58 1070 1070 void cocoa_update(DisplayState *ds, int x, int y, int w, int h) 1071 1071 { 1072 // NSLog(@"cocoa: update\n"); 1073 1074 [[pc contentView] drawContent:ds]; 1072 // NSLog(@"cocoa: update"); 1073 1074 if ([[[pc contentView] class] isEqual:[cocoaQemuQuartzView class]]) { 1075 /* new selective drawing code (draws only dirty rectangles) */ 1076 float dx; 1077 float dy; 1078 1079 dx = [[pc contentView] frame].size.width / (float)ds->width; 1080 dy = [[pc contentView] frame].size.height / (float)ds->height; 1081 1082 [[pc contentView] setNeedsDisplayInRect:NSMakeRect( 1083 x * dx, 1084 [[pc contentView] frame].size.height - (h + y) * dy, 1085 w * dx, 1086 h * dy 1087 )]; 1088 } else { 1089 1090 /* old drawing code (draws everything) */ 1091 [[pc contentView] drawContent:ds]; 1092 1093 } 1075 1094 } 1076 1095 trunk/host-cocoa/cocoaQemuQuartzView.h
r5 r58 40 40 - (id)initWithFrame:(NSRect)frameRect sender:(id)sender; 41 41 - (BOOL) toggleFullScreen; 42 - (void) drawContent:(DisplayState *)ds;43 42 - (void) resizeContent:(DisplayState *)ds width:(int)w height:(int)h; 44 43 - (NSImage *) screenshot:(NSSize)size; trunk/host-cocoa/cocoaQemuQuartzView.m
r53 r58 27 27 #import "cocoaQemuQuartzView.h" 28 28 29 #define cgrect(nsrect) (*(CGRect *)&(nsrect)) 29 30 30 31 @implementation cocoaQemuQuartzView … … 91 92 kCGRenderingIntentDefault //intent 92 93 ); 93 CGContextDrawImage (viewContextRef, CGRectMake(0, 0, rect.size.width, rect.size.height), imageRef); 94 95 /* new selective drawing code */ 96 if (CGImageCreateWithImageInRect != NULL) { 97 98 /* new selective drawing code (draws only dirty rectangles) (Tiger) */ 99 const NSRect *rectList; 100 int rectCount; 101 int i; 102 CGImageRef clipImageRef; 103 CGRect clipRect; 104 float dx; 105 float dy; 106 107 dx = [self frame].size.width / current_ds.width; 108 dy = [self frame].size.height / current_ds.height; 109 110 [self getRectsBeingDrawn:&rectList count:&rectCount]; 111 for (i = 0; i < rectCount; i++) { 112 clipRect.origin.x = rectList[i].origin.x / dx; 113 clipRect.origin.y = current_ds.height - (rectList[i].origin.y + rectList[i].size.height) / dy; 114 clipRect.size.width = rectList[i].size.width / dx; 115 clipRect.size.height = rectList[i].size.height / dy; 116 117 clipImageRef = CGImageCreateWithImageInRect( 118 imageRef, 119 clipRect 120 ); 121 CGContextDrawImage (viewContextRef, cgrect(rectList[i]), clipImageRef); 122 CGImageRelease (clipImageRef); 123 } 124 125 } else { 126 127 /* old drawing code (draws everything) (Panther) */ 128 CGContextDrawImage (viewContextRef, CGRectMake(0, 0, [self bounds].size.width, [self bounds].size.height), imageRef); 129 130 } 94 131 CGImageRelease (imageRef); 95 132 } … … 203 240 204 241 return fullscreen; 205 }206 207 - (void) drawContent:(DisplayState *)ds208 {209 // NSLog(@"quartzView: drawcontent");210 211 [self display];212 242 } 213 243 … … 305 335 so we can handle clicks on other GUI Items */ 306 336 if(fullscreen) { 307 /* exception: if the user activated the toolbar, mouse grab is released; so when he clicks on fullscreen view we have to grab again */308 if([pc fullscreenController] && [[pc fullscreenController] showsToolbar]) {309 [[pc fullscreenController] toggleToolbar];310 [pc grabMouse];311 }312 337 } else if([pc absolute_enabled]) { 313 338 if (![pc tablet_enabled]) trunk/qcontrol/cocoaControlController.m
r49 r58 34 34 /* preferences */ 35 35 [[NSUserDefaults standardUserDefaults] registerDefaults:[[NSDictionary alloc] initWithObjects:[NSArray arrayWithObjects: 36 [NSString stringWithString:@" OpenGL"], /* enable OpenGL*/36 [NSString stringWithString:@"Quartz"], /* enable Quartz by default */ 37 37 [NSNumber numberWithBool:TRUE], /* enable search for updates */ 38 38 [@"~/Documents/QEMU" stringByExpandingTildeInPath], /* standart path */