Bug 1534557 - Implement GtkCompositorWidget::GetEGLNativeWindow() for GET_NATIVE_WINDOW_FROM_COMPOSITOR_WIDGET r=jgilbert

Differential Revision: https://phabricator.services.mozilla.com/D23106

--HG--
extra : moz-landing-system : lando
This commit is contained in:
sotaro 2019-03-13 00:18:49 +00:00
Родитель f42cec8f44
Коммит 414520a0b9
3 изменённых файлов: 13 добавлений и 3 удалений

Просмотреть файл

@ -6,9 +6,8 @@
#if defined(MOZ_WIDGET_GTK) #if defined(MOZ_WIDGET_GTK)
# define GET_NATIVE_WINDOW_FROM_REAL_WIDGET(aWidget) \ # define GET_NATIVE_WINDOW_FROM_REAL_WIDGET(aWidget) \
((EGLNativeWindowType)aWidget->GetNativeData(NS_NATIVE_EGL_WINDOW)) ((EGLNativeWindowType)aWidget->GetNativeData(NS_NATIVE_EGL_WINDOW))
# define GET_NATIVE_WINDOW_FROM_COMPOSITOR_WIDGET(aWidget) \ # define GET_NATIVE_WINDOW_FROM_COMPOSITOR_WIDGET(aWidget) \
((EGLNativeWindowType)aWidget->RealWidget()->GetNativeData( \ (aWidget->AsX11()->GetEGLNativeWindow())
NS_NATIVE_EGL_WINDOW))
#elif defined(MOZ_WIDGET_ANDROID) #elif defined(MOZ_WIDGET_ANDROID)
# define GET_NATIVE_WINDOW_FROM_REAL_WIDGET(aWidget) \ # define GET_NATIVE_WINDOW_FROM_REAL_WIDGET(aWidget) \
((EGLNativeWindowType)aWidget->GetNativeData(NS_JAVA_SURFACE)) ((EGLNativeWindowType)aWidget->GetNativeData(NS_JAVA_SURFACE))
@ -73,6 +72,10 @@
#include "ScopedGLHelpers.h" #include "ScopedGLHelpers.h"
#include "TextureImageEGL.h" #include "TextureImageEGL.h"
#if defined(MOZ_WIDGET_GTK)
# include "mozilla/widget/GtkCompositorWidget.h"
#endif
#if defined(MOZ_WAYLAND) #if defined(MOZ_WAYLAND)
# include "nsAutoPtr.h" # include "nsAutoPtr.h"
# include "nsDataHashtable.h" # include "nsDataHashtable.h"

Просмотреть файл

@ -103,5 +103,9 @@ uintptr_t GtkCompositorWidget::GetWidgetKey() {
return reinterpret_cast<uintptr_t>(mWidget); return reinterpret_cast<uintptr_t>(mWidget);
} }
EGLNativeWindowType GtkCompositorWidget::GetEGLNativeWindow() {
return (EGLNativeWindowType)mWidget->GetNativeData(NS_NATIVE_EGL_WINDOW);
}
} // namespace widget } // namespace widget
} // namespace mozilla } // namespace mozilla

Просмотреть файл

@ -6,6 +6,7 @@
#ifndef widget_gtk_GtkCompositorWidget_h #ifndef widget_gtk_GtkCompositorWidget_h
#define widget_gtk_GtkCompositorWidget_h #define widget_gtk_GtkCompositorWidget_h
#include "GLDefs.h"
#include "mozilla/widget/CompositorWidget.h" #include "mozilla/widget/CompositorWidget.h"
#include "WindowSurfaceProvider.h" #include "WindowSurfaceProvider.h"
@ -62,6 +63,8 @@ class GtkCompositorWidget : public CompositorWidget,
Display* XDisplay() const { return mXDisplay; } Display* XDisplay() const { return mXDisplay; }
Window XWindow() const { return mXWindow; } Window XWindow() const { return mXWindow; }
EGLNativeWindowType GetEGLNativeWindow();
// PlatformCompositorWidgetDelegate Overrides // PlatformCompositorWidgetDelegate Overrides
void NotifyClientSizeChanged(const LayoutDeviceIntSize& aClientSize) override; void NotifyClientSizeChanged(const LayoutDeviceIntSize& aClientSize) override;