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/.
11 EXPORTS.mozilla.gfx += [
25 "DataSurfaceHelpers.h",
26 "DrawEventRecorder.h",
28 "DrawTargetRecording.h",
54 "SourceSurfaceCairo.h",
55 "SourceSurfaceRawData.h",
64 if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("cocoa", "uikit"):
65 EXPORTS.mozilla.gfx += [
73 "NativeFontResourceMac.cpp",
76 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
77 EXPORTS.mozilla.gfx += [
79 "UnscaledFontDWrite.h",
83 "ConicGradientEffectD2D1.cpp",
86 "ExtendInputEffectD2D1.cpp",
88 "NativeFontResourceDWrite.cpp",
89 "NativeFontResourceGDI.cpp",
91 "RadialGradientEffectD2D1.cpp",
92 "ScaledFontDWrite.cpp",
94 "SourceSurfaceD2D1.cpp",
96 DEFINES["WIN32"] = True
98 if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("android", "gtk"):
99 EXPORTS.mozilla.gfx += [
100 "UnscaledFontFreeType.h",
103 "NativeFontResourceFreeType.cpp",
104 "UnscaledFontFreeType.cpp",
107 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
109 "ScaledFontFontconfig.cpp",
112 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
114 "ScaledFontFreeType.cpp",
117 EXPORTS.mozilla.gfx += [
118 "ConvolutionFilter.h",
122 # Are we targeting x86 or x64? If so, build SSE2 files.
123 if CONFIG["INTEL_ARCHITECTURE"]:
126 "ConvolutionFilterAVX2.cpp",
127 "ConvolutionFilterSSE2.cpp",
128 "FilterProcessingSSE2.cpp",
129 "ImageScalingSSE2.cpp",
134 DEFINES["USE_SSE2"] = True
135 # The file uses SSE2 intrinsics, so it needs special compile flags on some
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"):
154 "BufferUnrotate.cpp",
155 "ConvolutionFilter.cpp",
156 "DataSourceSurface.cpp",
157 "DataSurfaceHelpers.cpp",
158 "DrawEventRecorder.cpp",
160 "DrawTargetCairo.cpp",
161 "DrawTargetOffset.cpp",
162 "DrawTargetRecording.cpp",
163 "DrawTargetSkia.cpp",
165 "FilterNodeSoftware.cpp",
166 "FilterProcessing.cpp",
167 "FilterProcessingScalar.cpp",
170 "NativeFontResource.cpp",
178 "ScaledFontBase.cpp",
181 "SourceSurfaceCairo.cpp",
182 "SourceSurfaceRawData.cpp",
183 "SourceSurfaceSkia.cpp",
189 "InlineTranslator.cpp",
192 if CONFIG["TARGET_CPU"] == "aarch64" or CONFIG["BUILD_ARM_NEON"]:
195 "ConvolutionFilterNEON.cpp",
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"):
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"]
222 "/gfx/cairo/cairo/src",