Mercurial > dwindows
changeset 915:361d80388dc9
Test fix at the partial bitblt issue on Mac.
Also combine setting up the flipped graphics context into a single command.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 22 Apr 2011 01:13:38 +0000 |
parents | 61732be875c7 |
children | 44a0f9a2e8f9 |
files | mac/dw.m |
diffstat | 1 files changed, 7 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- 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 {