Bug 1685225 - Use state bits to determine the color for non-native theme meter chunks...
[gecko.git] / gfx / 2d / moz.build
blobed40639264c977b4ea60f47a99ee05cd6f760e98
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 EXPORTS.mozilla += [
8     "GenericRefCounted.h",
11 EXPORTS.mozilla.gfx += [
12     "2D.h",
13     "BaseCoord.h",
14     "BaseMargin.h",
15     "BasePoint.h",
16     "BasePoint3D.h",
17     "BasePoint4D.h",
18     "BaseRect.h",
19     "BaseSize.h",
20     "BezierUtils.h",
21     "Blur.h",
22     "BorrowedContext.h",
23     "Coord.h",
24     "CriticalSection.h",
25     "DataSurfaceHelpers.h",
26     "DrawEventRecorder.h",
27     "DrawTargetOffset.h",
28     "DrawTargetRecording.h",
29     "DrawTargetTiled.h",
30     "DrawTargetWrapAndRecord.h",
31     "Filters.h",
32     "FontVariation.h",
33     "Helpers.h",
34     "HelpersCairo.h",
35     "InlineTranslator.h",
36     "IterableArena.h",
37     "Logging.h",
38     "LoggingConstants.h",
39     "Matrix.h",
40     "MatrixFwd.h",
41     "NumericTools.h",
42     "PathHelpers.h",
43     "PatternHelpers.h",
44     "Point.h",
45     "Polygon.h",
46     "Quaternion.h",
47     "RecordedEvent.h",
48     "RecordingTypes.h",
49     "Rect.h",
50     "RectAbsolute.h",
51     "Scale.h",
52     "ScaleFactor.h",
53     "ScaleFactors2D.h",
54     "SourceSurfaceCairo.h",
55     "SourceSurfaceCapture.h",
56     "SourceSurfaceRawData.h",
57     "StackArray.h",
58     "Swizzle.h",
59     "Tools.h",
60     "Triangle.h",
61     "Types.h",
62     "UserData.h",
65 EXPORTS.mozilla.gfx += ["ssse3-scaler.h"]
67 if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("cocoa", "uikit"):
68     EXPORTS.mozilla.gfx += [
69         "MacIOSurface.h",
70         "UnscaledFontMac.h",
71     ]
72     UNIFIED_SOURCES += [
73         "NativeFontResourceMac.cpp",
74         "ScaledFontMac.cpp",
75     ]
76 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
77     EXPORTS.mozilla.gfx += [
78         "dw-extra.h",
79         "UnscaledFontDWrite.h",
80         "UnscaledFontGDI.h",
81     ]
82     SOURCES += [
83         "ConicGradientEffectD2D1.cpp",
84         "DrawTargetD2D1.cpp",
85         "ExtendInputEffectD2D1.cpp",
86         "FilterNodeD2D1.cpp",
87         "NativeFontResourceDWrite.cpp",
88         "NativeFontResourceGDI.cpp",
89         "PathD2D.cpp",
90         "RadialGradientEffectD2D1.cpp",
91         "ScaledFontDWrite.cpp",
92         "ScaledFontWin.cpp",
93         "SourceSurfaceD2D1.cpp",
94     ]
95     DEFINES["WIN32"] = True
97 if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("android", "gtk"):
98     EXPORTS.mozilla.gfx += [
99         "UnscaledFontFreeType.h",
100     ]
101     SOURCES += [
102         "NativeFontResourceFreeType.cpp",
103         "UnscaledFontFreeType.cpp",
104     ]
106 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
107     SOURCES += [
108         "ScaledFontFontconfig.cpp",
109     ]
111 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
112     SOURCES += [
113         "ScaledFontFreeType.cpp",
114     ]
116 if CONFIG["MOZ_ENABLE_SKIA"]:
117     SOURCES += [
118         "ConvolutionFilter.cpp",
119         "DrawTargetSkia.cpp",
120         "PathSkia.cpp",
121         "SourceSurfaceSkia.cpp",
122     ]
123     if CONFIG["CC_TYPE"] == "clang":
124         # Suppress warnings from Skia header files.
125         SOURCES["DrawTargetSkia.cpp"].flags += ["-Wno-implicit-fallthrough"]
126         SOURCES["PathSkia.cpp"].flags += ["-Wno-implicit-fallthrough"]
127         SOURCES["SourceSurfaceSkia.cpp"].flags += ["-Wno-implicit-fallthrough"]
128     EXPORTS.mozilla.gfx += [
129         "ConvolutionFilter.h",
130         "HelpersSkia.h",
131     ]
133 # Are we targeting x86 or x64?  If so, build SSE2 files.
134 if CONFIG["INTEL_ARCHITECTURE"]:
135     SOURCES += [
136         "BlurSSE2.cpp",
137         "FilterProcessingSSE2.cpp",
138         "ImageScalingSSE2.cpp",
139         "ssse3-scaler.c",
140         "SwizzleAVX2.cpp",
141         "SwizzleSSE2.cpp",
142         "SwizzleSSSE3.cpp",
143     ]
144     DEFINES["USE_SSE2"] = True
145     # The file uses SSE2 intrinsics, so it needs special compile flags on some
146     # compilers.
147     SOURCES["BlurSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
148     SOURCES["FilterProcessingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
149     SOURCES["ImageScalingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
150     SOURCES["SwizzleAVX2.cpp"].flags += ["-mavx2"]
151     SOURCES["SwizzleSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
152     SOURCES["SwizzleSSSE3.cpp"].flags += CONFIG["SSSE3_FLAGS"]
153     SOURCES["ssse3-scaler.c"].flags += CONFIG["SSSE3_FLAGS"]
154 elif CONFIG["CPU_ARCH"].startswith("mips"):
155     SOURCES += [
156         "BlurLS3.cpp",
157     ]
159 UNIFIED_SOURCES += [
160     "BezierUtils.cpp",
161     "Blur.cpp",
162     "BufferEdgePad.cpp",
163     "BufferUnrotate.cpp",
164     "CaptureCommandList.cpp",
165     "DataSourceSurface.cpp",
166     "DataSurfaceHelpers.cpp",
167     "DrawEventRecorder.cpp",
168     "DrawTarget.cpp",
169     "DrawTargetCairo.cpp",
170     "DrawTargetCapture.cpp",
171     "DrawTargetDual.cpp",
172     "DrawTargetOffset.cpp",
173     "DrawTargetRecording.cpp",
174     "DrawTargetTiled.cpp",
175     "DrawTargetWrapAndRecord.cpp",
176     "FilterNodeCapture.cpp",
177     "FilterNodeSoftware.cpp",
178     "FilterProcessing.cpp",
179     "FilterProcessingScalar.cpp",
180     "ImageScaling.cpp",
181     "Matrix.cpp",
182     "NativeFontResource.cpp",
183     "Path.cpp",
184     "PathCairo.cpp",
185     "PathCapture.cpp",
186     "PathHelpers.cpp",
187     "PathRecording.cpp",
188     "Quaternion.cpp",
189     "RecordedEvent.cpp",
190     "Scale.cpp",
191     "ScaledFontBase.cpp",
192     "SFNTData.cpp",
193     "SourceSurfaceCairo.cpp",
194     "SourceSurfaceCapture.cpp",
195     "SourceSurfaceRawData.cpp",
196     "Swizzle.cpp",
197     "Types.cpp",
200 SOURCES += [
201     "Factory.cpp",  # Need to suppress warnings in Skia header files.
202     "InlineTranslator.cpp",
205 if CONFIG["CC_TYPE"] == "clang":
206     SOURCES["Factory.cpp"].flags += ["-Wno-implicit-fallthrough"]
208 if CONFIG["CC_TYPE"] in ("clang", "gcc"):
209     CXXFLAGS += ["-Wno-error=shadow"]
211 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
212     EXPORTS.mozilla.gfx += [
213         "QuartzSupport.h",
214     ]
215     SOURCES += [
216         "MacIOSurface.cpp",
217         "QuartzSupport.mm",
218     ]
220 if CONFIG["CPU_ARCH"] == "aarch64" or CONFIG["BUILD_ARM_NEON"]:
221     SOURCES += [
222         "BlurNEON.cpp",
223         "LuminanceNEON.cpp",
224         "SwizzleNEON.cpp",
225     ]
226     DEFINES["USE_NEON"] = True
227     SOURCES["BlurNEON.cpp"].flags += CONFIG["NEON_FLAGS"]
228     SOURCES["LuminanceNEON.cpp"].flags += CONFIG["NEON_FLAGS"]
229     SOURCES["SwizzleNEON.cpp"].flags += CONFIG["NEON_FLAGS"]
231 include("/ipc/chromium/chromium-config.mozbuild")
233 FINAL_LIBRARY = "xul"
235 for var in ("USE_CAIRO", "MOZ2D_HAS_MOZ_CAIRO"):
236     DEFINES[var] = True
238 if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("android", "gtk"):
239     DEFINES["MOZ_ENABLE_FREETYPE"] = True
241 CXXFLAGS += CONFIG["MOZ_CAIRO_CFLAGS"]
243 if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("android", "gtk"):
244     CXXFLAGS += CONFIG["CAIRO_FT_CFLAGS"]
246 LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]