mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 04:45:45 +00:00
Bug 397209 - Catch ObjC exception when trying to draw to an offscreen buffer. r=josh sr=vlad a1.9=vlad
This commit is contained in:
parent
72fe490130
commit
9f3cde2e41
@ -189,7 +189,13 @@ nsNativeThemeCocoa::DrawButton(CGContextRef cgContext, ThemeButtonKind inKind,
|
||||
drawFrame.size.height = offscreenHeight - NATIVE_PUSH_BUTTON_HEIGHT_DIFF;
|
||||
|
||||
// draw into offscreen image
|
||||
[image lockFocus];
|
||||
NS_DURING
|
||||
[image lockFocus];
|
||||
NS_HANDLER
|
||||
NS_ASSERTION(0, "Could not lock focus on offscreen buffer");
|
||||
[image release];
|
||||
return;
|
||||
NS_ENDHANDLER
|
||||
[[NSGraphicsContext currentContext] setImageInterpolation:NSImageInterpolationLow];
|
||||
HIThemeDrawButton(&drawFrame, &bdi, (CGContext*)[[NSGraphicsContext currentContext] graphicsPort], kHIThemeOrientationInverted, NULL);
|
||||
[image unlockFocus];
|
||||
|
Loading…
Reference in New Issue
Block a user