diff options
Diffstat (limited to 'gfx/2d/moz.build')
-rw-r--r-- | gfx/2d/moz.build | 227 |
1 files changed, 227 insertions, 0 deletions
diff --git a/gfx/2d/moz.build b/gfx/2d/moz.build new file mode 100644 index 0000000000..c04530c72b --- /dev/null +++ b/gfx/2d/moz.build @@ -0,0 +1,227 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +EXPORTS.mozilla += [ + "GenericRefCounted.h", +] + +EXPORTS.mozilla.gfx += [ + "2D.h", + "BaseCoord.h", + "BaseMargin.h", + "BasePoint.h", + "BasePoint3D.h", + "BasePoint4D.h", + "BaseRect.h", + "BaseSize.h", + "BezierUtils.h", + "Blur.h", + "BorrowedContext.h", + "Coord.h", + "CriticalSection.h", + "DataSurfaceHelpers.h", + "DrawEventRecorder.h", + "DrawTargetOffset.h", + "DrawTargetRecording.h", + "DrawTargetSkia.h", + "Filters.h", + "FontVariation.h", + "Helpers.h", + "HelpersCairo.h", + "InlineTranslator.h", + "IterableArena.h", + "Logging.h", + "LoggingConstants.h", + "Matrix.h", + "MatrixFwd.h", + "NumericTools.h", + "PathHelpers.h", + "PathSkia.h", + "PatternHelpers.h", + "Point.h", + "Polygon.h", + "Quaternion.h", + "RecordedEvent.h", + "RecordingTypes.h", + "Rect.h", + "RectAbsolute.h", + "Scale.h", + "ScaleFactor.h", + "ScaleFactors2D.h", + "SourceSurfaceCairo.h", + "SourceSurfaceRawData.h", + "StackArray.h", + "Swizzle.h", + "Tools.h", + "Triangle.h", + "Types.h", + "UserData.h", +] + +if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("cocoa", "uikit"): + EXPORTS.mozilla.gfx += [ + "MacIOSurface.h", + "ScaledFontBase.h", + "ScaledFontMac.h", + "UnscaledFontMac.h", + ] + UNIFIED_SOURCES += [ + "NativeFontResourceMac.cpp", + "ScaledFontMac.cpp", + ] +elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows": + EXPORTS.mozilla.gfx += [ + "DWriteSettings.h", + "UnscaledFontDWrite.h", + "UnscaledFontGDI.h", + ] + SOURCES += [ + "ConicGradientEffectD2D1.cpp", + "DrawTargetD2D1.cpp", + "DWriteSettings.cpp", + "ExtendInputEffectD2D1.cpp", + "FilterNodeD2D1.cpp", + "NativeFontResourceDWrite.cpp", + "NativeFontResourceGDI.cpp", + "PathD2D.cpp", + "RadialGradientEffectD2D1.cpp", + "ScaledFontDWrite.cpp", + "ScaledFontWin.cpp", + "SourceSurfaceD2D1.cpp", + ] + DEFINES["WIN32"] = True + +if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("android", "gtk"): + EXPORTS.mozilla.gfx += [ + "UnscaledFontFreeType.h", + ] + SOURCES += [ + "NativeFontResourceFreeType.cpp", + "UnscaledFontFreeType.cpp", + ] + +if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": + SOURCES += [ + "ScaledFontFontconfig.cpp", + ] + +if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android": + SOURCES += [ + "ScaledFontFreeType.cpp", + ] + +EXPORTS.mozilla.gfx += [ + "ConvolutionFilter.h", + "HelpersSkia.h", +] + +# Are we targeting x86 or x64? If so, build SSE2 files. +if CONFIG["INTEL_ARCHITECTURE"]: + SOURCES += [ + "BlurSSE2.cpp", + "ConvolutionFilterAVX2.cpp", + "ConvolutionFilterSSE2.cpp", + "FilterProcessingSSE2.cpp", + "ImageScalingSSE2.cpp", + "SwizzleAVX2.cpp", + "SwizzleSSE2.cpp", + "SwizzleSSSE3.cpp", + ] + DEFINES["USE_SSE2"] = True + # The file uses SSE2 intrinsics, so it needs special compile flags on some + # compilers. + SOURCES["BlurSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] + SOURCES["ConvolutionFilterAVX2.cpp"].flags += ["-mavx2"] + SOURCES["ConvolutionFilterSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] + SOURCES["FilterProcessingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] + SOURCES["ImageScalingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] + SOURCES["SwizzleAVX2.cpp"].flags += ["-mavx2"] + SOURCES["SwizzleSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] + SOURCES["SwizzleSSSE3.cpp"].flags += CONFIG["SSSE3_FLAGS"] +elif CONFIG["TARGET_CPU"].startswith("mips"): + SOURCES += [ + "BlurLS3.cpp", + ] + +UNIFIED_SOURCES += [ + "BezierUtils.cpp", + "Blur.cpp", + "BufferEdgePad.cpp", + "BufferUnrotate.cpp", + "ConvolutionFilter.cpp", + "DataSourceSurface.cpp", + "DataSurfaceHelpers.cpp", + "DrawEventRecorder.cpp", + "DrawTarget.cpp", + "DrawTargetCairo.cpp", + "DrawTargetOffset.cpp", + "DrawTargetRecording.cpp", + "DrawTargetSkia.cpp", + "Factory.cpp", + "FilterNodeSoftware.cpp", + "FilterProcessing.cpp", + "FilterProcessingScalar.cpp", + "ImageScaling.cpp", + "Matrix.cpp", + "NativeFontResource.cpp", + "Path.cpp", + "PathCairo.cpp", + "PathHelpers.cpp", + "PathRecording.cpp", + "PathSkia.cpp", + "Quaternion.cpp", + "RecordedEvent.cpp", + "ScaledFontBase.cpp", + "SFNTData.cpp", + "SkConvolver.cpp", + "SourceSurfaceCairo.cpp", + "SourceSurfaceRawData.cpp", + "SourceSurfaceSkia.cpp", + "Swizzle.cpp", + "Types.cpp", +] + +SOURCES += [ + "InlineTranslator.cpp", +] + +if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa": + SOURCES += [ + "MacIOSurface.cpp", + ] + +if CONFIG["TARGET_CPU"] == "aarch64" or CONFIG["BUILD_ARM_NEON"]: + SOURCES += [ + "BlurNEON.cpp", + "ConvolutionFilterNEON.cpp", + "LuminanceNEON.cpp", + "SwizzleNEON.cpp", + ] + DEFINES["USE_NEON"] = True + SOURCES["BlurNEON.cpp"].flags += CONFIG["NEON_FLAGS"] + SOURCES["ConvolutionFilterNEON.cpp"].flags += CONFIG["NEON_FLAGS"] + SOURCES["LuminanceNEON.cpp"].flags += CONFIG["NEON_FLAGS"] + SOURCES["SwizzleNEON.cpp"].flags += CONFIG["NEON_FLAGS"] + +include("/ipc/chromium/chromium-config.mozbuild") + +FINAL_LIBRARY = "xul" + +for var in ("USE_CAIRO", "MOZ2D_HAS_MOZ_CAIRO"): + DEFINES[var] = True + +if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("android", "gtk"): + DEFINES["MOZ_ENABLE_FREETYPE"] = True + +CXXFLAGS += ["-Werror=switch"] + +if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("android", "gtk"): + CXXFLAGS += CONFIG["CAIRO_FT_CFLAGS"] + +LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"] +LOCAL_INCLUDES += [ + "/gfx/cairo/cairo/src", +] |