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 += [
72 "NativeFontResourceMac.cpp",
75 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
76 EXPORTS.mozilla.gfx += [
78 "UnscaledFontDWrite.h",
82 "ConicGradientEffectD2D1.cpp",
85 "ExtendInputEffectD2D1.cpp",
87 "NativeFontResourceDWrite.cpp",
88 "NativeFontResourceGDI.cpp",
90 "RadialGradientEffectD2D1.cpp",
91 "ScaledFontDWrite.cpp",
93 "SourceSurfaceD2D1.cpp",
95 DEFINES["WIN32"] = True
97 if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("android", "gtk"):
98 EXPORTS.mozilla.gfx += [
99 "UnscaledFontFreeType.h",
102 "NativeFontResourceFreeType.cpp",
103 "UnscaledFontFreeType.cpp",
106 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
108 "ScaledFontFontconfig.cpp",
111 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
113 "ScaledFontFreeType.cpp",
116 EXPORTS.mozilla.gfx += [
117 "ConvolutionFilter.h",
121 # Are we targeting x86 or x64? If so, build SSE2 files.
122 if CONFIG["INTEL_ARCHITECTURE"]:
125 "ConvolutionFilterAVX2.cpp",
126 "ConvolutionFilterSSE2.cpp",
127 "FilterProcessingSSE2.cpp",
128 "ImageScalingSSE2.cpp",
133 DEFINES["USE_SSE2"] = True
134 # The file uses SSE2 intrinsics, so it needs special compile flags on some
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"):
153 "BufferUnrotate.cpp",
154 "ConvolutionFilter.cpp",
155 "DataSourceSurface.cpp",
156 "DataSurfaceHelpers.cpp",
157 "DrawEventRecorder.cpp",
159 "DrawTargetCairo.cpp",
160 "DrawTargetOffset.cpp",
161 "DrawTargetRecording.cpp",
162 "DrawTargetSkia.cpp",
164 "FilterNodeSoftware.cpp",
165 "FilterProcessing.cpp",
166 "FilterProcessingScalar.cpp",
169 "NativeFontResource.cpp",
177 "ScaledFontBase.cpp",
180 "SourceSurfaceCairo.cpp",
181 "SourceSurfaceRawData.cpp",
182 "SourceSurfaceSkia.cpp",
188 "InlineTranslator.cpp",
191 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
196 if CONFIG["TARGET_CPU"] == "aarch64" or CONFIG["BUILD_ARM_NEON"]:
199 "ConvolutionFilterNEON.cpp",
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"):
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"]
226 "/gfx/cairo/cairo/src",