mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-09 08:48:07 +00:00
use the correct cg context for drawing buttons all the time, so long as we have a minimum sdk of 10.4. b=382883 r=smorgan sr=roc
This commit is contained in:
parent
9f8e758b7f
commit
0956b1d58d
@ -184,12 +184,16 @@ nsNativeThemeCocoa::DrawButton(CGContextRef cgContext, ThemeButtonKind inKind,
|
||||
[image setSize:NSMakeSize(offscreenWidth, inBoxRect.size.height)];
|
||||
|
||||
// render to the given CGContextRef
|
||||
//[NSGraphicsContext saveGraphicsState];
|
||||
// we can't use graphicsContextWithGraphicsPort now because that is 10.4 only, this is a band-aid
|
||||
//[NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithGraphicsPort:cgContext flipped:YES]];
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAX_OS_X_VERSION_10_4
|
||||
// graphicsContextWithGraphicsPort is only available on 10.4+
|
||||
[NSGraphicsContext saveGraphicsState];
|
||||
[NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithGraphicsPort:cgContext flipped:YES]];
|
||||
#endif
|
||||
[image compositeToPoint:NSMakePoint(inBoxRect.origin.x, inBoxRect.origin.y + inBoxRect.size.height)
|
||||
operation:NSCompositeSourceOver];
|
||||
//[NSGraphicsContext restoreGraphicsState];
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAX_OS_X_VERSION_10_4
|
||||
[NSGraphicsContext restoreGraphicsState];
|
||||
#endif
|
||||
[image release];
|
||||
}
|
||||
else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user