Bug 1785744 [wpt PR 35504] - Recalc style for elements where :toggle() pseudo-class...
[gecko.git] / gfx / gl / moz.build
blobf622bc1818d910f34ce542d1bb71ccd314c350cf
1 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
2 # vim: set filetype=python:
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 gl_provider = "Null"
9 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
10     gl_provider = "WGL"
11 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
12     gl_provider = "CGL"
13 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "uikit":
14     gl_provider = "EAGL"
15 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
16     gl_provider = "Linux"
17 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
18     gl_provider = "EGL"
20 if CONFIG["MOZ_GL_PROVIDER"]:
21     gl_provider = CONFIG["MOZ_GL_PROVIDER"]
23 EXPORTS += [
24     "AndroidSurfaceTexture.h",
25     "ForceDiscreteGPUHelperCGL.h",
26     "GfxTexturesReporter.h",
27     "GLBlitHelper.h",
28     "GLConsts.h",
29     "GLContext.h",
30     "GLContextEGL.h",
31     "GLContextProvider.h",
32     "GLContextProviderImpl.h",
33     "GLContextSymbols.h",
34     "GLContextTypes.h",
35     "GLDefs.h",
36     "GLLibraryEGL.h",
37     "GLLibraryLoader.h",
38     "GLReadTexImageHelper.h",
39     "GLScreenBuffer.h",
40     "GLTextureImage.h",
41     "GLTypes.h",
42     "GLUploadHelpers.h",
43     "HeapCopyOfStackArray.h",
44     "MozFramebuffer.h",
45     "ScopedGLHelpers.h",
46     "SharedSurface.h",
47     "SharedSurfaceEGL.h",
48     "SharedSurfaceGL.h",
49     "SurfaceTypes.h",
52 # Win32 is a special snowflake, for ANGLE
53 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
54     REQUIRES_UNIFIED_BUILD = True
55     EXPORTS += [
56         "GLContextWGL.h",
57         "SharedSurfaceANGLE.h",  # Needs <windows.h> for `HANDLE`.
58         "SharedSurfaceD3D11Interop.h",
59         "WGLLibrary.h",
60     ]
61     UNIFIED_SOURCES += [
62         "GLBlitHelperD3D.cpp",
63         "GLContextProviderWGL.cpp",
64         "SharedSurfaceANGLE.cpp",
65         "SharedSurfaceD3D11Interop.cpp",
66     ]
68 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
69     EXPORTS += [
70         "AndroidNativeWindow.h",
71         "SharedSurfaceAndroidHardwareBuffer.h",
72     ]
73     UNIFIED_SOURCES += [
74         "SharedSurfaceAndroidHardwareBuffer.cpp",
75     ]
77 if gl_provider == "CGL":
78     # These files include Mac headers that are unfriendly to unified builds
79     SOURCES += [
80         "GLContextProviderCGL.mm",
81     ]
82     EXPORTS += [
83         "GLContextCGL.h",
84         "SharedSurfaceIO.h",
85     ]
86     # SharedSurfaceIO.cpp includes MacIOSurface.h which include Mac headers
87     # which define Size and Point types in root namespace with often conflict with
88     # our own types. While I haven't actually hit this issue in the present case,
89     # it's been an issue in gfx/layers so let's not risk it.
90     SOURCES += [
91         "SharedSurfaceIO.cpp",
92     ]
93     OS_LIBS += [
94         "-framework IOSurface",
95     ]
97 elif gl_provider == "EAGL":
98     # These files include ObjC headers that are unfriendly to unified builds
99     SOURCES += [
100         "GLContextProviderEAGL.mm",
101     ]
102     EXPORTS += [
103         "GLContextEAGL.h",
104     ]
106 elif gl_provider == "Linux":
107     # GLContextProviderGLX.cpp needs to be kept out of UNIFIED_SOURCES
108     # as it includes X11 headers which cause conflicts.
109     SOURCES += [
110         "GLContextProviderLinux.cpp",
111     ]
112     EXPORTS += ["GLContextGLX.h", "GLXLibrary.h"]
113     if CONFIG["MOZ_X11"]:
114         SOURCES += ["GLContextProviderGLX.cpp"]
116 if CONFIG["MOZ_WAYLAND"]:
117     SOURCES += ["SharedSurfaceDMABUF.cpp"]
119 UNIFIED_SOURCES += [
120     "AndroidSurfaceTexture.cpp",
121     "GfxTexturesReporter.cpp",
122     "GLBlitHelper.cpp",
123     "GLContext.cpp",
124     "GLContextFeatures.cpp",
125     "GLContextProviderEGL.cpp",
126     "GLDebugUtils.cpp",
127     "GLLibraryEGL.cpp",
128     "GLLibraryLoader.cpp",
129     "GLReadTexImageHelper.cpp",
130     "GLTextureImage.cpp",
131     "GLUploadHelpers.cpp",
132     "MozFramebuffer.cpp",
133     "ScopedGLHelpers.cpp",
134     "SharedSurface.cpp",
135     "SharedSurfaceEGL.cpp",
136     "SharedSurfaceGL.cpp",
138 SOURCES += [
139     "GLScreenBuffer.cpp",
142 include("/ipc/chromium/chromium-config.mozbuild")
144 FINAL_LIBRARY = "xul"
146 if CONFIG["MOZ_D3DCOMPILER_VISTA_DLL"]:
147     DEFINES["MOZ_D3DCOMPILER_VISTA_DLL"] = CONFIG["MOZ_D3DCOMPILER_VISTA_DLL"]
149 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
150     CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
151     CFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
153 CXXFLAGS += ["-Werror=switch"]
155 if CONFIG["MOZ_WAYLAND"]:
156     CXXFLAGS += CONFIG["MOZ_WAYLAND_CFLAGS"]
157     CFLAGS += CONFIG["MOZ_WAYLAND_CFLAGS"]
159 LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
160 LOCAL_INCLUDES += [
161     "/gfx/cairo/cairo/src",