Hash :
fdbdb2b2
Author :
Date :
2018-11-01T17:47:10
Enhance ANGLE for Android Developer Options Update ANGLE Developer Options Update ANGLE developer options to allow selecting the OpenGL driver (default, ANGLE, native) for each app as well as forcing ANGLE for all apps. Bug: angleproject:2962 Test: Verify the default/ANGLE/native values are saved and applied and used by the loader. Change-Id: I6041e7e49ca5cc65f90fc8ae6f1b084e4639d769 Reviewed-on: https://chromium-review.googlesource.com/c/1330315 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
//
// Copyright 2018 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// feature_support_util.h: Internal-to-ANGLE header file for feature-support utilities.
#ifndef FEATURE_SUPPORT_UTIL_H_
#define FEATURE_SUPPORT_UTIL_H_
#include "angle_feature_support_util.h"
#ifdef __cplusplus
extern "C" {
#endif
// The following are internal versions supported by the current feature-support-utility API.
constexpr unsigned int kFeatureVersion_LowestSupported = 0;
constexpr unsigned int kFeatureVersion_HighestSupported = 1;
// The following is the "version 0" external interface that the Android EGL loader used. It is
// deprecated and will soon be obsoleted. It was never declared in the shared header file.
// TODO(ianelliott@google.com angleproject:2801): Revisit this enum. Make it
// strongly typed, and look at renaming it and its values.
typedef enum ANGLEPreference
{
ANGLE_PREFER_DEFAULT = 0,
ANGLE_PREFER_NATIVE = 1,
ANGLE_PREFER_ANGLE = 2,
} ANGLEPreference;
// 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:
// - 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
// - developerOption - Whether the "Developer Options" setting was set, and if so, how
// - appPreference - Whether the application expressed a preference, and if so, how
//
// TODO(ianelliott@google.com angleproject:2801): Revisit this function
// name/interface. Look at generalizing it and making it more "feature"
// oriented.
ANGLE_EXPORT bool ANGLEUseForApplication(const char *appName,
const char *deviceMfr,
const char *deviceModel,
ANGLEPreference developerOption,
ANGLEPreference appPreference);
#ifdef __cplusplus
} // extern "C"
#endif
#endif // FEATURE_SUPPORT_UTIL_H_