no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD CLOSED TREE
[gecko.git] / gfx / 2d / moz.build
blobc04530c72b9f2fc22f953e113c183c983b00dcc8
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         "NativeFontResourceMac.cpp",
73         "ScaledFontMac.cpp",
74     ]
75 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
76     EXPORTS.mozilla.gfx += [
77         "DWriteSettings.h",
78         "UnscaledFontDWrite.h",
79         "UnscaledFontGDI.h",
80     ]
81     SOURCES += [
82         "ConicGradientEffectD2D1.cpp",
83         "DrawTargetD2D1.cpp",
84         "DWriteSettings.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 EXPORTS.mozilla.gfx += [
117     "ConvolutionFilter.h",
118     "HelpersSkia.h",
121 # Are we targeting x86 or x64?  If so, build SSE2 files.
122 if CONFIG["INTEL_ARCHITECTURE"]:
123     SOURCES += [
124         "BlurSSE2.cpp",
125         "ConvolutionFilterAVX2.cpp",
126         "ConvolutionFilterSSE2.cpp",
127         "FilterProcessingSSE2.cpp",
128         "ImageScalingSSE2.cpp",
129         "SwizzleAVX2.cpp",
130         "SwizzleSSE2.cpp",
131         "SwizzleSSSE3.cpp",
132     ]
133     DEFINES["USE_SSE2"] = True
134     # The file uses SSE2 intrinsics, so it needs special compile flags on some
135     # compilers.
136     SOURCES["BlurSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
137     SOURCES["ConvolutionFilterAVX2.cpp"].flags += ["-mavx2"]
138     SOURCES["ConvolutionFilterSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
139     SOURCES["FilterProcessingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
140     SOURCES["ImageScalingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
141     SOURCES["SwizzleAVX2.cpp"].flags += ["-mavx2"]
142     SOURCES["SwizzleSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
143     SOURCES["SwizzleSSSE3.cpp"].flags += CONFIG["SSSE3_FLAGS"]
144 elif CONFIG["TARGET_CPU"].startswith("mips"):
145     SOURCES += [
146         "BlurLS3.cpp",
147     ]
149 UNIFIED_SOURCES += [
150     "BezierUtils.cpp",
151     "Blur.cpp",
152     "BufferEdgePad.cpp",
153     "BufferUnrotate.cpp",
154     "ConvolutionFilter.cpp",
155     "DataSourceSurface.cpp",
156     "DataSurfaceHelpers.cpp",
157     "DrawEventRecorder.cpp",
158     "DrawTarget.cpp",
159     "DrawTargetCairo.cpp",
160     "DrawTargetOffset.cpp",
161     "DrawTargetRecording.cpp",
162     "DrawTargetSkia.cpp",
163     "Factory.cpp",
164     "FilterNodeSoftware.cpp",
165     "FilterProcessing.cpp",
166     "FilterProcessingScalar.cpp",
167     "ImageScaling.cpp",
168     "Matrix.cpp",
169     "NativeFontResource.cpp",
170     "Path.cpp",
171     "PathCairo.cpp",
172     "PathHelpers.cpp",
173     "PathRecording.cpp",
174     "PathSkia.cpp",
175     "Quaternion.cpp",
176     "RecordedEvent.cpp",
177     "ScaledFontBase.cpp",
178     "SFNTData.cpp",
179     "SkConvolver.cpp",
180     "SourceSurfaceCairo.cpp",
181     "SourceSurfaceRawData.cpp",
182     "SourceSurfaceSkia.cpp",
183     "Swizzle.cpp",
184     "Types.cpp",
187 SOURCES += [
188     "InlineTranslator.cpp",
191 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
192     SOURCES += [
193         "MacIOSurface.cpp",
194     ]
196 if CONFIG["TARGET_CPU"] == "aarch64" or CONFIG["BUILD_ARM_NEON"]:
197     SOURCES += [
198         "BlurNEON.cpp",
199         "ConvolutionFilterNEON.cpp",
200         "LuminanceNEON.cpp",
201         "SwizzleNEON.cpp",
202     ]
203     DEFINES["USE_NEON"] = True
204     SOURCES["BlurNEON.cpp"].flags += CONFIG["NEON_FLAGS"]
205     SOURCES["ConvolutionFilterNEON.cpp"].flags += CONFIG["NEON_FLAGS"]
206     SOURCES["LuminanceNEON.cpp"].flags += CONFIG["NEON_FLAGS"]
207     SOURCES["SwizzleNEON.cpp"].flags += CONFIG["NEON_FLAGS"]
209 include("/ipc/chromium/chromium-config.mozbuild")
211 FINAL_LIBRARY = "xul"
213 for var in ("USE_CAIRO", "MOZ2D_HAS_MOZ_CAIRO"):
214     DEFINES[var] = True
216 if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("android", "gtk"):
217     DEFINES["MOZ_ENABLE_FREETYPE"] = True
219 CXXFLAGS += ["-Werror=switch"]
221 if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("android", "gtk"):
222     CXXFLAGS += CONFIG["CAIRO_FT_CFLAGS"]
224 LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
225 LOCAL_INCLUDES += [
226     "/gfx/cairo/cairo/src",