From ef4c79849129eeae9eb1619b9dbee0c380cc9a4e Mon Sep 17 00:00:00 2001 From: sotaro Date: Thu, 24 Sep 2020 09:43:21 +0000 Subject: [PATCH] Bug 1665815 - Avoid using scissored glClear() on Android Emulator with SwiftShader r=geckoview-reviewers,jnicol,agi Emulator with SwiftShader is buggy when attempting to clear picture cache textures with a scissor rect set. Differential Revision: https://phabricator.services.mozilla.com/D90644 --- widget/android/GfxInfo.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/widget/android/GfxInfo.cpp b/widget/android/GfxInfo.cpp index 46b7a272b014..3f8a6abb5981 100644 --- a/widget/android/GfxInfo.cpp +++ b/widget/android/GfxInfo.cpp @@ -599,6 +599,22 @@ nsresult GfxInfo::GetFeatureStatusImpl( } return NS_OK; } + + if (aFeature == FEATURE_WEBRENDER_SCISSORED_CACHE_CLEARS) { + // Emulator with SwiftShader is buggy when attempting to clear picture + // cache textures with a scissor rect set. + const bool isEmulatorSwiftShader = + mGLStrings->Renderer().Find( + "Android Emulator OpenGL ES Translator (Google SwiftShader)") >= + 0; + if (isEmulatorSwiftShader) { + *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE; + aFailureId = "FEATURE_FAILURE_BUG_1603515"; + } else { + *aStatus = nsIGfxInfo::FEATURE_STATUS_OK; + } + return NS_OK; + } } return GfxInfoBase::GetFeatureStatusImpl(