Edit

kc3-lang/angle/src/feature_support_util/feature_support_util.cpp

Branch :

  • Show log

    Commit

  • Author : Ian Elliott
    Date : 2018-08-29 17:04:15
    Hash : abcb2b3b
    Message : 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: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>

  • src/feature_support_util/feature_support_util.cpp
  • //
    // 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