Ticket #24566: attachment.cgi.patch

File attachment.cgi.patch, 4.3 KB (added by Dbryrtfbcbhgf, 22 months ago)

patch for Bug 1394654

  • widget/cocoa/nsChildView.h

    # HG changeset patch
    # User Josh Aas <jaas@kflag.net>
    
    Bug 1394654 - Remove OS X opengl workaround from Mozilla bug 603134; r=mstange
    
    diff --git a/widget/cocoa/nsChildView.h b/widget/cocoa/nsChildView.h
    a b class WidgetRenderingContext; 
    185185    eGestureState_None,
    186186    eGestureState_StartGesture,
    187187    eGestureState_MagnifyGesture,
    188188    eGestureState_RotateGesture
    189189  } mGestureState;
    190190  float mCumulativeMagnification;
    191191  float mCumulativeRotation;
    192192
    193   BOOL mDidForceRefreshOpenGL;
    194193  BOOL mWaitingForPaint;
    195194
    196195#ifdef __LP64__
    197196  // Support for fluid swipe tracking.
    198197  BOOL* mCancelSwipeAnimation;
    199198#endif
    200199
    201200  // Whether this uses off-main-thread compositing.
  • widget/cocoa/nsChildView.mm

    diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
    a b static uint32_t sUniqueKeyEventId = 0; 
    160160
    161161static NSMutableDictionary* sNativeKeyEventsMap =
    162162  [NSMutableDictionary dictionary];
    163163
    164164@interface ChildView(Private)
    165165
    166166// sets up our view, attaching it to its owning gecko view
    167167- (id)initWithFrame:(NSRect)inFrame geckoChild:(nsChildView*)inChild;
    168 - (void)forceRefreshOpenGL;
    169168
    170169// set up a gecko mouse event based on a cocoa mouse event
    171170- (void) convertCocoaMouseWheelEvent:(NSEvent*)aMouseEvent
    172171                        toGeckoEvent:(WidgetWheelEvent*)outWheelEvent;
    173172- (void) convertCocoaMouseEvent:(NSEvent*)aMouseEvent
    174173                   toGeckoEvent:(WidgetInputEvent*)outGeckoEvent;
    175174- (void) convertCocoaTabletPointerEvent:(NSEvent*)aMouseEvent
    176175                           toGeckoEvent:(WidgetMouseEvent*)outGeckoEvent;
    NSEvent* gLastDragMouseDownEvent = nil; 
    33523351    mLastKeyDownEvent = nil;
    33533352    mClickThroughMouseDownEvent = nil;
    33543353    mDragService = nullptr;
    33553354
    33563355    mGestureState = eGestureState_None;
    33573356    mCumulativeMagnification = 0.0;
    33583357    mCumulativeRotation = 0.0;
    33593358
    3360     // We can't call forceRefreshOpenGL here because, in order to work around
    3361     // the bug, it seems we need to have a draw already happening. Therefore,
    3362     // we call it in drawRect:inContext:, when we know that a draw is in
    3363     // progress.
    3364     mDidForceRefreshOpenGL = NO;
    3365 
    33663359    mNeedsGLUpdate = NO;
    33673360
    33683361    [self setFocusRingType:NSFocusRingTypeNone];
    33693362
    33703363#ifdef __LP64__
    33713364    mCancelSwipeAnimation = nil;
    33723365#endif
    33733366
    NSEvent* gLastDragMouseDownEvent = nil; 
    34393432  mTextInputHandler = aHandler;
    34403433}
    34413434
    34423435- (void)uninstallTextInputHandler
    34433436{
    34443437  mTextInputHandler = nullptr;
    34453438}
    34463439
    3447 // Work around bug 603134.
    3448 // OS X has a bug that causes new OpenGL windows to only paint once or twice,
    3449 // then stop painting altogether. By clearing the drawable from the GL context,
    3450 // and then resetting the view to ourselves, we convince OS X to start updating
    3451 // again.
    3452 // This can cause a flash in new windows - bug 631339 - but it's very hard to
    3453 // fix that while maintaining this workaround.
    3454 - (void)forceRefreshOpenGL
    3455 {
    3456   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
    3457 
    3458   [mGLContext clearDrawable];
    3459   CGLLockContext((CGLContextObj)[mGLContext CGLContextObj]);
    3460   [self updateGLContext];
    3461   CGLUnlockContext((CGLContextObj)[mGLContext CGLContextObj]);
    3462 
    3463   NS_OBJC_END_TRY_ABORT_BLOCK;
    3464 }
    3465 
    34663440- (bool)preRender:(NSOpenGLContext *)aGLContext
    34673441{
    34683442  NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
    34693443
    34703444  if (![self window] ||
    34713445      ([[self window] isKindOfClass:[BaseWindow class]] &&
    34723446       ![(BaseWindow*)[self window] isVisibleOrBeingShown])) {
    34733447    // Before the window is shown, our GL context's front FBO is not
    NSEvent* gLastDragMouseDownEvent = nil; 
    39353909    return;
    39363910
    39373911  mWaitingForPaint = NO;
    39383912
    39393913  LayoutDeviceIntRect geckoBounds = mGeckoChild->GetBounds();
    39403914  LayoutDeviceIntRegion region(geckoBounds);
    39413915
    39423916  mGeckoChild->PaintWindow(region);
    3943 
    3944   // Force OpenGL to refresh the very first time we draw. This works around a
    3945   // Mac OS X bug that stops windows updating on OS X when we use OpenGL.
    3946   if (!mDidForceRefreshOpenGL) {
    3947     [self performSelector:@selector(forceRefreshOpenGL) withObject:nil afterDelay:0];
    3948     mDidForceRefreshOpenGL = YES;
    3949   }
    39503917}
    39513918
    39523919// Called asynchronously after setNeedsDisplay in order to avoid entering the
    39533920// normal drawing machinery.
    39543921- (void)drawUsingOpenGLCallback
    39553922{
    39563923  if (mWaitingForPaint) {
    39573924    [self drawUsingOpenGL];