зеркало из https://github.com/AvaloniaUI/angle.git
Remove version-1 API of A4A opt-in/out (a.k.a. feature-support utilities)
Bug: angleproject:2794 Change-Id: I7f41452a37536a00d772ecd9b21125ff7459a3d6 Reviewed-on: https://chromium-review.googlesource.com/c/1357151 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Ian Elliott <ianelliott@google.com>
This commit is contained in:
Родитель
4622905b30
Коммит
5a8d0bc288
|
@ -800,69 +800,6 @@ extern "C" {
|
|||
|
||||
using namespace angle;
|
||||
|
||||
#if defined(ANGLE_PLATFORM_ANDROID)
|
||||
// This function is part of the NOW-DEPRECATED version-1 API:
|
||||
ANGLE_EXPORT bool ANGLEGetUtilityAPI(unsigned int *versionToUse)
|
||||
{
|
||||
if (*versionToUse >= kFeatureVersion_LowestSupported)
|
||||
{
|
||||
if (*versionToUse <= kFeatureVersion_HighestSupported)
|
||||
{
|
||||
// This versionToUse is valid, and doesn't need to be changed.
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// The versionToUse is greater than the highest version supported; change it to the
|
||||
// highest version supported (caller will decide if it can use that version).
|
||||
*versionToUse = kFeatureVersion_HighestSupported;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// The versionToUse is less than the lowest version supported, which is an error.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// This function is part of the NOW-DEPRECATED version-1 API:
|
||||
ANGLE_EXPORT bool AndroidUseANGLEForApplication(int rules_fd,
|
||||
long rules_offset,
|
||||
long rules_length,
|
||||
const char *appName,
|
||||
const char *deviceMfr,
|
||||
const char *deviceModel)
|
||||
{
|
||||
Scenario scenario(appName, deviceMfr, deviceModel);
|
||||
bool rtn = false;
|
||||
scenario.logScenario();
|
||||
|
||||
// Read the contents of the file into a string and then parse it:
|
||||
if (rules_fd < 0)
|
||||
{
|
||||
WARN("Asked to read a non-open JSON file");
|
||||
return rtn;
|
||||
}
|
||||
off_t fileSize = rules_length;
|
||||
off_t startOfContent = rules_offset;
|
||||
lseek(rules_fd, startOfContent, SEEK_SET);
|
||||
char *buffer = new char[fileSize + 1];
|
||||
ssize_t numBytesRead = read(rules_fd, buffer, fileSize);
|
||||
buffer[numBytesRead] = '\0';
|
||||
std::string jsonFileContents = std::string(buffer);
|
||||
delete[] buffer;
|
||||
RuleList *rules = RuleList::ReadRulesFromJsonString(jsonFileContents);
|
||||
rules->logRules();
|
||||
|
||||
rtn = rules->getUseANGLE(scenario);
|
||||
VERBOSE("Application \"%s\" should %s ANGLE", appName, rtn ? "use" : "NOT use");
|
||||
|
||||
delete rules;
|
||||
return rtn;
|
||||
}
|
||||
#endif // if defined(ANGLE_PLATFORM_ANDROID)
|
||||
|
||||
// This function is part of the version-2 API:
|
||||
ANGLE_EXPORT bool ANGLEGetFeatureSupportUtilAPIVersion(unsigned int *versionToUse)
|
||||
{
|
||||
|
|
|
@ -15,49 +15,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**************************************************************************************************
|
||||
*
|
||||
* The following is the "version 1" private API for the Android EGL loader:
|
||||
*
|
||||
**************************************************************************************************/
|
||||
|
||||
// Callers of the ANGLE feature-support-utility API (e.g. the Android EGL loader) will call this
|
||||
// function in order to determine what version of the API it can use (if any).
|
||||
//
|
||||
// The caller supplies the highest version of the API that it knows about. If that version is
|
||||
// supported by the feature-support-utility, true is returned and the version isn't changed. If
|
||||
// the supplied version is higher than supported by the feature-support-utility, true is
|
||||
// returned and the version is changed to the highest supported by the feature-support-utility.
|
||||
// If the supplied version is lower than supported by the feature-support-utility, false is
|
||||
// returned.
|
||||
//
|
||||
// Parameters:
|
||||
//
|
||||
// - versionToUse (IN/OUT) - The application supplies the highest version of the interface that
|
||||
// it knows about. If successful, the output value is either unchanged or is the highest
|
||||
// supported by the interface.
|
||||
//
|
||||
ANGLE_EXPORT bool ANGLEGetUtilityAPI(unsigned int *versionToUse);
|
||||
|
||||
// The Android EGL loader will call this function in order to determine whether
|
||||
// to use ANGLE instead of a native OpenGL-ES (GLES) driver.
|
||||
//
|
||||
// Parameters:
|
||||
// - rules_fd - File descriptor of the rules file to use
|
||||
// - rules_offset - Offset into the fd before finding the contents of the rules file
|
||||
// - rules_length - length of the rules file content
|
||||
// - appName - Java name of the application (e.g. "com.google.android.apps.maps")
|
||||
// - deviceMfr - Device manufacturer, from the "ro.product.manufacturer"com.google.android"
|
||||
// property
|
||||
// - deviceModel - Device model, from the "ro.product.model"com.google.android" property
|
||||
//
|
||||
ANGLE_EXPORT bool AndroidUseANGLEForApplication(int rules_fd,
|
||||
long rules_offset,
|
||||
long rules_length,
|
||||
const char *appName,
|
||||
const char *deviceMfr,
|
||||
const char *deviceModel);
|
||||
|
||||
/**************************************************************************************************
|
||||
*
|
||||
* The following is the "version 2" private API for the Android EGL loader:
|
||||
|
@ -165,7 +122,7 @@ ANGLE_EXPORT void ANGLEFreeSystemInfoHandle(const SystemInfoHandle systemInfoHan
|
|||
|
||||
// The following are internal versions supported by the current feature-support-utility API.
|
||||
|
||||
constexpr unsigned int kFeatureVersion_LowestSupported = 1;
|
||||
constexpr unsigned int kFeatureVersion_LowestSupported = 2;
|
||||
constexpr unsigned int kFeatureVersion_HighestSupported = 2;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Загрузка…
Ссылка в новой задаче