Bug 831829 - Fix OSX titlebar painting from being upside-down and tiled. r=roc

This commit is contained in:
Matt Woodrow 2013-01-19 14:07:32 +13:00
parent f83cf21406
commit b567e17307
3 changed files with 6 additions and 8 deletions

View File

@ -672,7 +672,10 @@ nsChildView::WillPaint()
}
NSRect flippedTitlebarRect = { NSZeroPoint, titlebarRect.size };
CGContextRef context = mTitlebarSurf->GetCGContext();
CGContextSaveGState(context);
[(ChildView*)mView drawRect:flippedTitlebarRect inTitlebarContext:context];
CGContextRestoreGState(context);
}
void
@ -2518,7 +2521,7 @@ NSEvent* gLastDragMouseDownEvent = nil;
const NSRect *rects;
NSInteger count, i;
[[NSView focusView] getRectsBeingDrawn:&rects count:&count];
if (count < MAX_RECTS_IN_REGION) {
if (count < MAX_RECTS_IN_REGION && !aIsAlternate) {
for (i = 0; i < count; ++i) {
// Add the rect to the region.
NSRect r = [self convertRect:rects[i] fromView:[NSView focusView]];

View File

@ -2963,12 +2963,7 @@ TitlebarDrawCallback(void* aInfo, CGContextRef aContext)
if (!view || ![view isKindOfClass:[ChildView class]])
return;
// Gecko drawing assumes flippedness, but the current context isn't flipped
// (because we're painting into the window's border view, which is not a
// ChildView, so it isn't flipped).
// So we need to set a flip transform.
CGContextScaleCTM(aContext, 1.0f, -1.0f);
CGContextTranslateCTM(aContext, 0.0f, -[window frame].size.height);
CGContextTranslateCTM(aContext, 0.0f, [window frame].size.height - titlebarRect.size.height);
[(ChildView*)view drawTitlebar:[window frame] inTitlebarContext:aContext];
} else {

View File

@ -940,7 +940,7 @@ LayerManager* nsBaseWidget::GetLayerManager(PLayersChild* aShadowManager,
}
}
if (!mLayerManager) {
mBasicLayerManager = mLayerManager = CreateBasicLayerManager();
mLayerManager = CreateBasicLayerManager();
}
}
if (mTemporarilyUseBasicLayerManager && !mBasicLayerManager) {