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',
30 'DrawTargetWrapAndRecord.h',
54 'SourceSurfaceCairo.h',
55 'SourceSurfaceCapture.h',
56 'SourceSurfaceRawData.h',
65 EXPORTS.mozilla.gfx += ['ssse3-scaler.h']
67 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'uikit'):
68 EXPORTS.mozilla.gfx += [
73 'NativeFontResourceMac.cpp',
76 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
77 EXPORTS.mozilla.gfx += [
79 'UnscaledFontDWrite.h',
84 'ExtendInputEffectD2D1.cpp',
86 'NativeFontResourceDWrite.cpp',
87 'NativeFontResourceGDI.cpp',
89 'RadialGradientEffectD2D1.cpp',
90 'ScaledFontDWrite.cpp',
92 'SourceSurfaceD2D1.cpp',
94 DEFINES['WIN32'] = True
96 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk'):
97 EXPORTS.mozilla.gfx += [
98 'UnscaledFontFreeType.h',
101 'NativeFontResourceFreeType.cpp',
102 'UnscaledFontFreeType.cpp',
105 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
107 'ScaledFontFontconfig.cpp',
110 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
112 'ScaledFontFreeType.cpp',
115 if CONFIG['MOZ_ENABLE_SKIA']:
117 'ConvolutionFilter.cpp',
118 'DrawTargetSkia.cpp',
120 'SourceSurfaceSkia.cpp',
122 if CONFIG['CC_TYPE'] == 'clang':
123 # Suppress warnings from Skia header files.
124 SOURCES['DrawTargetSkia.cpp'].flags += ['-Wno-implicit-fallthrough']
125 SOURCES['PathSkia.cpp'].flags += ['-Wno-implicit-fallthrough']
126 SOURCES['SourceSurfaceSkia.cpp'].flags += ['-Wno-implicit-fallthrough']
127 EXPORTS.mozilla.gfx += [
128 'ConvolutionFilter.h',
132 # Are we targeting x86 or x64? If so, build SSE2 files.
133 if CONFIG['INTEL_ARCHITECTURE']:
136 'FilterProcessingSSE2.cpp',
137 'ImageScalingSSE2.cpp',
143 DEFINES['USE_SSE2'] = True
144 # The file uses SSE2 intrinsics, so it needs special compile flags on some
146 SOURCES['BlurSSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
147 SOURCES['FilterProcessingSSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
148 SOURCES['ImageScalingSSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
149 SOURCES['SwizzleAVX2.cpp'].flags += ['-mavx2']
150 SOURCES['SwizzleSSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
151 SOURCES['SwizzleSSSE3.cpp'].flags += CONFIG['SSSE3_FLAGS']
152 SOURCES['ssse3-scaler.c'].flags += CONFIG['SSSE3_FLAGS']
153 elif CONFIG['CPU_ARCH'].startswith('mips'):
162 'BufferUnrotate.cpp',
163 'CaptureCommandList.cpp',
164 'DataSourceSurface.cpp',
165 'DataSurfaceHelpers.cpp',
166 'DrawEventRecorder.cpp',
168 'DrawTargetCairo.cpp',
169 'DrawTargetCapture.cpp',
170 'DrawTargetDual.cpp',
171 'DrawTargetOffset.cpp',
172 'DrawTargetRecording.cpp',
173 'DrawTargetTiled.cpp',
174 'DrawTargetWrapAndRecord.cpp',
175 'FilterNodeCapture.cpp',
176 'FilterNodeSoftware.cpp',
177 'FilterProcessing.cpp',
178 'FilterProcessingScalar.cpp',
181 'NativeFontResource.cpp',
190 'ScaledFontBase.cpp',
193 'SourceSurfaceCairo.cpp',
194 'SourceSurfaceCapture.cpp',
195 'SourceSurfaceRawData.cpp',
200 'Factory.cpp', # Need to suppress warnings in Skia header files.
201 'InlineTranslator.cpp',
204 if CONFIG['CC_TYPE'] == 'clang':
205 SOURCES['Factory.cpp'].flags += ['-Wno-implicit-fallthrough']
207 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
208 CXXFLAGS += ['-Wno-error=shadow']
210 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
211 EXPORTS.mozilla.gfx += [
219 if CONFIG['CPU_ARCH'] == 'aarch64' or CONFIG['BUILD_ARM_NEON']:
225 DEFINES['USE_NEON'] = True
226 SOURCES['BlurNEON.cpp'].flags += CONFIG['NEON_FLAGS']
227 SOURCES['LuminanceNEON.cpp'].flags += CONFIG['NEON_FLAGS']
228 SOURCES['SwizzleNEON.cpp'].flags += CONFIG['NEON_FLAGS']
230 include('/ipc/chromium/chromium-config.mozbuild')
232 FINAL_LIBRARY = 'xul'
234 for var in ('USE_CAIRO', 'MOZ2D_HAS_MOZ_CAIRO'):
237 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk'):
238 DEFINES['MOZ_ENABLE_FREETYPE'] = True
240 CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
242 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk'):
243 CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
245 LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES']