aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShahbaz Youssefi <syoussefi@chromium.org>2022-04-20 03:22:59 -0400
committerAngle LUCI CQ <angle-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-04-20 15:29:34 +0000
commit5610ab64237aaf8299b4088049e111b56aa1f480 (patch)
treea8b6d111c6217439805d34d8c8f2123351608b33
parent6199e905a7c886a2e307ae6627e81755146c514b (diff)
downloadangle-5610ab64237aaf8299b4088049e111b56aa1f480.tar.gz
Fix ANGLEGetDisplayPlatform after method deprecation
This function verifies that the methods that are named match methods of PlatformMethods. Since 8074061d2, some methods have been deprecated, which caused this function to fail to return the platform methods for the Android platform. The Android platform doesn't actually use the deprecated functions. In this change, ANGLEGetDisplayPlatform is made to ignore deprecated methods (whose names start with `placeholder`) to maintain backwards compatibility. This can be reverted once Android and any other potential user is fixed. Bug: b/229651121 Change-Id: I1d51a6e064f1dec128f67c0991cd8fb2646ad2b1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3594804 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
-rw-r--r--src/libANGLE/Platform.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libANGLE/Platform.cpp b/src/libANGLE/Platform.cpp
index 3ee8d4ed50..fafd1afdf1 100644
--- a/src/libANGLE/Platform.cpp
+++ b/src/libANGLE/Platform.cpp
@@ -48,6 +48,13 @@ bool ANGLE_APIENTRY ANGLEGetDisplayPlatform(angle::EGLDisplayType display,
{
const char *expectedName = angle::g_PlatformMethodNames[nameIndex];
const char *actualName = methodNames[nameIndex];
+
+ // Skip deprecated methods. The names of these methods start with |placeholder|.
+ constexpr char kPlaceholder[] = "placeholder";
+ if (strncmp(expectedName, kPlaceholder, sizeof(kPlaceholder) - 1) == 0)
+ {
+ continue;
+ }
if (strcmp(expectedName, actualName) != 0)
{
ERR() << "Invalid platform method name: " << actualName << ", expected " << expectedName