Bug 1874684 - Part 17: Fix uninitialised variable warnings from clang-tidy. r=allstarschh
[gecko.git] / gfx / 2d / moz.build
blobd1408b9dc919b27200ce255d7eab68b3dde54d46
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     "DrawTargetSkia.h",
30     "Filters.h",
31     "FontVariation.h",
32     "Helpers.h",
33     "HelpersCairo.h",
34     "InlineTranslator.h",
35     "IterableArena.h",
36     "Logging.h",
37     "LoggingConstants.h",
38     "Matrix.h",
39     "MatrixFwd.h",
40     "NumericTools.h",
41     "PathHelpers.h",
42     "PathSkia.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     "SourceSurfaceRawData.h",
56     "StackArray.h",
57     "Swizzle.h",
58     "Tools.h",
59     "Triangle.h",
60     "Types.h",
61     "UserData.h",
64 if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("cocoa", "uikit"):
65     EXPORTS.mozilla.gfx += [
66         "MacIOSurface.h",
67         "ScaledFontBase.h",
68         "ScaledFontMac.h",
69         "UnscaledFontMac.h",
70     ]
71     UNIFIED_SOURCES += [
72         "MacIOSurface.cpp",
73         "NativeFontResourceMac.cpp",
74         "ScaledFontMac.cpp",
75     ]
76 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
77     EXPORTS.mozilla.gfx += [
78         "DWriteSettings.h",
79         "UnscaledFontDWrite.h",
80         "UnscaledFontGDI.h",
81     ]
82     SOURCES += [
83         "ConicGradientEffectD2D1.cpp",
84         "DrawTargetD2D1.cpp",
85         "DWriteSettings.cpp",
86         "ExtendInputEffectD2D1.cpp",
87         "FilterNodeD2D1.cpp",
88         "NativeFontResourceDWrite.cpp",
89         "NativeFontResourceGDI.cpp",
90         "PathD2D.cpp",
91         "RadialGradientEffectD2D1.cpp",
92         "ScaledFontDWrite.cpp",
93         "ScaledFontWin.cpp",
94         "SourceSurfaceD2D1.cpp",
95     ]
96     DEFINES["WIN32"] = True
98 if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("android", "gtk"):
99     EXPORTS.mozilla.gfx += [
100         "UnscaledFontFreeType.h",
101     ]
102     SOURCES += [
103         "NativeFontResourceFreeType.cpp",
104         "UnscaledFontFreeType.cpp",
105     ]
107 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
108     SOURCES += [
109         "ScaledFontFontconfig.cpp",
110     ]
112 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
113     SOURCES += [
114         "ScaledFontFreeType.cpp",
115     ]
117 EXPORTS.mozilla.gfx += [
118     "ConvolutionFilter.h",
119     "HelpersSkia.h",
122 # Are we targeting x86 or x64?  If so, build SSE2 files.
123 if CONFIG["INTEL_ARCHITECTURE"]:
124     SOURCES += [
125         "BlurSSE2.cpp",
126         "ConvolutionFilterAVX2.cpp",
127         "ConvolutionFilterSSE2.cpp",
128         "FilterProcessingSSE2.cpp",
129         "ImageScalingSSE2.cpp",
130         "SwizzleAVX2.cpp",
131         "SwizzleSSE2.cpp",
132         "SwizzleSSSE3.cpp",
133     ]
134     DEFINES["USE_SSE2"] = True
135     # The file uses SSE2 intrinsics, so it needs special compile flags on some
136     # compilers.
137     SOURCES["BlurSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
138     SOURCES["ConvolutionFilterAVX2.cpp"].flags += ["-mavx2"]
139     SOURCES["ConvolutionFilterSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
140     SOURCES["FilterProcessingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
141     SOURCES["ImageScalingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
142     SOURCES["SwizzleAVX2.cpp"].flags += ["-mavx2"]
143     SOURCES["SwizzleSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
144     SOURCES["SwizzleSSSE3.cpp"].flags += CONFIG["SSSE3_FLAGS"]
145 elif CONFIG["TARGET_CPU"].startswith("mips"):
146     SOURCES += [
147         "BlurLS3.cpp",
148     ]
150 UNIFIED_SOURCES += [
151     "BezierUtils.cpp",
152     "Blur.cpp",
153     "BufferEdgePad.cpp",
154     "BufferUnrotate.cpp",
155     "ConvolutionFilter.cpp",
156     "DataSourceSurface.cpp",
157     "DataSurfaceHelpers.cpp",
158     "DrawEventRecorder.cpp",
159     "DrawTarget.cpp",
160     "DrawTargetCairo.cpp",
161     "DrawTargetOffset.cpp",
162     "DrawTargetRecording.cpp",
163     "DrawTargetSkia.cpp",
164     "Factory.cpp",
165     "FilterNodeSoftware.cpp",
166     "FilterProcessing.cpp",
167     "FilterProcessingScalar.cpp",
168     "ImageScaling.cpp",
169     "Matrix.cpp",
170     "NativeFontResource.cpp",
171     "Path.cpp",
172     "PathCairo.cpp",
173     "PathHelpers.cpp",
174     "PathRecording.cpp",
175     "PathSkia.cpp",
176     "Quaternion.cpp",
177     "RecordedEvent.cpp",
178     "ScaledFontBase.cpp",
179     "SFNTData.cpp",
180     "SkConvolver.cpp",
181     "SourceSurfaceCairo.cpp",
182     "SourceSurfaceRawData.cpp",
183     "SourceSurfaceSkia.cpp",
184     "Swizzle.cpp",
185     "Types.cpp",
188 SOURCES += [
189     "InlineTranslator.cpp",
192 if CONFIG["TARGET_CPU"] == "aarch64" or CONFIG["BUILD_ARM_NEON"]:
193     SOURCES += [
194         "BlurNEON.cpp",
195         "ConvolutionFilterNEON.cpp",
196         "LuminanceNEON.cpp",
197         "SwizzleNEON.cpp",
198     ]
199     DEFINES["USE_NEON"] = True
200     SOURCES["BlurNEON.cpp"].flags += CONFIG["NEON_FLAGS"]
201     SOURCES["ConvolutionFilterNEON.cpp"].flags += CONFIG["NEON_FLAGS"]
202     SOURCES["LuminanceNEON.cpp"].flags += CONFIG["NEON_FLAGS"]
203     SOURCES["SwizzleNEON.cpp"].flags += CONFIG["NEON_FLAGS"]
205 include("/ipc/chromium/chromium-config.mozbuild")
207 FINAL_LIBRARY = "xul"
209 for var in ("USE_CAIRO", "MOZ2D_HAS_MOZ_CAIRO"):
210     DEFINES[var] = True
212 if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("android", "gtk"):
213     DEFINES["MOZ_ENABLE_FREETYPE"] = True
215 CXXFLAGS += ["-Werror=switch"]
217 if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("android", "gtk"):
218     CXXFLAGS += CONFIG["CAIRO_FT_CFLAGS"]
220 LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
221 LOCAL_INCLUDES += [
222     "/gfx/cairo/cairo/src",