Flip EGLImage workaround list
Instead of activating the workaround for all apps except a select few,
flip the logic to only activate the workaround when we need it as it
seems to break some common use cases.
Issue: FP2A10-162
Change-Id: I07d4d54dba1377d007c8607a5d30ca9dc40ecebf
diff --git a/src/gpu/GrAHardwareBufferUtils.cpp b/src/gpu/GrAHardwareBufferUtils.cpp
index 7d9ee29..54c9368 100644
--- a/src/gpu/GrAHardwareBufferUtils.cpp
+++ b/src/gpu/GrAHardwareBufferUtils.cpp
@@ -190,36 +190,36 @@
delete cleanupHelper;
}
-static const auto EGLImageWorkaroundBlacklist = std::array{
- "com.android.camera2",
- "android.camera.cts",
+static const auto EGLImageWorkaroundAllowlist = std::array{
+ "android.uirendering.cts",
+ "com.android.launcher3",
};
-static bool isProcessOnEGLWorkaroundBlacklist() {
+static bool isProcessOnEGLWorkaroundAllowlist() {
static bool checked = false;
- static bool isOnBlacklist = false;
+ static bool isOnAllowlist = false;
if (checked) {
- return isOnBlacklist;
+ return isOnAllowlist;
}
const char* processName = getprogname();
if (!processName) {
// Cannot read, so need to assume false.
- isOnBlacklist = false;
+ isOnAllowlist = false;
checked = true;
- return isOnBlacklist;
+ return isOnAllowlist;
}
- const auto& bl = EGLImageWorkaroundBlacklist;
- isOnBlacklist = std::find(bl.begin(), bl.end(), std::string(processName)) != bl.end();
+ const auto& l = EGLImageWorkaroundAllowlist;
+ isOnAllowlist = std::find(l.begin(), l.end(), std::string(processName)) != l.end();
checked = true;
- if (isOnBlacklist) {
- SkDebugf("createGLTextureFromPrivateHandle: process is blacklisted for EGLImage "
+ if (isOnAllowlist) {
+ SkDebugf("createGLTextureFromPrivateHandle: process is listed for EGLImage "
"workaround");
}
- return isOnBlacklist;
+ return isOnAllowlist;
}
static GrBackendTexture createGLTextureFromPrivateHandle(
@@ -228,7 +228,7 @@
DeleteImageProc* deleteProc, DeleteImageCtx* deleteCtx,
const GrBackendFormat& backendFormat) {
- if (isProcessOnEGLWorkaroundBlacklist()) {
+ if (!isProcessOnEGLWorkaroundAllowlist()) {
return GrBackendTexture();
}