Commit 9eb3eb36 authored by Matt Woodrow's avatar Matt Woodrow
Browse files

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

parent b0be95b7
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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]];
+1 −6
Original line number Diff line number Diff line
@@ -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 {
+1 −1
Original line number Diff line number Diff line
@@ -940,7 +940,7 @@ LayerManager* nsBaseWidget::GetLayerManager(PLayersChild* aShadowManager,
      }
    }
    if (!mLayerManager) {
      mBasicLayerManager = mLayerManager = CreateBasicLayerManager();
      mLayerManager = CreateBasicLayerManager();
    }
  }
  if (mTemporarilyUseBasicLayerManager && !mBasicLayerManager) {