Bug 1426329 - Reduce includes of GLContext.h in headers. - r=lenzak
authorJeff Gilbert <jgilbert@mozilla.com>
Wed, 20 Dec 2017 00:43:11 -0800
changeset 448836 c615316e9ab055a75267fe253000f553d340315f
parent 448781 47eabc18d2945fa94e0f5aed76c877b9ad3427dd
child 448837 61bd69c90dcec987c858ed1a9e73beb99fd8f55b
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslenzak
bugs1426329
milestone59.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 1426329 - Reduce includes of GLContext.h in headers. - r=lenzak MozReview-Commit-ID: LPrK3ghNI5f
gfx/gl/GLLibraryEGL.h
gfx/gl/GLTypes.h
gfx/gl/SharedSurface.cpp
gfx/gl/SharedSurface.h
gfx/vr/ipc/VRLayerChild.h
widget/android/AndroidCompositorWidget.h
--- a/gfx/gl/GLLibraryEGL.h
+++ b/gfx/gl/GLLibraryEGL.h
@@ -13,42 +13,26 @@
 #include "mozilla/StaticMutex.h"
 #include "mozilla/ThreadLocal.h"
 #include "nsIFile.h"
 #include "GeckoProfiler.h"
 
 #include <bitset>
 #include <vector>
 
-#ifdef XP_WIN
-    #ifndef WIN32_LEAN_AND_MEAN
-        #define WIN32_LEAN_AND_MEAN 1
-    #endif
-
-    #include <windows.h>
-
-    typedef HDC EGLNativeDisplayType;
-    typedef HBITMAP EGLNativePixmapType;
-    typedef HWND EGLNativeWindowType;
-#else
-    typedef void* EGLNativeDisplayType;
-    typedef void* EGLNativePixmapType;
-    typedef void* EGLNativeWindowType;
-
-    #ifdef ANDROID
-        // We only need to explicitly dlopen egltrace
-        // on android as we can use LD_PRELOAD or other tricks
-        // on other platforms. We look for it in /data/local
-        // as that's writeable by all users
-        //
-        // This should really go in GLLibraryEGL.cpp but we currently reference
-        // APITRACE_LIB in GLContextProviderEGL.cpp. Further refactoring
-        // will come in subsequent patches on Bug 732865
-        #define APITRACE_LIB "/data/local/tmp/egltrace.so"
-    #endif
+#ifdef ANDROID
+    // We only need to explicitly dlopen egltrace
+    // on android as we can use LD_PRELOAD or other tricks
+    // on other platforms. We look for it in /data/local
+    // as that's writeable by all users
+    //
+    // This should really go in GLLibraryEGL.cpp but we currently reference
+    // APITRACE_LIB in GLContextProviderEGL.cpp. Further refactoring
+    // will come in subsequent patches on Bug 732865
+    #define APITRACE_LIB "/data/local/tmp/egltrace.so"
 #endif
 
 #if defined(MOZ_X11)
 #define EGL_DEFAULT_DISPLAY  ((EGLNativeDisplayType)mozilla::DefaultXDisplay())
 #else
 #define EGL_DEFAULT_DISPLAY  ((EGLNativeDisplayType)0)
 #endif
 
--- a/gfx/gl/GLTypes.h
+++ b/gfx/gl/GLTypes.h
@@ -1,13 +1,13 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#if !defined(GLTYPES_H_)
+#ifndef GLTYPES_H_
 #define GLTYPES_H_
 
 #include <stddef.h>
 #include <stdint.h>
 
 #ifndef GLAPIENTRY
 # ifdef WIN32
 #  include <windef.h>
@@ -89,9 +89,26 @@ typedef uint64_t EGLTime;
 
 #define EGL_NO_CONTEXT       ((EGLContext)0)
 #define EGL_NO_DISPLAY       ((EGLDisplay)0)
 #define EGL_NO_SURFACE       ((EGLSurface)0)
 #define EGL_NO_CONFIG        ((EGLConfig)nullptr)
 #define EGL_NO_SYNC          ((EGLSync)0)
 #define EGL_NO_IMAGE         ((EGLImage)0)
 
+
+#ifdef XP_WIN
+    #ifndef WIN32_LEAN_AND_MEAN
+        #define WIN32_LEAN_AND_MEAN 1
+    #endif
+
+    #include <windef.h>
+
+    typedef HDC EGLNativeDisplayType;
+    typedef HBITMAP EGLNativePixmapType;
+    typedef HWND EGLNativeWindowType;
+#else
+    typedef void* EGLNativeDisplayType;
+    typedef void* EGLNativePixmapType;
+    typedef void* EGLNativeWindowType;
 #endif
+
+#endif // GLTYPES_H_
--- a/gfx/gl/SharedSurface.cpp
+++ b/gfx/gl/SharedSurface.cpp
@@ -214,16 +214,18 @@ SharedSurface::SharedSurface(SharedSurfa
     , mGL(gl)
     , mSize(size)
     , mHasAlpha(hasAlpha)
     , mCanRecycle(canRecycle)
     , mIsLocked(false)
     , mIsProducerAcquired(false)
 { }
 
+SharedSurface::~SharedSurface() = default;
+
 layers::TextureFlags
 SharedSurface::GetTextureFlags() const
 {
     return layers::TextureFlags::NO_FLAGS;
 }
 
 void
 SharedSurface::LockProd()
--- a/gfx/gl/SharedSurface.h
+++ b/gfx/gl/SharedSurface.h
@@ -71,18 +71,17 @@ protected:
     SharedSurface(SharedSurfaceType type,
                   AttachmentType attachType,
                   GLContext* gl,
                   const gfx::IntSize& size,
                   bool hasAlpha,
                   bool canRecycle);
 
 public:
-    virtual ~SharedSurface() {
-    }
+    virtual ~SharedSurface();
 
     // Specifies to the TextureClient any flags which
     // are required by the SharedSurface backend.
     virtual layers::TextureFlags GetTextureFlags() const;
 
     bool IsLocked() const { return mIsLocked; }
     bool IsProducerAcquired() const { return mIsProducerAcquired; }
 
--- a/gfx/vr/ipc/VRLayerChild.h
+++ b/gfx/vr/ipc/VRLayerChild.h
@@ -6,17 +6,16 @@
 
 #ifndef GFX_VR_LAYERCHILD_H
 #define GFX_VR_LAYERCHILD_H
 
 #include "VRManagerChild.h"
 
 #include "mozilla/RefPtr.h"
 #include "mozilla/gfx/PVRLayerChild.h"
-#include "GLContext.h"
 #include "gfxVR.h"
 
 class nsICanvasRenderingContextInternal;
 
 namespace mozilla {
 class WebGLContext;
 namespace dom {
 class HTMLCanvasElement;
--- a/widget/android/AndroidCompositorWidget.h
+++ b/widget/android/AndroidCompositorWidget.h
@@ -1,19 +1,17 @@
 /* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_widget_AndroidCompositorWidget_h
 #define mozilla_widget_AndroidCompositorWidget_h
 
-#include "GLContext.h"
-#include "GLLibraryEGL.h"
-#include "GLTypes.h"
+#include "GLDefs.h"
 #include "mozilla/widget/InProcessCompositorWidget.h"
 
 struct ANativeWindow;
 
 namespace mozilla {
 namespace widget {
 
 /**