# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1303434818 0 # Node ID 361d80388dc93fba9a420b2d79c07353b041b8ac # Parent 61732be875c73c6de5dc91e887348c15b7914ab0 Test fix at the partial bitblt issue on Mac. Also combine setting up the flipped graphics context into a single command. diff -r 61732be875c7 -r 361d80388dc9 mac/dw.m --- a/mac/dw.m Thu Apr 21 22:53:05 2011 +0000 +++ b/mac/dw.m Fri Apr 22 01:13:38 2011 +0000 @@ -422,9 +422,7 @@ { [NSGraphicsContext saveGraphicsState]; [NSGraphicsContext setCurrentContext:[NSGraphicsContext - graphicsContextWithBitmapImageRep:bltdest]]; - [NSGraphicsContext setCurrentContext:[NSGraphicsContext - graphicsContextWithGraphicsPort:[[NSGraphicsContext currentContext] graphicsPort] flipped:YES]]; + graphicsContextWithGraphicsPort:[[NSGraphicsContext graphicsContextWithBitmapImageRep:bltdest] graphicsPort] flipped:YES]]; [[NSDictionary alloc] initWithObjectsAndKeys:bltdest, NSGraphicsContextDestinationAttributeName, nil]; } else @@ -456,7 +454,7 @@ [t scaleXBy:1.0 yBy:-1.0]; // but we also have to translate it back by its height: - [t translateXBy:0.0 yBy:-bltinfo->height]; + [t translateXBy:0.0 yBy:-[rep size].height]; // apply the transform: [t concat]; @@ -4391,9 +4389,7 @@ image = (id)pixmap->image; [NSGraphicsContext saveGraphicsState]; [NSGraphicsContext setCurrentContext:[NSGraphicsContext - graphicsContextWithBitmapImageRep:image]]; - [NSGraphicsContext setCurrentContext:[NSGraphicsContext - graphicsContextWithGraphicsPort:[[NSGraphicsContext currentContext] graphicsPort] flipped:YES]]; + graphicsContextWithGraphicsPort:[[NSGraphicsContext graphicsContextWithBitmapImageRep:image] graphicsPort] flipped:YES]]; } else { @@ -4441,9 +4437,7 @@ image = (id)pixmap->image; [NSGraphicsContext saveGraphicsState]; [NSGraphicsContext setCurrentContext:[NSGraphicsContext - graphicsContextWithBitmapImageRep:image]]; - [NSGraphicsContext setCurrentContext:[NSGraphicsContext - graphicsContextWithGraphicsPort:[[NSGraphicsContext currentContext] graphicsPort] flipped:YES]]; + graphicsContextWithGraphicsPort:[[NSGraphicsContext graphicsContextWithBitmapImageRep:image] graphicsPort] flipped:YES]]; } else { @@ -4527,9 +4521,7 @@ image = (id)pixmap->image; [NSGraphicsContext saveGraphicsState]; [NSGraphicsContext setCurrentContext:[NSGraphicsContext - graphicsContextWithBitmapImageRep:image]]; - [NSGraphicsContext setCurrentContext:[NSGraphicsContext - graphicsContextWithGraphicsPort:[[NSGraphicsContext currentContext] graphicsPort] flipped:YES]]; + graphicsContextWithGraphicsPort:[[NSGraphicsContext graphicsContextWithBitmapImageRep:image] graphicsPort] flipped:YES]]; NSColor *fgcolor = pthread_getspecific(_dw_fg_color_key); NSColor *bgcolor = pthread_getspecific(_dw_bg_color_key); NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithObjectsAndKeys:fgcolor, NSForegroundColorAttributeName, nil]; @@ -4607,9 +4599,7 @@ image = (id)pixmap->image; [NSGraphicsContext saveGraphicsState]; [NSGraphicsContext setCurrentContext:[NSGraphicsContext - graphicsContextWithBitmapImageRep:image]]; - [NSGraphicsContext setCurrentContext:[NSGraphicsContext - graphicsContextWithGraphicsPort:[[NSGraphicsContext currentContext] graphicsPort] flipped:YES]]; + graphicsContextWithGraphicsPort:[[NSGraphicsContext graphicsContextWithBitmapImageRep:image] graphicsPort] flipped:YES]]; } else { @@ -4667,9 +4657,7 @@ image = (id)pixmap->image; [NSGraphicsContext saveGraphicsState]; [NSGraphicsContext setCurrentContext:[NSGraphicsContext - graphicsContextWithBitmapImageRep:image]]; - [NSGraphicsContext setCurrentContext:[NSGraphicsContext - graphicsContextWithGraphicsPort:[[NSGraphicsContext currentContext] graphicsPort] flipped:YES]]; + graphicsContextWithGraphicsPort:[[NSGraphicsContext graphicsContextWithBitmapImageRep:image] graphicsPort] flipped:YES]]; } else {