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 EXPORTS.mozilla.gfx += ["ssse3-scaler.h"]
66 if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("cocoa", "uikit"):
67 EXPORTS.mozilla.gfx += [
72 "NativeFontResourceMac.cpp",
75 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
76 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",
135 DEFINES["USE_SSE2"] = True
136 # The file uses SSE2 intrinsics, so it needs special compile flags on some
138 SOURCES["BlurSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
139 SOURCES["ConvolutionFilterAVX2.cpp"].flags += ["-mavx2"]
140 SOURCES["ConvolutionFilterSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
141 SOURCES["FilterProcessingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
142 SOURCES["ImageScalingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
143 SOURCES["SwizzleAVX2.cpp"].flags += ["-mavx2"]
144 SOURCES["SwizzleSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
145 SOURCES["SwizzleSSSE3.cpp"].flags += CONFIG["SSSE3_FLAGS"]
146 SOURCES["ssse3-scaler.c"].flags += CONFIG["SSSE3_FLAGS"]
147 elif CONFIG["CPU_ARCH"].startswith("mips"):
156 "BufferUnrotate.cpp",
157 "ConvolutionFilter.cpp",
158 "DataSourceSurface.cpp",
159 "DataSurfaceHelpers.cpp",
160 "DrawEventRecorder.cpp",
162 "DrawTargetCairo.cpp",
163 "DrawTargetOffset.cpp",
164 "DrawTargetRecording.cpp",
165 "DrawTargetSkia.cpp",
167 "FilterNodeSoftware.cpp",
168 "FilterProcessing.cpp",
169 "FilterProcessingScalar.cpp",
172 "NativeFontResource.cpp",
180 "ScaledFontBase.cpp",
183 "SourceSurfaceCairo.cpp",
184 "SourceSurfaceRawData.cpp",
185 "SourceSurfaceSkia.cpp",
191 "InlineTranslator.cpp",
194 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
199 if CONFIG["CPU_ARCH"] == "aarch64" or CONFIG["BUILD_ARM_NEON"]:
202 "ConvolutionFilterNEON.cpp",
206 DEFINES["USE_NEON"] = True
207 SOURCES["BlurNEON.cpp"].flags += CONFIG["NEON_FLAGS"]
208 SOURCES["ConvolutionFilterNEON.cpp"].flags += CONFIG["NEON_FLAGS"]
209 SOURCES["LuminanceNEON.cpp"].flags += CONFIG["NEON_FLAGS"]
210 SOURCES["SwizzleNEON.cpp"].flags += CONFIG["NEON_FLAGS"]
212 include("/ipc/chromium/chromium-config.mozbuild")
214 FINAL_LIBRARY = "xul"
216 for var in ("USE_CAIRO", "MOZ2D_HAS_MOZ_CAIRO"):
219 if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("android", "gtk"):
220 DEFINES["MOZ_ENABLE_FREETYPE"] = True
222 CXXFLAGS += ["-Werror=switch"]
224 if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("android", "gtk"):
225 CXXFLAGS += CONFIG["CAIRO_FT_CFLAGS"]
227 LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
229 "/gfx/cairo/cairo/src",