Commit 76023e93 authored by Robert Mader's avatar Robert Mader
Browse files

Bug 1709606 - Rename CompositorWidget::AsX11() to CompositorWidget->AsGTK(), r=stransky,nical

Nowadays we often use it for Wayland, which is confusing. Also, it
has a bunch of GTK specific functions, which an alternative X11
implementation would like not have. So a explicit name is probably
deserved.

Depends on D114424

Differential Revision: https://phabricator.services.mozilla.com/D114425
parent 56983e3a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@
#  define GET_NATIVE_WINDOW_FROM_REAL_WIDGET(aWidget) \
    ((EGLNativeWindowType)aWidget->GetNativeData(NS_NATIVE_EGL_WINDOW))
#  define GET_NATIVE_WINDOW_FROM_COMPOSITOR_WIDGET(aWidget) \
    (aWidget->AsX11()->GetEGLNativeWindow())
    (aWidget->AsGTK()->GetEGLNativeWindow())
#elif defined(MOZ_WIDGET_ANDROID)
#  define GET_NATIVE_WINDOW_FROM_REAL_WIDGET(aWidget) \
    ((EGLNativeWindowType)aWidget->GetNativeData(NS_JAVA_SURFACE))
@@ -1010,7 +1010,7 @@ already_AddRefed<GLContext> GLContextProviderEGL::CreateForCompositorWidget(
  if (aCompositorWidget) {
    window = GET_NATIVE_WINDOW_FROM_COMPOSITOR_WIDGET(aCompositorWidget);
#if defined(MOZ_WIDGET_GTK)
    depth = aCompositorWidget->AsX11()->GetDepth();
    depth = aCompositorWidget->AsGTK()->GetDepth();
#endif
  } else {
#if defined(MOZ_WIDGET_GTK)
+1 −1
Original line number Diff line number Diff line
@@ -785,7 +785,7 @@ already_AddRefed<GLContext> GLContextProviderGLX::CreateForCompositorWidget(
    MOZ_ASSERT(false);
    return nullptr;
  }
  GtkCompositorWidget* compWidget = aCompositorWidget->AsX11();
  GtkCompositorWidget* compWidget = aCompositorWidget->AsGTK();
  MOZ_ASSERT(compWidget);

  return CreateForWidget(DefaultXDisplay(), compWidget->XWindow(),
+2 −2
Original line number Diff line number Diff line
@@ -1005,8 +1005,8 @@ Maybe<IntRect> CompositorOGL::BeginFrame(const nsIntRegion& aInvalidRegion,

    mWidgetSize = LayoutDeviceIntSize::FromUnknownSize(rect.Size());
#ifdef MOZ_WAYLAND
    if (mWidget && mWidget->AsX11()) {
      mWidget->AsX11()->SetEGLNativeWindowSize(mWidgetSize);
    if (mWidget && mWidget->AsGTK()) {
      mWidget->AsGTK()->SetEGLNativeWindowSize(mWidgetSize);
    }
#endif
  } else {
+2 −2
Original line number Diff line number Diff line
@@ -75,8 +75,8 @@ bool RenderCompositorEGL::BeginFrame() {
        << "We don't have EGLSurface to draw into. Called too early?";
    return false;
  }
  if (mWidget->AsX11()) {
    mWidget->AsX11()->SetEGLNativeWindowSize(GetBufferSize());
  if (mWidget->AsGTK()) {
    mWidget->AsGTK()->SetEGLNativeWindowSize(GetBufferSize());
  }
#endif
  if (!MakeCurrent()) {
+1 −1
Original line number Diff line number Diff line
@@ -264,7 +264,7 @@ class CompositorWidget {
  virtual RefPtr<VsyncObserver> GetVsyncObserver() const;

  virtual WinCompositorWidget* AsWindows() { return nullptr; }
  virtual GtkCompositorWidget* AsX11() { return nullptr; }
  virtual GtkCompositorWidget* AsGTK() { return nullptr; }
  virtual AndroidCompositorWidget* AsAndroid() { return nullptr; }

  /**
Loading