Bug 1638136 [wpt PR 23617] - Clipboard API Tests: Move permissions tests to WPT....
[gecko.git] / gfx / 2d / moz.build
blob1640f68acccc38e1861a22d936ce19efb6fefa09
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     'DrawTargetTiled.h',
30     'DrawTargetWrapAndRecord.h',
31     'Filters.h',
32     'FontVariation.h',
33     'Helpers.h',
34     'HelpersCairo.h',
35     'InlineTranslator.h',
36     'IterableArena.h',
37     'Logging.h',
38     'LoggingConstants.h',
39     'Matrix.h',
40     'MatrixFwd.h',
41     'NumericTools.h',
42     'PathHelpers.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     'SourceSurfaceCapture.h',
56     'SourceSurfaceRawData.h',
57     'StackArray.h',
58     'Swizzle.h',
59     'Tools.h',
60     'Triangle.h',
61     'Types.h',
62     'UserData.h',
65 EXPORTS.mozilla.gfx += ['ssse3-scaler.h']
67 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'uikit'):
68     EXPORTS.mozilla.gfx += [
69         'MacIOSurface.h',
70         'UnscaledFontMac.h',
71     ]
72     UNIFIED_SOURCES += [
73         'NativeFontResourceMac.cpp',
74         'ScaledFontMac.cpp',
75     ]
76 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
77     EXPORTS.mozilla.gfx += [
78         'dw-extra.h',
79         'UnscaledFontDWrite.h',
80         'UnscaledFontGDI.h',
81     ]
82     SOURCES += [
83         'DrawTargetD2D1.cpp',
84         'ExtendInputEffectD2D1.cpp',
85         'FilterNodeD2D1.cpp',
86         'NativeFontResourceDWrite.cpp',
87         'NativeFontResourceGDI.cpp',
88         'PathD2D.cpp',
89         'RadialGradientEffectD2D1.cpp',
90         'ScaledFontDWrite.cpp',
91         'ScaledFontWin.cpp',
92         'SourceSurfaceD2D1.cpp',
93     ]
94     DEFINES['WIN32'] = True
96 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk'):
97     EXPORTS.mozilla.gfx += [
98         'UnscaledFontFreeType.h',
99     ]
100     SOURCES += [
101         'NativeFontResourceFreeType.cpp',
102         'UnscaledFontFreeType.cpp',
103     ]
105 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
106     SOURCES += [
107         'ScaledFontFontconfig.cpp',
108     ]
110 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
111     SOURCES += [
112         'ScaledFontFreeType.cpp',
113     ]
115 if CONFIG['MOZ_ENABLE_SKIA']:
116     SOURCES += [
117         'ConvolutionFilter.cpp',
118         'DrawTargetSkia.cpp',
119         'PathSkia.cpp',
120         'SourceSurfaceSkia.cpp',
121     ]
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',
129         'HelpersSkia.h',
130     ]
132 # Are we targeting x86 or x64?  If so, build SSE2 files.
133 if CONFIG['INTEL_ARCHITECTURE']:
134     SOURCES += [
135         'BlurSSE2.cpp',
136         'FilterProcessingSSE2.cpp',
137         'ImageScalingSSE2.cpp',
138         'ssse3-scaler.c',
139         'SwizzleAVX2.cpp',
140         'SwizzleSSE2.cpp',
141         'SwizzleSSSE3.cpp',
142     ]
143     DEFINES['USE_SSE2'] = True
144     # The file uses SSE2 intrinsics, so it needs special compile flags on some
145     # compilers.
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'):
154     SOURCES += [
155         'BlurLS3.cpp',
156     ]
158 UNIFIED_SOURCES += [
159     'BezierUtils.cpp',
160     'Blur.cpp',
161     'BufferEdgePad.cpp',
162     'BufferUnrotate.cpp',
163     'CaptureCommandList.cpp',
164     'DataSourceSurface.cpp',
165     'DataSurfaceHelpers.cpp',
166     'DrawEventRecorder.cpp',
167     'DrawTarget.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',
179     'ImageScaling.cpp',
180     'Matrix.cpp',
181     'NativeFontResource.cpp',
182     'Path.cpp',
183     'PathCairo.cpp',
184     'PathCapture.cpp',
185     'PathHelpers.cpp',
186     'PathRecording.cpp',
187     'Quaternion.cpp',
188     'RecordedEvent.cpp',
189     'Scale.cpp',
190     'ScaledFontBase.cpp',
191     'SFNTData.cpp',
192     'SFNTNameTable.cpp',
193     'SourceSurfaceCairo.cpp',
194     'SourceSurfaceCapture.cpp',
195     'SourceSurfaceRawData.cpp',
196     'Swizzle.cpp',
199 SOURCES += [
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 += [
212         'QuartzSupport.h',
213     ]
214     SOURCES += [
215         'MacIOSurface.cpp',
216         'QuartzSupport.mm',
217     ]
219 if CONFIG['CPU_ARCH'] == 'aarch64' or CONFIG['BUILD_ARM_NEON']:
220     SOURCES += [
221         'BlurNEON.cpp',
222         'LuminanceNEON.cpp',
223         'SwizzleNEON.cpp',
224     ]
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'):
235     DEFINES[var] = True
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']