Merge remote-tracking branch 'origin/master' into custom

This commit is contained in:
roytam1 2021-03-11 10:14:22 +08:00
commit 333a06698b
41 changed files with 1 additions and 1192 deletions

1
aclocal.m4 vendored
View file

@ -21,7 +21,6 @@ builtin(include, build/autoconf/frameptr.m4)dnl
builtin(include, build/autoconf/compiler-opts.m4)dnl
builtin(include, build/autoconf/expandlibs.m4)dnl
builtin(include, build/autoconf/arch.m4)dnl
builtin(include, build/autoconf/android.m4)dnl
builtin(include, build/autoconf/zlib.m4)dnl
builtin(include, build/autoconf/icu.m4)dnl
builtin(include, build/autoconf/clang-plugin.m4)dnl

View file

@ -1,376 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
AC_DEFUN([MOZ_ANDROID_NDK],
[
MOZ_ARG_WITH_STRING(android-cxx-stl,
[ --with-android-cxx-stl=VALUE
use the specified C++ STL (libstdc++, libc++)],
android_cxx_stl=$withval,
android_cxx_stl=libc++)
case "$target" in
*-android*|*-linuxandroid*)
dnl $android_platform will be set for us by Python configure.
CPPFLAGS="-idirafter $android_platform/usr/include $CPPFLAGS"
CFLAGS="-fno-short-enums -fno-exceptions $CFLAGS"
CXXFLAGS="-fno-short-enums -fno-exceptions $CXXFLAGS"
ASFLAGS="-idirafter $android_platform/usr/include -DANDROID $ASFLAGS"
dnl Add --allow-shlib-undefined, because libGLESv2 links to an
dnl undefined symbol (present on the hardware, just not in the
dnl NDK.)
LDFLAGS="-L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform -Wl,--allow-shlib-undefined $LDFLAGS"
dnl Add -llog by default, since we use it all over the place.
LIBS="-llog $LIBS"
ANDROID_PLATFORM="${android_platform}"
AC_DEFINE(ANDROID)
AC_SUBST(ANDROID_PLATFORM)
;;
esac
])
AC_DEFUN([MOZ_ANDROID_CPU_ARCH],
[
if test "$OS_TARGET" = "Android"; then
case "${CPU_ARCH}-${MOZ_ARCH}" in
arm-armv7*)
ANDROID_CPU_ARCH=armeabi-v7a
;;
arm-*)
ANDROID_CPU_ARCH=armeabi
;;
x86-*)
ANDROID_CPU_ARCH=x86
;;
mips32-*) # When target_cpu is mipsel, CPU_ARCH is mips32
ANDROID_CPU_ARCH=mips
;;
aarch64-*)
ANDROID_CPU_ARCH=arm64-v8a
;;
esac
AC_SUBST(ANDROID_CPU_ARCH)
fi
])
AC_DEFUN([MOZ_ANDROID_STLPORT],
[
if test "$OS_TARGET" = "Android"; then
cpu_arch_dir="$ANDROID_CPU_ARCH"
# NDK r12 removed the arm/thumb library split and just made everything
# thumb by default. Attempt to compensate.
if test "$MOZ_THUMB2" = 1 -a -d "$cpu_arch_dir/thumb"; then
cpu_arch_dir="$cpu_arch_dir/thumb"
fi
if test -z "$STLPORT_CPPFLAGS$STLPORT_LIBS"; then
case "$android_cxx_stl" in
libstdc++)
# android-ndk-r8b and later
ndk_base="$android_ndk/sources/cxx-stl/gnu-libstdc++/$android_gnu_compiler_version"
ndk_libs_include="$ndk_base/libs/$ANDROID_CPU_ARCH"
ndk_libs="$ndk_base/libs/$cpu_arch_dir"
ndk_include="$ndk_base/include"
if ! test -e "$ndk_libs/libgnustl_static.a"; then
AC_MSG_ERROR([Couldn't find path to gnu-libstdc++ in the android ndk])
fi
STLPORT_LIBS="-L$ndk_libs -lgnustl_static"
STLPORT_CPPFLAGS="-I$ndk_include -I$ndk_include/backward -I$ndk_libs_include/include"
;;
libc++)
# android-ndk-r8b and later
ndk_base="$android_ndk/sources/cxx-stl"
cxx_base="$ndk_base/llvm-libc++"
cxx_libs="$cxx_base/libs/$cpu_arch_dir"
cxx_include="$cxx_base/libcxx/include"
cxxabi_base="$ndk_base/llvm-libc++abi"
cxxabi_include="$cxxabi_base/libcxxabi/include"
if ! test -e "$cxx_libs/libc++_static.a"; then
AC_MSG_ERROR([Couldn't find path to llvm-libc++ in the android ndk])
fi
STLPORT_LIBS="-L$cxx_libs -lc++_static"
# NDK r12 split the libc++ runtime libraries into pieces.
for lib in c++abi unwind android_support; do
if test -e "$cxx_libs/lib${lib}.a"; then
STLPORT_LIBS="$STLPORT_LIBS -l${lib}"
fi
done
# Add android/support/include/ for prototyping long double math
# functions, locale-specific C library functions, multibyte support,
# etc.
STLPORT_CPPFLAGS="-I$android_ndk/sources/android/support/include -I$cxx_include -I$cxxabi_include"
;;
*)
AC_MSG_ERROR([Bad value for --enable-android-cxx-stl])
;;
esac
fi
CXXFLAGS="$CXXFLAGS $STLPORT_CPPFLAGS"
fi
MOZ_ANDROID_CXX_STL=$android_cxx_stl
AC_SUBST([MOZ_ANDROID_CXX_STL])
AC_SUBST([STLPORT_LIBS])
])
AC_DEFUN([concat],[$1$2$3$4])
dnl Find a component of an AAR.
dnl Arg 1: variable name to expose, like ANDROID_SUPPORT_V4_LIB.
dnl Arg 2: path to component.
dnl Arg 3: if non-empty, expect and require component.
AC_DEFUN([MOZ_ANDROID_AAR_COMPONENT], [
ifelse([$3], ,
[
if test -e "$$1" ; then
AC_MSG_ERROR([Found unexpected exploded $1!])
fi
],
[
AC_MSG_CHECKING([for $1])
$1="$2"
if ! test -e "$$1" ; then
AC_MSG_ERROR([Could not find required exploded $1!])
fi
AC_MSG_RESULT([$$1])
AC_SUBST($1)
])
])
dnl Find an AAR and expose variables representing its exploded components.
dnl AC_SUBSTs ANDROID_NAME_{AAR,AAR_RES,AAR_LIB,AAR_INTERNAL_LIB}.
dnl Arg 1: name, like play-services-base
dnl Arg 2: version, like 7.8.0
dnl Arg 3: extras subdirectory, either android or google
dnl Arg 4: package subdirectory, like com/google/android/gms
dnl Arg 5: if non-empty, expect and require internal_impl JAR.
dnl Arg 6: if non-empty, expect and require assets/ directory.
AC_DEFUN([MOZ_ANDROID_AAR],[
define([local_aar_var_base], translit($1, [-a-z], [_A-Z]))
define([local_aar_var], concat(ANDROID_, local_aar_var_base, _AAR))
local_aar_var="$ANDROID_SDK_ROOT/extras/$3/m2repository/$4/$1/$2/$1-$2.aar"
AC_MSG_CHECKING([for $1 AAR])
if ! test -e "$local_aar_var" ; then
AC_MSG_ERROR([You must download the $1 AAR. Run the Android SDK tool and install the Android and Google Support Repositories under Extras. See https://developer.android.com/tools/extras/support-library.html for more info. (Looked for $local_aar_var)])
fi
AC_SUBST(local_aar_var)
AC_MSG_RESULT([$local_aar_var])
if ! $PYTHON -m mozbuild.action.explode_aar --destdir=$MOZ_BUILD_ROOT/dist/exploded-aar $local_aar_var ; then
AC_MSG_ERROR([Could not explode $local_aar_var!])
fi
define([root], $MOZ_BUILD_ROOT/dist/exploded-aar/$1-$2/)
MOZ_ANDROID_AAR_COMPONENT(concat(local_aar_var, _LIB), concat(root, $1-$2-classes.jar), REQUIRED)
MOZ_ANDROID_AAR_COMPONENT(concat(local_aar_var, _RES), concat(root, res), REQUIRED)
MOZ_ANDROID_AAR_COMPONENT(concat(local_aar_var, _INTERNAL_LIB), concat(root, libs/$1-$2-internal_impl-$2.jar), $5)
MOZ_ANDROID_AAR_COMPONENT(concat(local_aar_var, _ASSETS), concat(root, assets), $6)
])
AC_DEFUN([MOZ_ANDROID_GOOGLE_PLAY_SERVICES],
[
if test -n "$MOZ_NATIVE_DEVICES" ; then
AC_SUBST(MOZ_NATIVE_DEVICES)
MOZ_ANDROID_AAR(play-services-base, $ANDROID_GOOGLE_PLAY_SERVICES_VERSION, google, com/google/android/gms)
MOZ_ANDROID_AAR(play-services-basement, $ANDROID_GOOGLE_PLAY_SERVICES_VERSION, google, com/google/android/gms)
MOZ_ANDROID_AAR(play-services-cast, $ANDROID_GOOGLE_PLAY_SERVICES_VERSION, google, com/google/android/gms)
MOZ_ANDROID_AAR(mediarouter-v7, $ANDROID_SUPPORT_LIBRARY_VERSION, android, com/android/support, REQUIRED_INTERNAL_IMPL)
fi
])
AC_DEFUN([MOZ_ANDROID_GOOGLE_CLOUD_MESSAGING],
[
if test -n "$MOZ_ANDROID_GCM" ; then
MOZ_ANDROID_AAR(play-services-base, $ANDROID_GOOGLE_PLAY_SERVICES_VERSION, google, com/google/android/gms)
MOZ_ANDROID_AAR(play-services-basement, $ANDROID_GOOGLE_PLAY_SERVICES_VERSION, google, com/google/android/gms)
MOZ_ANDROID_AAR(play-services-gcm, $ANDROID_GOOGLE_PLAY_SERVICES_VERSION, google, com/google/android/gms)
MOZ_ANDROID_AAR(play-services-measurement, $ANDROID_GOOGLE_PLAY_SERVICES_VERSION, google, com/google/android/gms)
fi
])
AC_DEFUN([MOZ_ANDROID_INSTALL_TRACKING],
[
if test -n "$MOZ_INSTALL_TRACKING"; then
AC_SUBST(MOZ_INSTALL_TRACKING)
MOZ_ANDROID_AAR(play-services-ads, $ANDROID_GOOGLE_PLAY_SERVICES_VERSION, google, com/google/android/gms)
MOZ_ANDROID_AAR(play-services-basement, $ANDROID_GOOGLE_PLAY_SERVICES_VERSION, google, com/google/android/gms)
fi
])
dnl Configure an Android SDK.
dnl Arg 1: target SDK version, like 23.
dnl Arg 2: list of build-tools versions, like "23.0.3 23.0.1".
AC_DEFUN([MOZ_ANDROID_SDK],
[
MOZ_ARG_WITH_STRING(android-sdk,
[ --with-android-sdk=DIR
location where the Android SDK can be found (like ~/.mozbuild/android-sdk-linux)],
android_sdk_root=$withval)
android_sdk_root=${withval%/platforms/android-*}
case "$target" in
*-android*|*-linuxandroid*)
if test -z "$android_sdk_root" ; then
AC_MSG_ERROR([You must specify --with-android-sdk=/path/to/sdk when targeting Android.])
fi
# We were given an old-style
# --with-android-sdk=/path/to/sdk/platforms/android-*. We could warn, but
# we'll get compliance by forcing the issue.
if test -e "$withval"/source.properties ; then
AC_MSG_ERROR([Including platforms/android-* in --with-android-sdk arguments is deprecated. Use --with-android-sdk=$android_sdk_root.])
fi
android_target_sdk=$1
AC_MSG_CHECKING([for Android SDK platform version $android_target_sdk])
android_sdk=$android_sdk_root/platforms/android-$android_target_sdk
if ! test -e "$android_sdk/source.properties" ; then
AC_MSG_ERROR([You must download Android SDK platform version $android_target_sdk. Try |mach bootstrap|. (Looked for $android_sdk)])
fi
AC_MSG_RESULT([$android_sdk])
AC_MSG_CHECKING([for Android build-tools])
android_build_tools_base="$android_sdk_root"/build-tools
android_build_tools_version=""
for version in $2; do
android_build_tools="$android_build_tools_base"/$version
if test -d "$android_build_tools" -a -f "$android_build_tools/aapt"; then
android_build_tools_version=$version
AC_MSG_RESULT([$android_build_tools])
break
fi
done
if test "$android_build_tools_version" = ""; then
version=$(echo $2 | cut -d" " -f1)
AC_MSG_ERROR([You must install the Android build-tools version $version. Try |mach bootstrap|. (Looked for "$android_build_tools_base"/$version)])
fi
MOZ_PATH_PROG(ZIPALIGN, zipalign, :, [$android_build_tools])
MOZ_PATH_PROG(DX, dx, :, [$android_build_tools])
MOZ_PATH_PROG(AAPT, aapt, :, [$android_build_tools])
MOZ_PATH_PROG(AIDL, aidl, :, [$android_build_tools])
if test -z "$ZIPALIGN" -o "$ZIPALIGN" = ":"; then
AC_MSG_ERROR([The program zipalign was not found. Try |mach bootstrap|.])
fi
if test -z "$DX" -o "$DX" = ":"; then
AC_MSG_ERROR([The program dx was not found. Try |mach bootstrap|.])
fi
if test -z "$AAPT" -o "$AAPT" = ":"; then
AC_MSG_ERROR([The program aapt was not found. Try |mach bootstrap|.])
fi
if test -z "$AIDL" -o "$AIDL" = ":"; then
AC_MSG_ERROR([The program aidl was not found. Try |mach bootstrap|.])
fi
android_platform_tools="$android_sdk_root"/platform-tools
AC_MSG_CHECKING([for Android platform-tools])
if test -d "$android_platform_tools" -a -f "$android_platform_tools/adb"; then
AC_MSG_RESULT([$android_platform_tools])
else
AC_MSG_ERROR([You must install the Android platform-tools. Try |mach bootstrap|. (Looked for $android_platform_tools)])
fi
MOZ_PATH_PROG(ADB, adb, :, [$android_platform_tools])
if test -z "$ADB" -o "$ADB" = ":"; then
AC_MSG_ERROR([The program adb was not found. Try |mach bootstrap|.])
fi
android_tools="$android_sdk_root"/tools
AC_MSG_CHECKING([for Android tools])
if test -d "$android_tools" -a -f "$android_tools/emulator"; then
AC_MSG_RESULT([$android_tools])
else
AC_MSG_ERROR([You must install the Android tools. Try |mach bootstrap|. (Looked for $android_tools)])
fi
MOZ_PATH_PROG(EMULATOR, emulator, :, [$android_tools])
if test -z "$EMULATOR" -o "$EMULATOR" = ":"; then
AC_MSG_ERROR([The program emulator was not found. Try |mach bootstrap|.])
fi
ANDROID_TARGET_SDK="${android_target_sdk}"
ANDROID_SDK="${android_sdk}"
ANDROID_SDK_ROOT="${android_sdk_root}"
ANDROID_TOOLS="${android_tools}"
ANDROID_BUILD_TOOLS_VERSION="$android_build_tools_version"
AC_DEFINE_UNQUOTED(ANDROID_TARGET_SDK,$ANDROID_TARGET_SDK)
AC_SUBST(ANDROID_TARGET_SDK)
AC_SUBST(ANDROID_SDK_ROOT)
AC_SUBST(ANDROID_SDK)
AC_SUBST(ANDROID_TOOLS)
AC_SUBST(ANDROID_BUILD_TOOLS_VERSION)
MOZ_ANDROID_AAR(customtabs, $ANDROID_SUPPORT_LIBRARY_VERSION, android, com/android/support)
MOZ_ANDROID_AAR(appcompat-v7, $ANDROID_SUPPORT_LIBRARY_VERSION, android, com/android/support)
MOZ_ANDROID_AAR(support-vector-drawable, $ANDROID_SUPPORT_LIBRARY_VERSION, android, com/android/support)
MOZ_ANDROID_AAR(animated-vector-drawable, $ANDROID_SUPPORT_LIBRARY_VERSION, android, com/android/support)
MOZ_ANDROID_AAR(cardview-v7, $ANDROID_SUPPORT_LIBRARY_VERSION, android, com/android/support)
MOZ_ANDROID_AAR(design, $ANDROID_SUPPORT_LIBRARY_VERSION, android, com/android/support)
MOZ_ANDROID_AAR(recyclerview-v7, $ANDROID_SUPPORT_LIBRARY_VERSION, android, com/android/support)
MOZ_ANDROID_AAR(support-v4, $ANDROID_SUPPORT_LIBRARY_VERSION, android, com/android/support, REQUIRED_INTERNAL_IMPL)
MOZ_ANDROID_AAR(palette-v7, $ANDROID_SUPPORT_LIBRARY_VERSION, android, com/android/support)
ANDROID_SUPPORT_ANNOTATIONS_JAR="$ANDROID_SDK_ROOT/extras/android/m2repository/com/android/support/support-annotations/$ANDROID_SUPPORT_LIBRARY_VERSION/support-annotations-$ANDROID_SUPPORT_LIBRARY_VERSION.jar"
AC_MSG_CHECKING([for support-annotations JAR])
if ! test -e $ANDROID_SUPPORT_ANNOTATIONS_JAR ; then
AC_MSG_ERROR([You must download the support-annotations lib. Run the Android SDK tool and install the Android Support Repository under Extras. See https://developer.android.com/tools/extras/support-library.html for more info. (looked for $ANDROID_SUPPORT_ANNOTATIONS_JAR)])
fi
AC_MSG_RESULT([$ANDROID_SUPPORT_ANNOTATIONS_JAR])
AC_SUBST(ANDROID_SUPPORT_ANNOTATIONS_JAR)
ANDROID_SUPPORT_ANNOTATIONS_JAR_LIB=$ANDROID_SUPPORT_ANNOTATIONS_JAR
AC_SUBST(ANDROID_SUPPORT_ANNOTATIONS_JAR_LIB)
;;
esac
MOZ_ARG_WITH_STRING(android-min-sdk,
[ --with-android-min-sdk=[VER] Impose a minimum Firefox for Android SDK version],
[ MOZ_ANDROID_MIN_SDK_VERSION=$withval ])
MOZ_ARG_WITH_STRING(android-max-sdk,
[ --with-android-max-sdk=[VER] Impose a maximum Firefox for Android SDK version],
[ MOZ_ANDROID_MAX_SDK_VERSION=$withval ])
if test -n "$MOZ_ANDROID_MIN_SDK_VERSION"; then
if test -n "$MOZ_ANDROID_MAX_SDK_VERSION"; then
if test $MOZ_ANDROID_MAX_SDK_VERSION -lt $MOZ_ANDROID_MIN_SDK_VERSION ; then
AC_MSG_ERROR([--with-android-max-sdk must be at least the value of --with-android-min-sdk.])
fi
fi
if test $MOZ_ANDROID_MIN_SDK_VERSION -gt $ANDROID_TARGET_SDK ; then
AC_MSG_ERROR([--with-android-min-sdk is expected to be less than $ANDROID_TARGET_SDK])
fi
AC_DEFINE_UNQUOTED(MOZ_ANDROID_MIN_SDK_VERSION, $MOZ_ANDROID_MIN_SDK_VERSION)
AC_SUBST(MOZ_ANDROID_MIN_SDK_VERSION)
fi
if test -n "$MOZ_ANDROID_MAX_SDK_VERSION"; then
AC_DEFINE_UNQUOTED(MOZ_ANDROID_MAX_SDK_VERSION, $MOZ_ANDROID_MAX_SDK_VERSION)
AC_SUBST(MOZ_ANDROID_MAX_SDK_VERSION)
fi
])

View file

@ -200,7 +200,6 @@ def old_configure_options(*options):
'--enable-logrefcnt',
'--enable-maintenance-service',
'--enable-memory-sanitizer',
'--enable-mobile-optimize',
'--enable-mozril-geoloc',
'--enable-necko-wifi',
'--enable-negotiateauth',

View file

@ -1078,14 +1078,8 @@ WebGLContext::ClearBackbufferIfNeeded()
void
WebGLContext::LoseOldestWebGLContextIfLimitExceeded()
{
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
// some mobile devices can't have more than 8 GL contexts overall
const size_t kMaxWebGLContextsPerPrincipal = 2;
const size_t kMaxWebGLContexts = 4;
#else
const size_t kMaxWebGLContextsPerPrincipal = 16;
const size_t kMaxWebGLContexts = 32;
#endif
MOZ_ASSERT(kMaxWebGLContextsPerPrincipal < kMaxWebGLContexts);
if (!NS_IsMainThread()) {

View file

@ -144,15 +144,6 @@ PushRecord.prototype = {
return Date.now();
}
#ifdef MOZ_ANDROID_HISTORY
let result = yield Messaging.sendRequestForResult({
type: "History:GetPrePathLastVisitedTimeMilliseconds",
prePath: this.uri.prePath,
});
return result == 0 ? -Infinity : result;
#endif
// Places History transition types that can fire a
// `pushsubscriptionchange` event when the user visits a site with expired push
// registrations. Visits only count if the user sees the origin in the address

View file

@ -4064,13 +4064,7 @@ _cairo_image_surface_glyphs (void *abstract_surface,
composite_glyphs_info_t glyph_info;
cairo_clip_t local_clip;
cairo_bool_t have_clip = FALSE;
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
// For performance reasons we don't want to use two passes for overlapping glyphs
// on mobile
cairo_bool_t overlap = FALSE;
#else
cairo_bool_t overlap;
#endif
cairo_status_t status;
cairo_rectangle_int_t rect;
@ -4084,11 +4078,7 @@ _cairo_image_surface_glyphs (void *abstract_surface,
scaled_font,
glyphs, num_glyphs,
clip,
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
NULL);
#else
&overlap);
#endif
if (unlikely (status))
return status;

View file

@ -903,13 +903,7 @@ typedef struct _cairo_traps {
#endif
#define CAIRO_GSTATE_OPERATOR_DEFAULT CAIRO_OPERATOR_OVER
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
// Skia uses a tolerance of 0.5 we'll use something more
// tolerant for now
#define CAIRO_GSTATE_TOLERANCE_DEFAULT 0.3
#else
#define CAIRO_GSTATE_TOLERANCE_DEFAULT 0.1
#endif
#define CAIRO_GSTATE_FILL_RULE_DEFAULT CAIRO_FILL_RULE_WINDING
#define CAIRO_GSTATE_LINE_WIDTH_DEFAULT 2.0
#define CAIRO_GSTATE_LINE_CAP_DEFAULT CAIRO_LINE_CAP_BUTT

View file

@ -9,13 +9,7 @@
#ifndef MOZILLA_VERSION
#error "Need mozilla headers"
#endif
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
#define LOW_QUALITY_INTERPOLATION
#define LOWER_QUALITY_INTERPOLATION
#define BILINEAR_INTERPOLATION_BITS 4
#else
#define BILINEAR_INTERPOLATION_BITS 7
#endif
#define BILINEAR_INTERPOLATION_RANGE (1 << BILINEAR_INTERPOLATION_BITS)
/*

View file

@ -1399,11 +1399,7 @@ ContainerLayer::DefaultComputeEffectiveTransforms(const Matrix4x4& aTransformToS
checkClipRect = true;
checkMaskLayers = true;
} else {
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
if (!contTransform.PreservesAxisAlignedRectangles()) {
#else
if (gfx::ThebesMatrix(contTransform).HasNonIntegerTranslation()) {
#endif
checkClipRect = true;
}
/* In 2D case, only translation and/or positive scaling can be done w/o using IntermediateSurface.

View file

@ -139,21 +139,13 @@ RotatedBuffer::DrawBufferQuadrant(gfx::DrawTarget* aTarget,
transform *= oldTransform;
transform *= inverseMask;
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
SurfacePattern source(snapshot, ExtendMode::CLAMP, transform, SamplingFilter::POINT);
#else
SurfacePattern source(snapshot, ExtendMode::CLAMP, transform);
#endif
aTarget->SetTransform(*aMaskTransform);
aTarget->MaskSurface(source, aMask, Point(0, 0), DrawOptions(aOpacity, aOperator));
aTarget->SetTransform(oldTransform);
} else {
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
DrawSurfaceOptions options(SamplingFilter::POINT);
#else
DrawSurfaceOptions options;
#endif
aTarget->DrawSurface(snapshot, IntRectToRect(fillRect),
GetSourceRectangle(aXSide, aYSide),
options,
@ -466,9 +458,6 @@ RotatedContentBuffer::BeginPaint(PaintedLayer* aLayer,
}
if (mode == SurfaceMode::SURFACE_COMPONENT_ALPHA) {
#if defined(MOZ_GFX_OPTIMIZE_MOBILE)
mode = SurfaceMode::SURFACE_SINGLE_CHANNEL_ALPHA;
#else
if (!aLayer->GetParent() ||
!aLayer->GetParent()->SupportsComponentAlphaChildren() ||
!aLayer->AsShadowableLayer() ||
@ -477,7 +466,6 @@ RotatedContentBuffer::BeginPaint(PaintedLayer* aLayer,
} else {
result.mContentType = gfxContentType::COLOR;
}
#endif
}
if ((aFlags & PAINT_WILL_RESAMPLE) &&

View file

@ -39,7 +39,6 @@ ClientPaintedLayer::PaintThebes()
"Can only draw in drawing phase");
uint32_t flags = RotatedContentBuffer::PAINT_CAN_DRAW_ROTATED;
#ifndef MOZ_IGNORE_PAINT_WILL_RESAMPLE
if (ClientManager()->CompositorMightResample()) {
flags |= RotatedContentBuffer::PAINT_WILL_RESAMPLE;
}
@ -48,7 +47,6 @@ ClientPaintedLayer::PaintThebes()
flags |= RotatedContentBuffer::PAINT_WILL_RESAMPLE;
}
}
#endif
PaintState state =
mContentClient->BeginPaintBuffer(this, flags);
mValidRegion.Sub(mValidRegion, state.mRegionToInvalidate);

View file

@ -462,7 +462,6 @@ ClientTiledPaintedLayer::RenderLayer()
TILING_LOG("TILING %p: Initial low-precision valid region %s\n", this, Stringify(mLowPrecisionValidRegion).c_str());
nsIntRegion neededRegion = mVisibleRegion.ToUnknownRegion();
#ifndef MOZ_IGNORE_PAINT_WILL_RESAMPLE
// This is handled by PadDrawTargetOutFromRegion in TiledContentClient for mobile
if (MayResample()) {
// If we're resampling then bilinear filtering can read up to 1 pixel
@ -477,7 +476,6 @@ ClientTiledPaintedLayer::RenderLayer()
padded.IntersectRect(padded, wholeTiles);
neededRegion = padded;
}
#endif
nsIntRegion invalidRegion;
invalidRegion.Sub(neededRegion, mValidRegion);

View file

@ -308,30 +308,17 @@ ClientTiledLayerBuffer::GetContentType(SurfaceMode* aMode) const
SurfaceMode mode = mPaintedLayer.GetSurfaceMode();
if (mode == SurfaceMode::SURFACE_COMPONENT_ALPHA) {
#if defined(MOZ_GFX_OPTIMIZE_MOBILE)
mode = SurfaceMode::SURFACE_SINGLE_CHANNEL_ALPHA;
#else
if (!mPaintedLayer.GetParent() ||
!mPaintedLayer.GetParent()->SupportsComponentAlphaChildren()) {
mode = SurfaceMode::SURFACE_SINGLE_CHANNEL_ALPHA;
} else {
content = gfxContentType::COLOR;
}
#endif
} else if (mode == SurfaceMode::SURFACE_OPAQUE) {
#if defined(MOZ_GFX_OPTIMIZE_MOBILE)
if (IsLowPrecision()) {
// If we're in low-res mode, drawing can sample from outside the visible
// region. Make sure that we only sample transparency if that happens.
mode = SurfaceMode::SURFACE_SINGLE_CHANNEL_ALPHA;
content = gfxContentType::COLOR_ALPHA;
}
#else
if (mPaintedLayer.MayResample()) {
mode = SurfaceMode::SURFACE_SINGLE_CHANNEL_ALPHA;
content = gfxContentType::COLOR_ALPHA;
}
#endif
}
if (aMode) {

View file

@ -71,7 +71,6 @@ ContentHostTexture::Composite(LayerComposite* aLayer,
nsIntRegion tmpRegion;
const nsIntRegion* renderRegion;
#ifndef MOZ_IGNORE_PAINT_WILL_RESAMPLE
if (PaintWillResample()) {
// If we're resampling, then the texture image will contain exactly the
// entire visible region's bounds, and we should draw it all in one quad
@ -81,9 +80,6 @@ ContentHostTexture::Composite(LayerComposite* aLayer,
} else {
renderRegion = aVisibleRegion;
}
#else
renderRegion = aVisibleRegion;
#endif
nsIntRegion region(*renderRegion);
nsIntPoint origin = GetOriginOffset();

View file

@ -425,7 +425,6 @@ TiledContentHost::Composite(LayerComposite* aLayer,
nsIntRegion tmpRegion;
const nsIntRegion* renderRegion = aVisibleRegion;
#ifndef MOZ_IGNORE_PAINT_WILL_RESAMPLE
if (PaintWillResample()) {
// If we're resampling, then the texture image will contain exactly the
// entire visible region's bounds, and we should draw it all in one quad
@ -433,7 +432,6 @@ TiledContentHost::Composite(LayerComposite* aLayer,
tmpRegion = aVisibleRegion->GetBounds();
renderRegion = &tmpRegion;
}
#endif
// Render the low and high precision buffers.
RenderLayerBuffer(mLowPrecisionTiledBuffer,

View file

@ -155,7 +155,6 @@ static const Float BOX_BORDER_OPACITY = 0.5;
* Quartz cairo backend which doesn't generally support masking with surfaces.
* So for now we just paint a bunch of rectangles...
*/
#ifndef MOZ_GFX_OPTIMIZE_MOBILE
static void
DrawHexChar(uint32_t aDigit, const Point& aPt, DrawTarget& aDrawTarget,
const Pattern &aPattern)
@ -182,7 +181,6 @@ DrawHexChar(uint32_t aDigit, const Point& aPt, DrawTarget& aDrawTarget,
RefPtr<Path> path = builder->Finish();
aDrawTarget.Fill(path, aPattern);
}
#endif // MOZ_GFX_OPTIMIZE_MOBILE
void
gfxFontMissingGlyphs::DrawMissingGlyph(uint32_t aChar,
@ -209,15 +207,10 @@ gfxFontMissingGlyphs::DrawMissingGlyph(uint32_t aChar,
if (!borderStrokeRect.IsEmpty()) {
ColorPattern adjustedColor = color;
color.mColor.a *= BOX_BORDER_OPACITY;
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
aDrawTarget.FillRect(borderStrokeRect, adjustedColor);
#else
StrokeOptions strokeOptions(BOX_BORDER_WIDTH);
aDrawTarget.StrokeRect(borderStrokeRect, adjustedColor, strokeOptions);
#endif
}
#ifndef MOZ_GFX_OPTIMIZE_MOBILE
Point center = aRect.Center();
Float halfGap = HEX_CHAR_GAP / 2.f;
Float top = -(MINIFONT_HEIGHT + halfGap);
@ -266,7 +259,6 @@ gfxFontMissingGlyphs::DrawMissingGlyph(uint32_t aChar,
Point(third, halfGap), aDrawTarget, color);
}
}
#endif
}
Float

View file

@ -460,15 +460,7 @@ private:
DECL_GFX_PREF(Live, "layers.bench.enabled", LayersBenchEnabled, bool, false);
DECL_GFX_PREF(Once, "layers.bufferrotation.enabled", BufferRotationEnabled, bool, true);
DECL_GFX_PREF(Live, "layers.child-process-shutdown", ChildProcessShutdown, bool, true);
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
// If MOZ_GFX_OPTIMIZE_MOBILE is defined, we force component alpha off
// and ignore the preference.
DECL_GFX_PREF(Skip, "layers.componentalpha.enabled", ComponentAlphaEnabled, bool, false);
#else
// If MOZ_GFX_OPTIMIZE_MOBILE is not defined, we actually take the
// preference value, defaulting to true.
DECL_GFX_PREF(Once, "layers.componentalpha.enabled", ComponentAlphaEnabled, bool, true);
#endif
DECL_GFX_PREF(Live, "layers.composer2d.enabled", Composer2DCompositionEnabled, bool, false);
DECL_GFX_PREF(Once, "layers.d3d11.force-warp", LayersD3D11ForceWARP, bool, false);
DECL_GFX_PREF(Live, "layers.deaa.enabled", LayersDEAAEnabled, bool, false);

View file

@ -378,7 +378,6 @@ gfxUtils::ConvertBGRAtoRGBA(uint8_t* aData, uint32_t aLength)
libyuv::ABGRToARGB(aData, aLength, aData, aLength, aLength / 4, 1);
}
#if !defined(MOZ_GFX_OPTIMIZE_MOBILE)
/**
* This returns the fastest operator to use for solid surfaces which have no
* alpha channel or their alpha channel is uniformly opaque.
@ -448,66 +447,7 @@ CreateSamplingRestrictedDrawable(gfxDrawable* aDrawable,
RefPtr<gfxDrawable> drawable = new gfxSurfaceDrawable(surface, size, gfxMatrix::Translation(-needed.TopLeft()));
return drawable.forget();
}
#endif // !MOZ_GFX_OPTIMIZE_MOBILE
/* These heuristics are based on Source/WebCore/platform/graphics/skia/ImageSkia.cpp:computeResamplingMode() */
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
static SamplingFilter ReduceResamplingFilter(SamplingFilter aSamplingFilter,
int aImgWidth, int aImgHeight,
float aSourceWidth, float aSourceHeight)
{
// Images smaller than this in either direction are considered "small" and
// are not resampled ever (see below).
const int kSmallImageSizeThreshold = 8;
// The amount an image can be stretched in a single direction before we
// say that it is being stretched so much that it must be a line or
// background that doesn't need resampling.
const float kLargeStretch = 3.0f;
if (aImgWidth <= kSmallImageSizeThreshold
|| aImgHeight <= kSmallImageSizeThreshold) {
// Never resample small images. These are often used for borders and
// rules (think 1x1 images used to make lines).
return SamplingFilter::POINT;
}
if (aImgHeight * kLargeStretch <= aSourceHeight || aImgWidth * kLargeStretch <= aSourceWidth) {
// Large image tiling detected.
// Don't resample if it is being tiled a lot in only one direction.
// This is trying to catch cases where somebody has created a border
// (which might be large) and then is stretching it to fill some part
// of the page.
if (fabs(aSourceWidth - aImgWidth)/aImgWidth < 0.5 || fabs(aSourceHeight - aImgHeight)/aImgHeight < 0.5)
return SamplingFilter::POINT;
// The image is growing a lot and in more than one direction. Resampling
// is slow and doesn't give us very much when growing a lot.
return aSamplingFilter;
}
/* Some notes on other heuristics:
The Skia backend also uses nearest for backgrounds that are stretched by
a large amount. I'm not sure this is common enough for us to worry about
now. It also uses nearest for backgrounds/avoids high quality for images
that are very slightly scaled. I'm also not sure that very slightly
scaled backgrounds are common enough us to worry about.
We don't currently have much support for doing high quality interpolation.
The only place this currently happens is on Quartz and we don't have as
much control over it as would be needed. Webkit avoids using high quality
resampling during load. It also avoids high quality if the transformation
is not just a scale and translation
WebKit bug #40045 added code to avoid resampling different parts
of an image with different methods by using a resampling hint size.
It currently looks unused in WebKit but it's something to watch out for.
*/
return aSamplingFilter;
}
#else
static SamplingFilter ReduceResamplingFilter(SamplingFilter aSamplingFilter,
int aImgWidth, int aImgHeight,
int aSourceWidth, int aSourceHeight)
@ -515,7 +455,6 @@ static SamplingFilter ReduceResamplingFilter(SamplingFilter aSamplingFilter,
// Just pass the filter through unchanged
return aSamplingFilter;
}
#endif
#ifdef MOZ_WIDGET_COCOA
// Only prescale a temporary surface if we're going to repeat it often.
@ -667,10 +606,6 @@ gfxUtils::DrawPixelSnapped(gfxContext* aContext,
}
#endif
// On Mobile, we don't ever want to do this; it has the potential for
// allocating very large temporary surfaces, especially since we'll
// do full-page snapshots often (see bug 749426).
#if !defined(MOZ_GFX_OPTIMIZE_MOBILE)
RefPtr<gfxDrawable> restrictedDrawable =
CreateSamplingRestrictedDrawable(aDrawable, aContext,
aRegion, aFormat);
@ -682,7 +617,6 @@ gfxUtils::DrawPixelSnapped(gfxContext* aContext,
// drawn without tiling.
extendMode = ExtendMode::CLAMP;
}
#endif
}
}

1
js/src/aclocal.m4 vendored
View file

@ -20,7 +20,6 @@ builtin(include, ../../build/autoconf/frameptr.m4)dnl
builtin(include, ../../build/autoconf/compiler-opts.m4)dnl
builtin(include, ../../build/autoconf/expandlibs.m4)dnl
builtin(include, ../../build/autoconf/arch.m4)dnl
builtin(include, ../../build/autoconf/android.m4)dnl
builtin(include, ../../build/autoconf/zlib.m4)dnl
builtin(include, ../../build/autoconf/icu.m4)dnl
builtin(include, ../../build/autoconf/clang-plugin.m4)dnl

View file

@ -80,8 +80,6 @@ else
fi
AC_SUBST(autoconfmk)
MOZ_ANDROID_NDK
if test -n "$gonkdir" ; then
LDFLAGS="-L$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib -Wl,-rpath-link=$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib --sysroot=$gonkdir/out/target/product/$GONK_PRODUCT/obj/ -llog $LDFLAGS"
fi
@ -448,14 +446,6 @@ dnl Configure platform-specific CPU architecture compiler options.
dnl ==============================================================
MOZ_ARCH_OPTS
dnl ========================================================
dnl Android libstdc++, placed here so it can use MOZ_ARCH
dnl computed above.
dnl ========================================================
MOZ_ANDROID_CPU_ARCH
MOZ_ANDROID_STLPORT
dnl ========================================================
dnl Suppress Clang Argument Warnings
dnl ========================================================
@ -649,15 +639,6 @@ case "$target" in
MOZ_FIX_LINK_PATHS="-Wl,-executable_path,${DIST}/bin"
;;
*-android*|*-linuxandroid*)
AC_DEFINE(NO_PW_GECOS)
MOZ_GFX_OPTIMIZE_MOBILE=1
MOZ_OPTIMIZE_FLAGS="-O3"
if test -z "$CLANG_CC"; then
MOZ_OPTIMIZE_FLAGS="-freorder-blocks -fno-reorder-functions $MOZ_OPTIMIZE_FLAGS"
fi
;;
*-*linux*)
if test "$GNU_CC" -o "$GNU_CXX"; then
MOZ_PGO_OPTIMIZE_FLAGS="-O3"
@ -1439,9 +1420,6 @@ if test "$ac_cv_thread_keyword" = yes; then
mips*-*)
:
;;
*-android*|*-linuxandroid*)
:
;;
*)
AC_DEFINE(HAVE_THREAD_TLS_KEYWORD)
;;

View file

@ -6275,14 +6275,8 @@ ContainerState::CreateMaskLayer(Layer *aLayer,
uint32_t maxSize = mManager->GetMaxTextureSize();
NS_ASSERTION(maxSize > 0, "Invalid max texture size");
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
// Make mask image width aligned to 4. See Bug 1245552.
gfx::Size surfaceSize(std::min<gfx::Float>(GetAlignedStride<4>(NSToIntCeil(boundingRect.Width()), 1), maxSize),
std::min<gfx::Float>(boundingRect.Height(), maxSize));
#else
gfx::Size surfaceSize(std::min<gfx::Float>(boundingRect.Width(), maxSize),
std::min<gfx::Float>(boundingRect.Height(), maxSize));
#endif
// maskTransform is applied to the clip when it is painted into the mask (as a
// component of imageTransform), and its inverse used when the mask is used for

View file

@ -1488,11 +1488,7 @@ nsDisplayListBuilder::IsInWillChangeBudget(nsIFrame* aFrame,
return onBudget;
}
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
const float gAGRBudgetAreaMultiplier = 0.3;
#else
const float gAGRBudgetAreaMultiplier = 3.0;
#endif
bool
nsDisplayListBuilder::AddToAGRBudget(nsIFrame* aFrame)

View file

@ -4592,11 +4592,7 @@ PresShell::RenderDocument(const nsRect& aRect, uint32_t aFlags,
nsPresContext::AppUnitsToFloatCSSPixels(aRect.width),
nsPresContext::AppUnitsToFloatCSSPixels(aRect.height));
aThebesContext->NewPath();
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
aThebesContext->Rectangle(r, true);
#else
aThebesContext->Rectangle(r);
#endif
nsIFrame* rootFrame = mFrameConstructor->GetRootFrame();
if (!rootFrame) {

View file

@ -271,7 +271,6 @@ nsDisplayCanvasBackgroundColor::WriteDebugInfo(std::stringstream& aStream)
}
#endif
#ifndef MOZ_GFX_OPTIMIZE_MOBILE
static void BlitSurface(DrawTarget* aDest, const gfxRect& aRect, DrawTarget* aSource)
{
RefPtr<SourceSurface> source = aSource->Snapshot();
@ -279,7 +278,6 @@ static void BlitSurface(DrawTarget* aDest, const gfxRect& aRect, DrawTarget* aSo
Rect(aRect.x, aRect.y, aRect.width, aRect.height),
Rect(0, 0, aRect.width, aRect.height));
}
#endif
void
nsDisplayCanvasBackgroundImage::Paint(nsDisplayListBuilder* aBuilder,
@ -289,7 +287,6 @@ nsDisplayCanvasBackgroundImage::Paint(nsDisplayListBuilder* aBuilder,
nsPoint offset = ToReferenceFrame();
nsRect bgClipRect = frame->CanvasArea() + offset;
#ifndef MOZ_GFX_OPTIMIZE_MOBILE
RefPtr<gfxContext> dest = aCtx->ThebesContext();
gfxRect destRect;
if (IsSingleFixedPositionImage(aBuilder, bgClipRect, &destRect) &&
@ -322,7 +319,6 @@ nsDisplayCanvasBackgroundImage::Paint(nsDisplayListBuilder* aBuilder,
return;
}
}
#endif
PaintInternal(aBuilder, aCtx, mVisibleRect, &bgClipRect);
}

View file

@ -1429,12 +1429,6 @@ nsPluginFrame::BuildLayer(nsDisplayListBuilder* aBuilder,
imglayer->SetScaleToSize(size, ScaleMode::STRETCH);
imglayer->SetContainer(container);
SamplingFilter samplingFilter = nsLayoutUtils::GetSamplingFilterForFrame(this);
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
if (!aManager->IsCompositingCheap()) {
// Pixman just horrible with bilinear filter scaling
samplingFilter = SamplingFilter::POINT;
}
#endif
imglayer->SetSamplingFilter(samplingFilter);
layer->SetContentFlags(IsOpaque() ? Layer::CONTENT_OPAQUE : 0);

View file

@ -90,15 +90,7 @@ DIST="$MOZ_BUILD_ROOT/dist"
MOZ_DEFAULT_COMPILER
if test "$COMPILE_ENVIRONMENT"; then
MOZ_ANDROID_NDK
fi # COMPILE_ENVIRONMENT
case "$target" in
*-android*|*-linuxandroid*)
ZLIB_DIR=yes
AC_DEFINE(ANDROID)
;;
*-linux*)
AC_PATH_PROG(OBJCOPY,objcopy)
;;
@ -523,16 +515,6 @@ else
fi
fi # COMPILE_ENVIRONMENT
dnl ========================================================
dnl Android libstdc++, placed here so it can use MOZ_ARCH
dnl computed above.
dnl ========================================================
MOZ_ANDROID_CPU_ARCH
if test "$COMPILE_ENVIRONMENT"; then
MOZ_ANDROID_STLPORT
fi # COMPILE_ENVIRONMENT
dnl ========================================================
dnl Suppress Clang Argument Warnings
dnl ========================================================
@ -867,19 +849,6 @@ case "$target" in
MOZ_FIX_LINK_PATHS="-Wl,-executable_path,${DIST}/bin"
;;
*-android*|*-linuxandroid*)
AC_DEFINE(NO_PW_GECOS)
if test "$COMPILE_ENVIRONMENT"; then
MOZ_LINKER=1
fi
MOZ_GFX_OPTIMIZE_MOBILE=1
MOZ_OPTIMIZE_FLAGS="-O2"
if test -z "$CLANG_CC"; then
MOZ_OPTIMIZE_FLAGS="-freorder-blocks -fno-reorder-functions $MOZ_OPTIMIZE_FLAGS"
fi
;;
*-*linux*)
if test "$GNU_CC" -o "$GNU_CXX"; then
MOZ_PGO_OPTIMIZE_FLAGS="-O3"
@ -1869,9 +1838,6 @@ if test "$ac_cv_thread_keyword" = yes -a "$MOZ_LINKER" != 1; then
mips*-*)
:
;;
*-android*|*-linuxandroid*)
:
;;
*-openbsd*)
:
;;
@ -2186,30 +2152,6 @@ case "$target_os" in
;;
esac
case "${target}" in
*-android*|*-linuxandroid*)
MOZ_THEME_FASTSTRIPE=1
MOZ_RAW=1
;;
esac
# Optional Firefox for Android partner distribution directory.
MOZ_ARG_WITH_STRING(android-distribution-directory,
[ --with-android-distribution-directory=dir
Optional Firefox for Android partner distribution directory.],
MOZ_ANDROID_DISTRIBUTION_DIRECTORY=$withval)
if test -n "$MOZ_ANDROID_DISTRIBUTION_DIRECTORY"; then
# A distribution directory must have an assets/distribution directory.
# See https://wiki.mozilla.org/Mobile/Distribution_Files.
if test ! -d "$MOZ_ANDROID_DISTRIBUTION_DIRECTORY/assets/distribution" ; then
AC_MSG_ERROR([--with-android-distribution-directory does not contain assets/distribution;
(looked for ${MOZ_ANDROID_DISTRIBUTION_DIRECTORY}/assets/distribution).])
fi
fi
AC_SUBST(MOZ_ANDROID_DISTRIBUTION_DIRECTORY)
dnl ========================================================
dnl = Vendor override
dnl ========================================================
@ -2264,17 +2206,6 @@ if test -n "$MOZ_GRAPHENE"; then
AC_DEFINE(MOZ_GRAPHENE)
fi
dnl ========================================================
dnl Ensure Android SDK and build-tools versions depending on
dnl mobile target.
dnl ========================================================
case "$MOZ_BUILD_APP" in
mobile/android)
MOZ_ANDROID_SDK(23, 23.0.3 23.0.1)
;;
esac
dnl ========================================================
dnl =
dnl = Toolkit Options
@ -2474,17 +2405,6 @@ fi
AC_DEFINE_UNQUOTED(MOZ_DISTRIBUTION_ID,"$MOZ_DISTRIBUTION_ID")
AC_SUBST(MOZ_DISTRIBUTION_ID)
dnl ========================================================
dnl Google Play Services, placed here so it can depend on
dnl values set by configure.sh above.
dnl ========================================================
MOZ_ANDROID_GOOGLE_PLAY_SERVICES
MOZ_ANDROID_GOOGLE_CLOUD_MESSAGING
MOZ_ANDROID_INSTALL_TRACKING
dnl ========================================================
dnl = GIO and GConf support module
dnl ========================================================
@ -2684,7 +2604,7 @@ dnl --enable-webrtc to override. Can disable for everything in
dnl the master list above.
if test -n "$MOZ_WEBRTC"; then
case "$target" in
*-linux*|*-mingw*|*-darwin*|*-android*|*-linuxandroid*|*-dragonfly*|*-freebsd*|*-netbsd*|*-openbsd*)
*-linux*|*-mingw*|*-darwin*|*-dragonfly*|*-freebsd*|*-netbsd*|*-openbsd*)
dnl Leave enabled
;;
*)
@ -3880,25 +3800,6 @@ dnl =
dnl ========================================================
MOZ_ARG_HEADER(Runtime debugging and Optimizations)
dnl ========================================================
dnl enable mobile optimizations
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(mobile-optimize,
[ --enable-mobile-optimize
Enable mobile optimizations],
MOZ_GFX_OPTIMIZE_MOBILE=1)
AC_SUBST(MOZ_GFX_OPTIMIZE_MOBILE)
if test "$MOZ_GFX_OPTIMIZE_MOBILE"; then
# We ignore paint will resample on mobile for performance.
# We may want to revisit this later.
MOZ_IGNORE_PAINT_WILL_RESAMPLE=1
AC_DEFINE(MOZ_GFX_OPTIMIZE_MOBILE)
AC_DEFINE(MOZ_IGNORE_PAINT_WILL_RESAMPLE)
fi
dnl ========================================================
dnl = Enable code optimization. ON by default.
dnl ========================================================
@ -5077,7 +4978,6 @@ AC_SUBST(ENABLE_TESTS)
AC_SUBST(MOZ_UNIVERSALCHARDET)
AC_SUBST(ACCESSIBILITY)
AC_SUBST(MOZ_SPELLCHECK)
AC_SUBST(MOZ_ANDROID_ANR_REPORTER)
AC_SUBST(MOZ_VERIFY_MAR_SIGNATURE)
AC_SUBST(MOZ_ENABLE_SIGNMAR)
AC_SUBST(MOZ_UPDATER)
@ -5091,9 +4991,6 @@ AC_SUBST(MOZ_DIRECTX_SDK_PATH)
AC_SUBST(MOZ_D3DCOMPILER_XP_DLL)
AC_SUBST(MOZ_D3DCOMPILER_XP_CAB)
AC_SUBST(MOZ_ANDROID_APPLICATION_CLASS)
AC_SUBST(MOZ_ANDROID_BROWSER_INTENT_CLASS)
AC_SUBST(MOZ_ANDROID_SEARCH_INTENT_CLASS)
AC_SUBST(MOZ_EXCLUDE_HYPHENATION_DICTIONARIES)
AC_SUBST(MOZ_INSTALL_TRACKING)
AC_SUBST(ENABLE_STRIP)
@ -5190,10 +5087,6 @@ AC_SUBST(MOZ_CHILD_PROCESS_BUNDLE)
# the main application is set to the value of this variable. If not
# set, it falls back to a Mozilla-specific value derived from the
# build ID.
# - MOZ_ANDROID_SHARED_ID: On Android, "android:sharedUserId" for all Android
# packages produced.
# - MOZ_ANDROID_GCM_SENDERID: On Android, the Android GCM Sender ID used. GCM
# sender IDs are not sensitive: see, http://stackoverflow.com/a/18216063.
# - MOZ_PROFILE_MIGRATOR: When set, enables profile migrator.
if test -z "$MOZ_APP_NAME"; then
@ -5212,14 +5105,6 @@ if test -z "$ANDROID_PACKAGE_NAME" ; then
ANDROID_PACKAGE_NAME="org.mozilla.$MOZ_APP_NAME"
fi
# Mozilla released Firefox for Android {Release,Beta} and {Aurora,Nightly} to
# the public with specific common shared IDs and we need to keep them
# consistent forever. The specific common values are set by per-channel
# branding; all other channels use a generic sharedID, set below.
if test -z "$MOZ_ANDROID_SHARED_ID" ; then
MOZ_ANDROID_SHARED_ID="${ANDROID_PACKAGE_NAME}.sharedID"
fi
# For extensions and langpacks, we require a max version that is compatible
# across security releases. MOZ_APP_MAXVERSION is our method for doing that.
# 24.0a1 and 24.0a2 aren't affected
@ -5246,8 +5131,6 @@ AC_SUBST(MOZ_APP_VENDOR)
AC_SUBST(MOZ_APP_PROFILE)
AC_SUBST(MOZ_APP_ID)
AC_SUBST(MOZ_APP_ANDROID_VERSION_CODE)
AC_SUBST(MOZ_ANDROID_SHARED_ID)
AC_SUBST(MOZ_ANDROID_GCM_SENDERID)
AC_SUBST(MAR_CHANNEL_ID)
AC_SUBST(ACCEPTED_MAR_CHANNEL_IDS)
AC_SUBST(MOZ_PROFILE_MIGRATOR)

View file

@ -1,267 +0,0 @@
# 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/.
from __future__ import absolute_import, unicode_literals
import itertools
import os
import time
import types
import xml.dom.minidom as minidom
import xml.etree.ElementTree as ET
from mozpack.copier import FileCopier
from mozpack.files import (FileFinder, PreprocessedFile)
from mozpack.manifests import InstallManifest
import mozpack.path as mozpath
from .common import CommonBackend
from ..frontend.data import (
AndroidEclipseProjectData,
ContextDerived,
ContextWrapped,
)
from ..makeutil import Makefile
from ..util import ensureParentDir
from mozbuild.base import (
ExecutionSummary,
MachCommandConditions,
)
def pretty_print(element):
"""Return a pretty-printed XML string for an Element.
"""
s = ET.tostring(element, 'utf-8')
# minidom wraps element in a Document node; firstChild strips it.
return minidom.parseString(s).firstChild.toprettyxml(indent=' ')
class AndroidEclipseBackend(CommonBackend):
"""Backend that generates Android Eclipse project files.
"""
def __init__(self, environment):
if not MachCommandConditions.is_android(environment):
raise Exception(
'The Android Eclipse backend is not available with this '
'configuration.')
super(AndroidEclipseBackend, self).__init__(environment)
def summary(self):
return ExecutionSummary(
'AndroidEclipse backend executed in {execution_time:.2f}s\n'
'Wrote {projects:d} Android Eclipse projects to {path:s}; '
'{created:d} created; {updated:d} updated',
execution_time=self._execution_time,
projects=self._created_count + self._updated_count,
path=mozpath.join(self.environment.topobjdir, 'android_eclipse'),
created=self._created_count,
updated=self._updated_count,
)
def consume_object(self, obj):
"""Write out Android Eclipse project files."""
if not isinstance(obj, ContextDerived):
return False
if CommonBackend.consume_object(self, obj):
# If CommonBackend acknowledged the object, we're done with it.
return True
# Handle the one case we care about specially.
if isinstance(obj, ContextWrapped) and isinstance(obj.wrapped, AndroidEclipseProjectData):
self._process_android_eclipse_project_data(obj.wrapped, obj.srcdir, obj.objdir)
# We don't want to handle most things, so we just acknowledge all objects
return True
def consume_finished(self):
"""The common backend handles WebIDL and test files. We don't handle
these, so we don't call our superclass.
"""
def _Element_for_classpathentry(self, cpe):
"""Turn a ClassPathEntry into an XML Element, like one of:
<classpathentry including="**/*.java" kind="src" path="preprocessed"/>
<classpathentry including="**/*.java" excluding="org/mozilla/gecko/Excluded.java|org/mozilla/gecko/SecondExcluded.java" kind="src" path="src"/>
<classpathentry including="**/*.java" kind="src" path="thirdparty">
<attributes>
<attribute name="ignore_optional_problems" value="true"/>
</attributes>
</classpathentry>
"""
e = ET.Element('classpathentry')
e.set('kind', 'src')
e.set('including', '**/*.java')
e.set('path', cpe.path)
if cpe.exclude_patterns:
e.set('excluding', '|'.join(sorted(cpe.exclude_patterns)))
if cpe.ignore_warnings:
attrs = ET.SubElement(e, 'attributes')
attr = ET.SubElement(attrs, 'attribute')
attr.set('name', 'ignore_optional_problems')
attr.set('value', 'true')
return e
def _Element_for_referenced_project(self, name):
"""Turn a referenced project name into an XML Element, like:
<classpathentry combineaccessrules="false" kind="src" path="/Fennec"/>
"""
e = ET.Element('classpathentry')
e.set('kind', 'src')
e.set('combineaccessrules', 'false')
# All project directories are in the same root; this
# reference is absolute in the Eclipse namespace.
e.set('path', '/' + name)
return e
def _Element_for_extra_jar(self, name):
"""Turn a referenced JAR name into an XML Element, like:
<classpathentry exported="true" kind="lib" path="/Users/nalexander/Mozilla/gecko-dev/build/mobile/robocop/robotium-solo-4.3.1.jar"/>
"""
e = ET.Element('classpathentry')
e.set('kind', 'lib')
e.set('exported', 'true')
e.set('path', name)
return e
def _Element_for_filtered_resources(self, filtered_resources):
"""Turn a list of filtered resource arguments like
['1.0-projectRelativePath-matches-false-false-*org/mozilla/gecko/resources/**']
into an XML Element, like:
<filteredResources>
<filter>
<id>1393009101322</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-projectRelativePath-matches-false-false-*org/mozilla/gecko/resources/**</arguments>
</matcher>
</filter>
</filteredResources>
The id is random; the values are magic."""
id = int(1000 * time.time())
filteredResources = ET.Element('filteredResources')
for arg in sorted(filtered_resources):
e = ET.SubElement(filteredResources, 'filter')
ET.SubElement(e, 'id').text = str(id)
id += 1
ET.SubElement(e, 'name')
ET.SubElement(e, 'type').text = '30' # It's magic!
matcher = ET.SubElement(e, 'matcher')
ET.SubElement(matcher, 'id').text = 'org.eclipse.ui.ide.multiFilter'
ET.SubElement(matcher, 'arguments').text = str(arg)
return filteredResources
def _manifest_for_project(self, srcdir, project):
manifest = InstallManifest()
if project.manifest:
manifest.add_copy(mozpath.join(srcdir, project.manifest), 'AndroidManifest.xml')
if project.res:
manifest.add_symlink(mozpath.join(srcdir, project.res), 'res')
else:
# Eclipse expects a res directory no matter what, so we
# make an empty directory if the project doesn't specify.
res = os.path.abspath(mozpath.join(os.path.dirname(__file__),
'templates', 'android_eclipse_empty_resource_directory'))
manifest.add_pattern_copy(res, '.**', 'res')
if project.assets:
manifest.add_symlink(mozpath.join(srcdir, project.assets), 'assets')
for cpe in project._classpathentries:
manifest.add_symlink(mozpath.join(srcdir, cpe.srcdir), cpe.dstdir)
# JARs and native libraries go in the same place. For now, we're adding
# class path entries with the full path to required JAR files (which
# makes sense for JARs in the source directory, but probably doesn't for
# JARs in the object directory). This could be a problem because we only
# know the contents of (a subdirectory of) libs/ after a successful
# build and package, which is after build-backend time. At the cost of
# some flexibility, we explicitly copy certain libraries here; if the
# libraries aren't present -- namely, when the tree hasn't been packaged
# -- this fails. That's by design, to avoid crashes on device caused by
# missing native libraries.
for src, dst in project.libs:
manifest.add_copy(mozpath.join(srcdir, src), dst)
return manifest
def _process_android_eclipse_project_data(self, data, srcdir, objdir):
# This can't be relative to the environment's topsrcdir,
# because during testing topsrcdir is faked.
template_directory = os.path.abspath(mozpath.join(os.path.dirname(__file__),
'templates', 'android_eclipse'))
project_directory = mozpath.join(self.environment.topobjdir, 'android_eclipse', data.name)
manifest_path = mozpath.join(self.environment.topobjdir, 'android_eclipse', '%s.manifest' % data.name)
manifest = self._manifest_for_project(srcdir, data)
ensureParentDir(manifest_path)
manifest.write(path=manifest_path)
classpathentries = []
for cpe in sorted(data._classpathentries, key=lambda x: x.path):
e = self._Element_for_classpathentry(cpe)
classpathentries.append(ET.tostring(e))
for name in sorted(data.referenced_projects):
e = self._Element_for_referenced_project(name)
classpathentries.append(ET.tostring(e))
for name in sorted(data.extra_jars):
e = self._Element_for_extra_jar(mozpath.join(srcdir, name))
classpathentries.append(ET.tostring(e))
defines = {}
defines['IDE_OBJDIR'] = objdir
defines['IDE_TOPOBJDIR'] = self.environment.topobjdir
defines['IDE_SRCDIR'] = srcdir
defines['IDE_TOPSRCDIR'] = self.environment.topsrcdir
defines['IDE_PROJECT_NAME'] = data.name
defines['IDE_PACKAGE_NAME'] = data.package_name
defines['IDE_PROJECT_DIRECTORY'] = project_directory
defines['IDE_RELSRCDIR'] = mozpath.relpath(srcdir, self.environment.topsrcdir)
defines['IDE_CLASSPATH_ENTRIES'] = '\n'.join('\t' + cpe for cpe in classpathentries)
defines['IDE_RECURSIVE_MAKE_TARGETS'] = ' '.join(sorted(data.recursive_make_targets))
# Like android.library=true
defines['IDE_PROJECT_LIBRARY_SETTING'] = 'android.library=true' if data.is_library else ''
# Like android.library.reference.1=FennecBrandingResources
defines['IDE_PROJECT_LIBRARY_REFERENCES'] = '\n'.join(
'android.library.reference.%s=%s' % (i + 1, ref)
for i, ref in enumerate(sorted(data.included_projects)))
if data.filtered_resources:
filteredResources = self._Element_for_filtered_resources(data.filtered_resources)
defines['IDE_PROJECT_FILTERED_RESOURCES'] = pretty_print(filteredResources).strip()
else:
defines['IDE_PROJECT_FILTERED_RESOURCES'] = ''
defines['ANDROID_TARGET_SDK'] = self.environment.substs['ANDROID_TARGET_SDK']
defines['MOZ_ANDROID_MIN_SDK_VERSION'] = self.environment.defines['MOZ_ANDROID_MIN_SDK_VERSION']
copier = FileCopier()
finder = FileFinder(template_directory)
for input_filename, f in itertools.chain(finder.find('**'), finder.find('.**')):
if input_filename == 'AndroidManifest.xml' and not data.is_library:
# Main projects supply their own manifests.
continue
copier.add(input_filename, PreprocessedFile(
mozpath.join(finder.base, input_filename),
depfile_path=None,
marker='#',
defines=defines,
extra_depends={mozpath.join(finder.base, input_filename)}))
# When we re-create the build backend, we kill everything that was there.
if os.path.isdir(project_directory):
self._updated_count += 1
else:
self._created_count += 1
copier.copy(project_directory, skip_if_older=False, remove_unaccounted=True)

View file

@ -1,10 +0,0 @@
#filter substitution
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="gen"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="output" path="bin/classes"/>
@IDE_CLASSPATH_ENTRIES@
</classpath>

View file

@ -1,8 +0,0 @@
#filter substitution
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="false"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_DISABLED_BUILDER" value="com.android.ide.eclipse.adt.ApkBuilder"/>
<mapAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
</launchConfiguration>

View file

@ -1,8 +0,0 @@
#filter substitution
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="false"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_DISABLED_BUILDER" value="com.android.ide.eclipse.adt.PreCompilerBuilder"/>
<mapAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
</launchConfiguration>

View file

@ -1,8 +0,0 @@
#filter substitution
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="false"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_DISABLED_BUILDER" value="com.android.ide.eclipse.adt.ResourceManagerBuilder"/>
<mapAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
</launchConfiguration>

View file

@ -1,8 +0,0 @@
#filter substitution
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_DISABLED_BUILDER" value="org.eclipse.jdt.core.javabuilder"/>
<mapAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
</launchConfiguration>

View file

@ -1,11 +0,0 @@
#filter substitution
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="@IDE_PACKAGE_NAME@"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="@MOZ_ANDROID_MIN_SDK_VERSION@"
android:targetSdkVersion="@ANDROID_TARGET_SDK@" />
</manifest>

View file

@ -1 +0,0 @@
#filter substitution

View file

@ -1,5 +0,0 @@
#filter substitution
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<issue id="NewApi" severity="ignore" />
</lint>

View file

@ -1,14 +0,0 @@
#filter substitution
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
# Project target.
target=android-L
@IDE_PROJECT_LIBRARY_SETTING@
@IDE_PROJECT_LIBRARY_REFERENCES@

View file

@ -1,5 +0,0 @@
This file is named such that it is ignored by Android aapt. The file
itself ensures that the AndroidEclipse build backend can create an
empty res/ directory for projects explicitly specifying that it has no
resource directory. This is necessary because the Android Eclipse
plugin requires that each project have a res/ directory.

View file

@ -126,9 +126,6 @@ def build_dict(config, env=os.environ):
d['platform_guess'] = guess_platform()
d['buildtype_guess'] = guess_buildtype()
if 'buildapp' in d and d['buildapp'] == 'mobile/android' and 'MOZ_ANDROID_MIN_SDK_VERSION' in substs:
d['android_min_sdk'] = substs['MOZ_ANDROID_MIN_SDK_VERSION']
return d

View file

@ -13,9 +13,6 @@ for var in ('target',
DEFINES['CFLAGS'] = CONFIG['OS_CFLAGS']
DEFINES['TOPOBJDIR'] = TOPOBJDIR
if CONFIG['MOZ_ANDROID_CXX_STL'] == 'libc++':
DEFINES['MOZ_USE_LIBCXX'] = True
JAR_MANIFESTS += ['jar.mn']

View file

@ -208,13 +208,6 @@ MOZ_SAFE_BROWSING:
false,
#endif
MOZ_ANDROID_HISTORY:
#ifdef MOZ_ANDROID_HISTORY
true,
#else
false,
#endif
MOZ_TOOLKIT_SEARCH:
#ifdef MOZ_TOOLKIT_SEARCH
true,
@ -222,13 +215,6 @@ MOZ_SAFE_BROWSING:
false,
#endif
MOZ_ANDROID_ACTIVITY_STREAM:
#ifdef MOZ_ANDROID_ACTIVITY_STREAM
true,
#else
false,
#endif
DLL_PREFIX: "@DLL_PREFIX@",
DLL_SUFFIX: "@DLL_SUFFIX@",

View file

@ -1,126 +0,0 @@
# 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/.
# This file should ONLY be included from upload-files.mk. It was
# split into its own file to increase comprehension of
# upload-files.mk.
include $(MOZILLA_DIR)/config/android-common.mk
# Files packed into the APK root. Packing files into the APK root is not
# supported by modern Android build systems, including Gradle, so don't add to
# this list without Android peer approval.
ROOT_FILES := \
application.ini \
package-name.txt \
ua-update.json \
platform.ini \
removed-files \
$(NULL)
GECKO_APP_AP_PATH = $(topobjdir)/mobile/android/base
ifdef ENABLE_TESTS
INNER_ROBOCOP_PACKAGE=true
else
INNER_ROBOCOP_PACKAGE=echo 'Testing is disabled - No Android Robocop for you'
endif
ifdef MOZ_ANDROID_PACKAGE_INSTALL_BOUNCER
INNER_INSTALL_BOUNCER_PACKAGE=true
ifdef ENABLE_TESTS
UPLOAD_EXTRA_FILES += bouncer.apk
bouncer_package=$(ABS_DIST)/bouncer.apk
# Package and release sign the install bouncer APK. This assumes that the main
# APK (that is, $(PACKAGE)) has already been produced, and verifies that the
# bouncer APK and the main APK define the same set of permissions. The
# intention is to avoid permission-related surprises when bouncing to the
# installation process in the Play Store. N.b.: sort -u is Posix and saves
# invoking uniq separately. diff -u is *not* Posix, so we only add -c.
INNER_INSTALL_BOUNCER_PACKAGE=\
$(call RELEASE_SIGN_ANDROID_APK,$(topobjdir)/mobile/android/bouncer/bouncer-unsigned-unaligned.apk,$(bouncer_package)) && \
($(AAPT) dump permissions $(PACKAGE) | sort -u > $(PACKAGE).permissions && \
$(AAPT) dump permissions $(bouncer_package) | sort -u > $(bouncer_package).permissions && \
diff -c $(PACKAGE).permissions $(bouncer_package).permissions || \
(echo "*** Error: The permissions of the bouncer package differ from the permissions of the main package. Ensure the bouncer and main package Android manifests agree, rebuild mobile/android, and re-package." && exit 1))
else
INNER_INSTALL_BOUNCER_PACKAGE=echo 'Testing is disabled, so the install bouncer is disabled - No trampolines for you'
endif # ENABLE_TESTS
else
INNER_INSTALL_BOUNCER_PACKAGE=echo 'Install bouncer is disabled - No trampolines for you'
endif # MOZ_ANDROID_PACKAGE_INSTALL_BOUNCER
# Fennec's OMNIJAR_NAME can include a directory; for example, it might
# be "assets/omni.ja". This path specifies where the omni.ja file
# lives in the APK, but should not root the resources it contains
# under assets/ (i.e., resources should not live at chrome://assets/).
# packager.py writes /omni.ja in order to be consistent with the
# layout expected by language repacks. Therefore, we move it to the
# correct path here, in INNER_MAKE_PACKAGE. See comment about
# OMNIJAR_NAME in configure.in.
# OMNIJAR_DIR is './' for "omni.ja", 'assets/' for "assets/omni.ja".
OMNIJAR_DIR := $(dir $(OMNIJAR_NAME))
OMNIJAR_NAME := $(notdir $(OMNIJAR_NAME))
# We force build an ap_ that does not check dependencies below.
# Language repacks take advantage of this unchecked dependency ap_ to
# insert additional resources (translated strings) into the ap_
# without the build system's participation. This can do the wrong
# thing if there are resource changes in between build time and
# package time.
PKG_SUFFIX = .apk
INNER_FENNEC_PACKAGE = \
$(MAKE) -C $(GECKO_APP_AP_PATH) gecko-nodeps.ap_ && \
$(PYTHON) -m mozbuild.action.package_fennec_apk \
--verbose \
--inputs \
$(GECKO_APP_AP_PATH)/gecko-nodeps.ap_ \
--omnijar $(STAGEPATH)$(MOZ_PKG_DIR)/$(OMNIJAR_NAME) \
--classes-dex $(GECKO_APP_AP_PATH)/classes.dex \
--lib-dirs $(STAGEPATH)$(MOZ_PKG_DIR)/lib \
--assets-dirs $(STAGEPATH)$(MOZ_PKG_DIR)/assets \
--features-dirs $(STAGEPATH)$(MOZ_PKG_DIR)/features \
--root-files $(foreach f,$(ROOT_FILES),$(STAGEPATH)$(MOZ_PKG_DIR)/$(f)) \
--output $(PACKAGE:.apk=-unsigned-unaligned.apk) && \
$(call RELEASE_SIGN_ANDROID_APK,$(PACKAGE:.apk=-unsigned-unaligned.apk),$(PACKAGE))
# Packaging produces many optional artifacts.
package_fennec = \
$(INNER_FENNEC_PACKAGE) && \
$(INNER_ROBOCOP_PACKAGE) && \
$(INNER_INSTALL_BOUNCER_PACKAGE)
# Re-packaging only replaces Android resources and the omnijar before
# (re-)signing.
repackage_fennec = \
$(MAKE) -C $(GECKO_APP_AP_PATH) gecko-nodeps.ap_ && \
$(PYTHON) -m mozbuild.action.package_fennec_apk \
--verbose \
--inputs \
$(UNPACKAGE) \
$(GECKO_APP_AP_PATH)/gecko-nodeps.ap_ \
--omnijar $(STAGEPATH)$(MOZ_PKG_DIR)/$(OMNIJAR_NAME) \
--output $(PACKAGE:.apk=-unsigned-unaligned.apk) && \
$(call RELEASE_SIGN_ANDROID_APK,$(PACKAGE:.apk=-unsigned-unaligned.apk),$(PACKAGE))
INNER_MAKE_PACKAGE = $(if $(UNPACKAGE),$(repackage_fennec),$(package_fennec))
# Language repacks root the resources contained in assets/omni.ja
# under assets/, but the repacks expect them to be rooted at /.
# Therefore, we we move the omnijar back to / so the resources are
# under the root here, in INNER_UNMAKE_PACKAGE. See comments about
# OMNIJAR_NAME earlier in this file and in configure.in.
INNER_UNMAKE_PACKAGE = \
mkdir $(MOZ_PKG_DIR) && \
( cd $(MOZ_PKG_DIR) && \
$(UNZIP) $(UNPACKAGE) $(ROOT_FILES) && \
$(UNZIP) $(UNPACKAGE) $(OMNIJAR_DIR)$(OMNIJAR_NAME) && \
$(if $(filter-out ./,$(OMNIJAR_DIR)), \
mv $(OMNIJAR_DIR)$(OMNIJAR_NAME) $(OMNIJAR_NAME), \
true) )