Bug 1491442 - Remove -[ChildView isUsingOpenGL] and use mUsingOMTCompositor instead. r=mattwoodrow
authorMarkus Stange <mstange@themasta.com>
Fri, 16 Aug 2019 01:11:27 +0000
changeset 488405 8e82722106c0d88adb7cbf322d764e72e7848838
parent 488404 d66f54731eeb5e3117561152005e9a48a22c3838
child 488406 9ffcdc648de567afa343e025298a2e2a424e7512
push id36443
push userccoroiu@mozilla.com
push dateFri, 16 Aug 2019 09:48:15 +0000
treeherdermozilla-central@5d4cbfe103bb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1491442
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1491442 - Remove -[ChildView isUsingOpenGL] and use mUsingOMTCompositor instead. r=mattwoodrow We always use OMTC when using OpenGL. We also currently always use OpenGL when using OMTC, but that's about to change. Differential Revision: https://phabricator.services.mozilla.com/D38752
widget/cocoa/nsChildView.mm
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -181,17 +181,16 @@ static NSMutableDictionary* sNativeKeyEv
 - (void)convertCocoaMouseEvent:(NSEvent*)aMouseEvent toGeckoEvent:(WidgetInputEvent*)outGeckoEvent;
 - (void)convertCocoaTabletPointerEvent:(NSEvent*)aMouseEvent
                           toGeckoEvent:(WidgetMouseEvent*)outGeckoEvent;
 - (NSMenu*)contextMenu;
 
 - (BOOL)isRectObscuredBySubview:(NSRect)inRect;
 
 - (LayoutDeviceIntRegion)nativeDirtyRegionWithBoundingRect:(NSRect)aRect;
-- (BOOL)isUsingOpenGL;
 
 - (BOOL)hasRoundedBottomCorners;
 - (CGFloat)cornerRadius;
 - (void)clearCorners;
 
 - (void)setGLOpaque:(BOOL)aOpaque;
 
 // Overlay drawing functions for traditional CGContext drawing
@@ -3212,17 +3211,17 @@ NSEvent* gLastDragMouseDownEvent = nil;
     // a non-main thread. Ignore those calls because Gecko can only react to
     // them on the main thread.
     return;
   }
 
   if (!mGeckoChild || !mGeckoChild->IsVisible()) return;
   CGContextRef cgContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
 
-  if ([self isUsingOpenGL]) {
+  if (mUsingOMTCompositor) {
     // Make sure the window's "drawRect" buffer does not interfere with our
     // OpenGL drawing's rounded corners.
     [self clearCorners];
     // Force a sync OMTC composite into the OpenGL context and return.
     LayoutDeviceIntRect geckoBounds = mGeckoChild->GetBounds();
     LayoutDeviceIntRegion region(geckoBounds);
     mGeckoChild->PaintWindow(region);
     return;
@@ -3257,22 +3256,16 @@ NSEvent* gLastDragMouseDownEvent = nil;
   }
 
   if ([self isCoveringTitlebar]) {
     [self drawTitleString];
     [self maskTopCornersInContext:cgContext];
   }
 }
 
-- (BOOL)isUsingOpenGL {
-  if (!mGeckoChild || ![self window]) return NO;
-
-  return mGLContext || mUsingOMTCompositor;
-}
-
 - (BOOL)hasRoundedBottomCorners {
   return [[self window] respondsToSelector:@selector(bottomCornerRounded)] &&
          [[self window] bottomCornerRounded];
 }
 
 - (CGFloat)cornerRadius {
   NSView* frameView = [[[self window] contentView] superview];
   if (!frameView || ![frameView respondsToSelector:@selector(roundedCornerRadius)]) return 4.0f;
@@ -3414,17 +3407,17 @@ NSEvent* gLastDragMouseDownEvent = nil;
         widgetArray.AppendElement(parent);
         parent = parent->GetParent();
       }
       widgetArray.AppendElement(mGeckoChild);
       nsCOMPtr<nsIRunnable> releaserRunnable = new WidgetsReleaserRunnable(std::move(widgetArray));
       NS_DispatchToMainThread(releaserRunnable);
     }
 
-    if ([self isUsingOpenGL]) {
+    if (mUsingOMTCompositor) {
       if (ShadowLayerForwarder* slf = mGeckoChild->GetLayerManager()->AsShadowForwarder()) {
         slf->WindowOverlayChanged();
       } else if (WebRenderLayerManager* wrlm =
                      mGeckoChild->GetLayerManager()->AsWebRenderLayerManager()) {
         wrlm->WindowOverlayChanged();
       }
     }