moz.build (5528B)
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/. 6 7 EXPORTS.mozilla += [ 8 "GenericRefCounted.h", 9 ] 10 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 "DataSourceSurfaceWrapper.h", 26 "DataSurfaceHelpers.h", 27 "DrawEventRecorder.h", 28 "DrawEventRecorderTypes.h", 29 "DrawTargetOffset.h", 30 "DrawTargetRecording.h", 31 "DrawTargetSkia.h", 32 "FilterNodeSoftware.h", 33 "Filters.h", 34 "FontFeature.h", 35 "FontVariation.h", 36 "Helpers.h", 37 "HelpersCairo.h", 38 "InlineTranslator.h", 39 "IterableArena.h", 40 "Logging.h", 41 "LoggingConstants.h", 42 "Matrix.h", 43 "MatrixFwd.h", 44 "NumericTools.h", 45 "PathHelpers.h", 46 "PathSkia.h", 47 "PatternHelpers.h", 48 "Point.h", 49 "Polygon.h", 50 "Quaternion.h", 51 "RecordedEvent.h", 52 "RecordingTypes.h", 53 "Rect.h", 54 "RectAbsolute.h", 55 "Scale.h", 56 "ScaleFactor.h", 57 "ScaleFactors2D.h", 58 "SourceSurfaceCairo.h", 59 "SourceSurfaceRawData.h", 60 "StackArray.h", 61 "Swizzle.h", 62 "Tools.h", 63 "Triangle.h", 64 "Types.h", 65 "UserData.h", 66 ] 67 68 if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("cocoa", "uikit"): 69 EXPORTS.mozilla.gfx += [ 70 "MacIOSurface.h", 71 "ScaledFontBase.h", 72 "ScaledFontMac.h", 73 "UnscaledFontMac.h", 74 ] 75 UNIFIED_SOURCES += [ 76 "MacIOSurface.cpp", 77 "NativeFontResourceMac.cpp", 78 "ScaledFontMac.cpp", 79 ] 80 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows": 81 EXPORTS.mozilla.gfx += [ 82 "DWriteSettings.h", 83 "SourceSurfaceD3D11.h", 84 "UnscaledFontDWrite.h", 85 "UnscaledFontGDI.h", 86 ] 87 SOURCES += [ 88 "DWriteSettings.cpp", 89 "NativeFontResourceDWrite.cpp", 90 "NativeFontResourceGDI.cpp", 91 "ScaledFontDWrite.cpp", 92 "ScaledFontWin.cpp", 93 "SourceSurfaceD3D11.cpp", 94 ] 95 DEFINES["WIN32"] = True 96 97 if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("android", "gtk"): 98 EXPORTS.mozilla.gfx += [ 99 "UnscaledFontFreeType.h", 100 ] 101 SOURCES += [ 102 "NativeFontResourceFreeType.cpp", 103 "UnscaledFontFreeType.cpp", 104 ] 105 106 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": 107 SOURCES += [ 108 "ScaledFontFontconfig.cpp", 109 ] 110 111 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android": 112 SOURCES += [ 113 "ScaledFontFreeType.cpp", 114 ] 115 116 EXPORTS.mozilla.gfx += [ 117 "ConvolutionFilter.h", 118 "HelpersSkia.h", 119 ] 120 121 # Are we targeting x86 or x64? If so, build SSE2 files. 122 if CONFIG["INTEL_ARCHITECTURE"]: 123 SOURCES += [ 124 "ConvolutionFilterAVX2.cpp", 125 "ConvolutionFilterSSE2.cpp", 126 "FilterProcessingSSE2.cpp", 127 "ImageScalingSSE2.cpp", 128 "SwizzleAVX2.cpp", 129 "SwizzleSSE2.cpp", 130 "SwizzleSSSE3.cpp", 131 ] 132 DEFINES["USE_SSE2"] = True 133 # The file uses SSE2 intrinsics, so it needs special compile flags on some 134 # compilers. 135 SOURCES["ConvolutionFilterAVX2.cpp"].flags += ["-mavx2"] 136 SOURCES["ConvolutionFilterSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] 137 SOURCES["FilterProcessingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] 138 SOURCES["ImageScalingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] 139 SOURCES["SwizzleAVX2.cpp"].flags += ["-mavx2"] 140 SOURCES["SwizzleSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] 141 SOURCES["SwizzleSSSE3.cpp"].flags += CONFIG["SSSE3_FLAGS"] 142 143 UNIFIED_SOURCES += [ 144 "BezierUtils.cpp", 145 "Blur.cpp", 146 "BufferEdgePad.cpp", 147 "BufferUnrotate.cpp", 148 "ConvolutionFilter.cpp", 149 "DataSourceSurface.cpp", 150 "DataSurfaceHelpers.cpp", 151 "DrawEventRecorder.cpp", 152 "DrawTarget.cpp", 153 "DrawTargetCairo.cpp", 154 "DrawTargetOffset.cpp", 155 "DrawTargetRecording.cpp", 156 "DrawTargetSkia.cpp", 157 "Factory.cpp", 158 "FilterNodeSoftware.cpp", 159 "FilterProcessing.cpp", 160 "FilterProcessingScalar.cpp", 161 "ImageScaling.cpp", 162 "Matrix.cpp", 163 "NativeFontResource.cpp", 164 "Path.cpp", 165 "PathCairo.cpp", 166 "PathHelpers.cpp", 167 "PathRecording.cpp", 168 "PathSkia.cpp", 169 "Quaternion.cpp", 170 "RecordedEvent.cpp", 171 "ScaledFontBase.cpp", 172 "SFNTData.cpp", 173 "SkConvolver.cpp", 174 "SourceSurfaceCairo.cpp", 175 "SourceSurfaceRawData.cpp", 176 "SourceSurfaceSkia.cpp", 177 "Swizzle.cpp", 178 "Types.cpp", 179 ] 180 181 SOURCES += [ 182 "InlineTranslator.cpp", 183 ] 184 185 if CONFIG["TARGET_CPU"] == "aarch64" or CONFIG["BUILD_ARM_NEON"]: 186 SOURCES += [ 187 "ConvolutionFilterNEON.cpp", 188 "LuminanceNEON.cpp", 189 "SwizzleNEON.cpp", 190 ] 191 DEFINES["USE_NEON"] = True 192 SOURCES["ConvolutionFilterNEON.cpp"].flags += CONFIG["NEON_FLAGS"] 193 SOURCES["LuminanceNEON.cpp"].flags += CONFIG["NEON_FLAGS"] 194 SOURCES["SwizzleNEON.cpp"].flags += CONFIG["NEON_FLAGS"] 195 196 include("/ipc/chromium/chromium-config.mozbuild") 197 198 FINAL_LIBRARY = "xul" 199 200 for var in ("USE_CAIRO", "MOZ2D_HAS_MOZ_CAIRO"): 201 DEFINES[var] = True 202 203 if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("android", "gtk"): 204 DEFINES["MOZ_ENABLE_FREETYPE"] = True 205 206 CXXFLAGS += ["-Werror=switch"] 207 208 if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("android", "gtk"): 209 CXXFLAGS += CONFIG["CAIRO_FT_CFLAGS"] 210 211 LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"] 212 LOCAL_INCLUDES += [ 213 "/gfx/cairo/cairo/src", 214 ]