Bug 1858843 - Remove pre-Lollipop code from C/C++. r=geckoview-reviewers,media-playback-reviewers,padenot,owlish,jnicol

Differential Revision: https://phabricator.services.mozilla.com/D191602
This commit is contained in:
Makoto Kato 2023-11-09 17:39:59 +00:00
Родитель 22aadef0ce
Коммит 36497ee57a
10 изменённых файлов: 7 добавлений и 96 удалений

Просмотреть файл

@ -152,9 +152,7 @@ MediaDecoderStateMachineBase* HLSDecoder::CreateStateMachine(
return new MediaDecoderStateMachine(this, mReader);
}
bool HLSDecoder::IsEnabled() {
return StaticPrefs::media_hls_enabled() && (jni::GetAPIVersion() >= 16);
}
bool HLSDecoder::IsEnabled() { return StaticPrefs::media_hls_enabled(); }
bool HLSDecoder::IsSupportedType(const MediaContainerType& aContainerType) {
return IsEnabled() && DecoderTraits::IsHttpLiveStreamingType(aContainerType);

Просмотреть файл

@ -75,17 +75,7 @@ void AllocPolicyImpl::RejectAll() {
}
}
static int32_t MediaDecoderLimitDefault() {
#ifdef MOZ_WIDGET_ANDROID
if (jni::GetAPIVersion() < 18) {
// Older Android versions have broken support for multiple simultaneous
// decoders, see bug 1278574.
return 1;
}
#endif
// Otherwise, set no decoder limit.
return -1;
}
static int32_t MediaDecoderLimitDefault() { return -1; }
StaticMutex GlobalAllocPolicy::sMutex;

Просмотреть файл

@ -80,10 +80,6 @@ media::MediaCodecsSupported AndroidDecoderModule::GetSupportedCodecs() {
DecodeSupportSet AndroidDecoderModule::SupportsMimeType(
const nsACString& aMimeType) {
if (jni::GetAPIVersion() < 16) {
return media::DecodeSupportSet{};
}
if (!sSupportedSwMimeTypes) {
SetSupportedMimeTypes();
}

Просмотреть файл

@ -902,25 +902,6 @@ bool GLContext::InitImpl() {
// prevents occasional driver crash.
mNeedsFlushBeforeDeleteFB = true;
}
#ifdef MOZ_WIDGET_ANDROID
if ((Renderer() == GLRenderer::AdrenoTM305 ||
Renderer() == GLRenderer::AdrenoTM320 ||
Renderer() == GLRenderer::AdrenoTM330) &&
jni::GetAPIVersion() < 21) {
// Bug 1164027. Driver crashes when functions such as
// glTexImage2D fail due to virtual memory exhaustion.
mTextureAllocCrashesOnMapFailure = true;
}
#endif
#if MOZ_WIDGET_ANDROID
if (Renderer() == GLRenderer::SGX540 && jni::GetAPIVersion() <= 15) {
// Bug 1288446. Driver sometimes crashes when uploading data to a
// texture if the render target has changed since the texture was
// rendered from. Calling glCheckFramebufferStatus after
// glFramebufferTexture2D prevents the crash.
mNeedsCheckAfterAttachTextureToFb = true;
}
#endif
// -
@ -1656,15 +1637,6 @@ void GLContext::InitExtensions() {
MarkExtensionUnsupported(OES_EGL_sync);
}
#ifdef MOZ_WIDGET_ANDROID
if (Vendor() == GLVendor::Imagination &&
Renderer() == GLRenderer::SGX544MP && jni::GetAPIVersion() < 21) {
// Bug 1026404
MarkExtensionUnsupported(OES_EGL_image);
MarkExtensionUnsupported(OES_EGL_image_external);
}
#endif
if (Vendor() == GLVendor::ARM && (Renderer() == GLRenderer::Mali400MP ||
Renderer() == GLRenderer::Mali450MP)) {
// Bug 1264505

Просмотреть файл

@ -2090,9 +2090,6 @@ class GLContext : public GenericAtomicRefCounted, public SupportsWeakPtr {
mSymbols.fFramebufferTexture2D(target, attachmentPoint, textureTarget,
texture, level);
AFTER_GL_CALL;
if (mNeedsCheckAfterAttachTextureToFb) {
fCheckFramebufferStatus(target);
}
}
void fFramebufferTextureLayer(GLenum target, GLenum attachment,
@ -3657,7 +3654,6 @@ class GLContext : public GenericAtomicRefCounted, public SupportsWeakPtr {
bool mNeedsTextureSizeChecks = false;
bool mNeedsFlushBeforeDeleteFB = false;
bool mTextureAllocCrashesOnMapFailure = false;
bool mNeedsCheckAfterAttachTextureToFb = false;
const bool mWorkAroundDriverBugs;
mutable uint64_t mSyncGLCallCount = 0;

Просмотреть файл

@ -364,13 +364,6 @@ class AndroidVsyncSource final : public VsyncSource,
already_AddRefed<mozilla::gfx::VsyncSource>
gfxAndroidPlatform::CreateGlobalHardwareVsyncSource() {
// Vsync was introduced since JB (API 16~18) but inaccurate. Enable only for
// KK (API 19) and later.
if (jni::GetAPIVersion() >= 19) {
RefPtr<AndroidVsyncSource> vsyncSource = new AndroidVsyncSource();
return vsyncSource.forget();
}
NS_WARNING("Vsync not supported. Falling back to software vsync");
return GetSoftwareVsyncSource();
RefPtr<AndroidVsyncSource> vsyncSource = new AndroidVsyncSource();
return vsyncSource.forget();
}

Просмотреть файл

@ -175,16 +175,6 @@ UniquePtr<hal::PerformanceHintSession> CreatePerformanceHintSession(
return nullptr;
}
#if __ANDROID_API__ < __ANDROID_API_L__
// pthread_gettid_np() (used below) didn't exist prior to lollipop. Currently
// 32-bit builds use an older NDK minimum version than this, meaning we cannot
// use this feature. But that's okay since only the very most recent devices
// support PerformanceHintManager, and users will likely be running 64 bit
// builds on them. This limitation will be removed when we next update the
// minimum version in bug 1820295.
return nullptr;
#else
const auto* api = PerformanceHintManagerApi::Get();
nsTArray<pid_t> tids(aThreads.Length());
@ -199,7 +189,6 @@ UniquePtr<hal::PerformanceHintSession> CreatePerformanceHintSession(
}
return MakeUnique<AndroidPerformanceHintSession>(session);
#endif
}
} // namespace hal_impl

Просмотреть файл

@ -188,9 +188,6 @@ class CreateOnUiThread : public Runnable {
auto regOnExit = MakeScopeExit(
[&stackTop]() { profiler_register_thread("AndroidUI", stackTop); });
// Bionic does not properly support pthread_attr_getstack for the UI thread
// until Lollipop (API 21).
# if __ANDROID_API__ >= __ANDROID_API_L__
pthread_attr_t attrs;
if (pthread_getattr_np(pthread_self(), &attrs)) {
return;
@ -203,8 +200,7 @@ class CreateOnUiThread : public Runnable {
}
stackTop = static_cast<char*>(stackBase) + stackSize - 1;
# endif // __ANDROID_API__ >= __ANDROID_API_L__
#endif // defined(MOZ_GECKO_PROFILER)
#endif // defined(MOZ_GECKO_PROFILER)
}
};

Просмотреть файл

@ -195,9 +195,6 @@ void GfxInfo::EnsureInitialized() {
", Manufacturer: %s", NS_LossyConvertUTF16toASCII(mManufacturer).get());
mSDKVersion = java::sdk::Build::VERSION::SDK_INT();
// the HARDWARE field isn't available on Android SDK < 8, but we require 9+
// anyway.
MOZ_ASSERT(mSDKVersion >= 8);
jni::String::LocalRef hardware = java::sdk::Build::HARDWARE();
mHardware = hardware->ToString();
mAdapterDescription.AppendPrintf(
@ -405,11 +402,7 @@ nsresult GfxInfo::GetFeatureStatusImpl(
// Don't evaluate special cases when evaluating the downloaded blocklist.
if (aDriverInfo.IsEmpty()) {
if (aFeature == nsIGfxInfo::FEATURE_CANVAS2D_ACCELERATION) {
if (mSDKVersion < 11) {
// It's slower than software due to not having a compositing fast path
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_OS_VERSION;
aFailureId = "FEATURE_FAILURE_CANVAS_2D_SDK";
} else if (mGLStrings->Renderer().Find("Vivante GC1000") != -1) {
if (mGLStrings->Renderer().Find("Vivante GC1000") != -1) {
// Blocklist Vivante GC1000. See bug 1248183.
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
aFailureId = "FEATURE_FAILED_CANVAS_2D_HW";
@ -427,14 +420,6 @@ nsresult GfxInfo::GetFeatureStatusImpl(
return NS_OK;
}
if (mSDKVersion <= 17) {
if (mGLStrings->Renderer().Find("Adreno (TM) 3") != -1) {
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
aFailureId = "FEATURE_FAILURE_ADRENO_3xx";
}
return NS_OK;
}
if (mHardware.EqualsLiteral("ville")) {
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
aFailureId = "FEATURE_FAILURE_VILLE";

Просмотреть файл

@ -306,11 +306,7 @@ class NPZCSupport final
MOZ_ASSERT(!!win);
#endif // defined(DEBUG)
// Use vsync for touch resampling on API level 19 and above.
// See gfxAndroidPlatform::CreateGlobalHardwareVsyncSource() for comparison.
if (jni::GetAPIVersion() >= 19) {
mAndroidVsync = AndroidVsync::GetInstance();
}
mAndroidVsync = AndroidVsync::GetInstance();
}
~NPZCSupport() {