Commit abcb2b3b by Ian Elliott Committed by Commit Bot

Add stubs for A4A opt-in library.

Bug: angleproject:2794 Change-Id: I9ba8abf5fdac4a1bae24bc78ece62337d24e903b Reviewed-on: https://chromium-review.googlesource.com/1196043 Commit-Queue: Ian Elliott <ianelliott@google.com> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 97dbf436
......@@ -223,6 +223,33 @@ static_library("angle_image_util") {
]
}
config("angle_feature_support_util_config") {
include_dirs = [
"include",
"src",
]
defines = [ "LIBANGLE_UTIL_IMPLEMENTATION" ]
}
static_library("angle_feature_support_util") {
sources = [
"src/feature_support_util/feature_support_util.cpp",
"src/feature_support_util/feature_support_util.h",
]
configs -= angle_undefine_configs
configs += [
":internal_config",
":extra_warnings",
]
public_configs = [ ":angle_feature_support_util_config" ]
public_deps = [
":angle_common",
]
}
config("angle_gpu_info_util_config") {
include_dirs = [
"include",
......@@ -466,6 +493,7 @@ static_library("libANGLE") {
":angle_common",
]
deps = [
":angle_feature_support_util",
":angle_gpu_info_util",
":angle_image_util",
":commit_id",
......
//
// 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.cpp: Implementation of the code that helps the Android EGL loader
// determine whether to use ANGLE or a native GLES driver.
#include "feature_support_util.h"
#ifdef __cplusplus
extern "C" {
#endif
ANGLE_EXPORT bool ANGLEUseForApplication(const char *appName,
const char *deviceMfr,
const char *deviceModel,
ANGLEPreference developerOption,
ANGLEPreference appPreference)
{
if (developerOption != ANGLE_NO_PREFERENCE)
{
return (developerOption == ANGLE_PREFER_ANGLE);
}
else if ((appPreference != ANGLE_NO_PREFERENCE) && false /*rules allow app to choose*/)
{
return (appPreference == ANGLE_PREFER_ANGLE);
}
else
{
return false /*whatever the rules come up with*/;
}
}
#ifdef __cplusplus
} // extern "C"
#endif
//
// 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.cpp: Helps Android EGL loader to determine whether to use ANGLE or a native
// GLES driver. Can be extended in the future for more-general feature selection.
#ifndef FEATURE_SUPPORT_UTIL_H_
#define FEATURE_SUPPORT_UTIL_H_
#include "export.h"
#ifdef __cplusplus
extern "C" {
#endif
// 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_NO_PREFERENCE = 0,
ANGLE_PREFER_NATIVE = 1,
ANGLE_PREFER_ANGLE = 2,
} ANGLEPreference;
// 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_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment