зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
6278f77608
Коммит
e963abb7b1
|
@ -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];
|
||||
|
|
Загрузка…
Ссылка в новой задаче