Loading services/surfaceflinger/RenderEngine/Android.bp +0 −4 Original line number Diff line number Diff line Loading @@ -20,10 +20,6 @@ cc_defaults { "-DEGL_EGLEXT_PROTOTYPES", ], shared_libs: [ "android.hardware.configstore-utils", "android.hardware.configstore@1.0", "android.hardware.configstore@1.1", "android.hardware.configstore@1.2", "libcutils", "libEGL", "libGLESv1_CM", Loading services/surfaceflinger/RenderEngine/RenderEngine.cpp +2 −15 Original line number Diff line number Diff line Loading @@ -18,8 +18,6 @@ #include <vector> #include <android/hardware/configstore/1.0/ISurfaceFlingerConfigs.h> #include <configstore/Utils.h> #include <log/log.h> #include <private/gui/SyncFeatures.h> #include <renderengine/Image.h> Loading @@ -32,8 +30,6 @@ #include "gl/GLExtensions.h" #include "gl/ProgramCache.h" using namespace android::hardware::configstore; using namespace android::hardware::configstore::V1_0; using namespace android::renderengine::gl; extern "C" EGLAPI const char* eglQueryStringImplementationANDROID(EGLDisplay dpy, EGLint name); Loading Loading @@ -82,7 +78,8 @@ std::unique_ptr<RenderEngine> RenderEngine::create(int hwcFormat, uint32_t featu contextAttributes.reserve(6); contextAttributes.push_back(EGL_CONTEXT_CLIENT_VERSION); contextAttributes.push_back(contextClientVersion); bool useContextPriority = overrideUseContextPriorityFromConfig(extensions.hasContextPriority()); bool useContextPriority = extensions.hasContextPriority() && (featureFlags & RenderEngine::USE_HIGH_PRIORITY_CONTEXT); if (useContextPriority) { contextAttributes.push_back(EGL_CONTEXT_PRIORITY_LEVEL_IMG); contextAttributes.push_back(EGL_CONTEXT_PRIORITY_HIGH_IMG); Loading Loading @@ -141,16 +138,6 @@ std::unique_ptr<RenderEngine> RenderEngine::create(int hwcFormat, uint32_t featu return engine; } bool RenderEngine::overrideUseContextPriorityFromConfig(bool useContextPriority) { OptionalBool ret; ISurfaceFlingerConfigs::getService()->useContextPriority([&ret](OptionalBool b) { ret = b; }); if (ret.specified) { return ret.value; } else { return useContextPriority; } } RenderEngine::RenderEngine(uint32_t featureFlags) : mEGLDisplay(EGL_NO_DISPLAY), mEGLConfig(nullptr), Loading services/surfaceflinger/RenderEngine/include/renderengine/RenderEngine.h +1 −2 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ class RenderEngine { public: enum FeatureFlag { USE_COLOR_MANAGEMENT = 1 << 0, // Device manages color USE_HIGH_PRIORITY_CONTEXT = 1 << 1, // Use high priority context }; virtual ~RenderEngine() = 0; Loading Loading @@ -169,8 +170,6 @@ protected: EGLContext mEGLContext; void setEGLHandles(EGLDisplay display, EGLConfig config, EGLContext ctxt); static bool overrideUseContextPriorityFromConfig(bool useContextPriority); RenderEngine(uint32_t featureFlags); const uint32_t mFeatureFlags; Loading services/surfaceflinger/SurfaceFlinger.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -196,6 +196,7 @@ int64_t SurfaceFlinger::maxFrameBufferAcquiredBuffers; bool SurfaceFlinger::hasWideColorDisplay; int SurfaceFlinger::primaryDisplayOrientation = DisplayState::eOrientationDefault; bool SurfaceFlinger::useColorManagement; bool SurfaceFlinger::useContextPriority; std::string getHwcServiceName() { char value[PROPERTY_VALUE_MAX] = {}; Loading Loading @@ -324,6 +325,9 @@ SurfaceFlinger::SurfaceFlinger() : SurfaceFlinger(SkipInitialization) { useColorManagement = getBool<V1_2::ISurfaceFlingerConfigs, &V1_2::ISurfaceFlingerConfigs::useColorManagement>(false); useContextPriority = getBool<ISurfaceFlingerConfigs, &ISurfaceFlingerConfigs::useContextPriority>(true); V1_1::DisplayOrientation primaryDisplayOrientation = getDisplayOrientation< V1_1::ISurfaceFlingerConfigs, &V1_1::ISurfaceFlingerConfigs::primaryDisplayOrientation>( V1_1::DisplayOrientation::ORIENTATION_0); Loading Loading @@ -645,6 +649,8 @@ void SurfaceFlinger::init() { int32_t renderEngineFeature = 0; renderEngineFeature |= (useColorManagement ? renderengine::RenderEngine::USE_COLOR_MANAGEMENT : 0); renderEngineFeature |= (useContextPriority ? renderengine::RenderEngine::USE_HIGH_PRIORITY_CONTEXT : 0); getBE().mRenderEngine = renderengine::impl::RenderEngine::create(HAL_PIXEL_FORMAT_RGBA_8888, renderEngineFeature); LOG_ALWAYS_FATAL_IF(getBE().mRenderEngine == nullptr, "couldn't create RenderEngine"); Loading services/surfaceflinger/SurfaceFlinger.h +2 −0 Original line number Diff line number Diff line Loading @@ -294,6 +294,8 @@ public: // Indicate if device wants color management on its display. static bool useColorManagement; static bool useContextPriority; static char const* getServiceName() ANDROID_API { return "SurfaceFlinger"; } Loading Loading
services/surfaceflinger/RenderEngine/Android.bp +0 −4 Original line number Diff line number Diff line Loading @@ -20,10 +20,6 @@ cc_defaults { "-DEGL_EGLEXT_PROTOTYPES", ], shared_libs: [ "android.hardware.configstore-utils", "android.hardware.configstore@1.0", "android.hardware.configstore@1.1", "android.hardware.configstore@1.2", "libcutils", "libEGL", "libGLESv1_CM", Loading
services/surfaceflinger/RenderEngine/RenderEngine.cpp +2 −15 Original line number Diff line number Diff line Loading @@ -18,8 +18,6 @@ #include <vector> #include <android/hardware/configstore/1.0/ISurfaceFlingerConfigs.h> #include <configstore/Utils.h> #include <log/log.h> #include <private/gui/SyncFeatures.h> #include <renderengine/Image.h> Loading @@ -32,8 +30,6 @@ #include "gl/GLExtensions.h" #include "gl/ProgramCache.h" using namespace android::hardware::configstore; using namespace android::hardware::configstore::V1_0; using namespace android::renderengine::gl; extern "C" EGLAPI const char* eglQueryStringImplementationANDROID(EGLDisplay dpy, EGLint name); Loading Loading @@ -82,7 +78,8 @@ std::unique_ptr<RenderEngine> RenderEngine::create(int hwcFormat, uint32_t featu contextAttributes.reserve(6); contextAttributes.push_back(EGL_CONTEXT_CLIENT_VERSION); contextAttributes.push_back(contextClientVersion); bool useContextPriority = overrideUseContextPriorityFromConfig(extensions.hasContextPriority()); bool useContextPriority = extensions.hasContextPriority() && (featureFlags & RenderEngine::USE_HIGH_PRIORITY_CONTEXT); if (useContextPriority) { contextAttributes.push_back(EGL_CONTEXT_PRIORITY_LEVEL_IMG); contextAttributes.push_back(EGL_CONTEXT_PRIORITY_HIGH_IMG); Loading Loading @@ -141,16 +138,6 @@ std::unique_ptr<RenderEngine> RenderEngine::create(int hwcFormat, uint32_t featu return engine; } bool RenderEngine::overrideUseContextPriorityFromConfig(bool useContextPriority) { OptionalBool ret; ISurfaceFlingerConfigs::getService()->useContextPriority([&ret](OptionalBool b) { ret = b; }); if (ret.specified) { return ret.value; } else { return useContextPriority; } } RenderEngine::RenderEngine(uint32_t featureFlags) : mEGLDisplay(EGL_NO_DISPLAY), mEGLConfig(nullptr), Loading
services/surfaceflinger/RenderEngine/include/renderengine/RenderEngine.h +1 −2 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ class RenderEngine { public: enum FeatureFlag { USE_COLOR_MANAGEMENT = 1 << 0, // Device manages color USE_HIGH_PRIORITY_CONTEXT = 1 << 1, // Use high priority context }; virtual ~RenderEngine() = 0; Loading Loading @@ -169,8 +170,6 @@ protected: EGLContext mEGLContext; void setEGLHandles(EGLDisplay display, EGLConfig config, EGLContext ctxt); static bool overrideUseContextPriorityFromConfig(bool useContextPriority); RenderEngine(uint32_t featureFlags); const uint32_t mFeatureFlags; Loading
services/surfaceflinger/SurfaceFlinger.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -196,6 +196,7 @@ int64_t SurfaceFlinger::maxFrameBufferAcquiredBuffers; bool SurfaceFlinger::hasWideColorDisplay; int SurfaceFlinger::primaryDisplayOrientation = DisplayState::eOrientationDefault; bool SurfaceFlinger::useColorManagement; bool SurfaceFlinger::useContextPriority; std::string getHwcServiceName() { char value[PROPERTY_VALUE_MAX] = {}; Loading Loading @@ -324,6 +325,9 @@ SurfaceFlinger::SurfaceFlinger() : SurfaceFlinger(SkipInitialization) { useColorManagement = getBool<V1_2::ISurfaceFlingerConfigs, &V1_2::ISurfaceFlingerConfigs::useColorManagement>(false); useContextPriority = getBool<ISurfaceFlingerConfigs, &ISurfaceFlingerConfigs::useContextPriority>(true); V1_1::DisplayOrientation primaryDisplayOrientation = getDisplayOrientation< V1_1::ISurfaceFlingerConfigs, &V1_1::ISurfaceFlingerConfigs::primaryDisplayOrientation>( V1_1::DisplayOrientation::ORIENTATION_0); Loading Loading @@ -645,6 +649,8 @@ void SurfaceFlinger::init() { int32_t renderEngineFeature = 0; renderEngineFeature |= (useColorManagement ? renderengine::RenderEngine::USE_COLOR_MANAGEMENT : 0); renderEngineFeature |= (useContextPriority ? renderengine::RenderEngine::USE_HIGH_PRIORITY_CONTEXT : 0); getBE().mRenderEngine = renderengine::impl::RenderEngine::create(HAL_PIXEL_FORMAT_RGBA_8888, renderEngineFeature); LOG_ALWAYS_FATAL_IF(getBE().mRenderEngine == nullptr, "couldn't create RenderEngine"); Loading
services/surfaceflinger/SurfaceFlinger.h +2 −0 Original line number Diff line number Diff line Loading @@ -294,6 +294,8 @@ public: // Indicate if device wants color management on its display. static bool useColorManagement; static bool useContextPriority; static char const* getServiceName() ANDROID_API { return "SurfaceFlinger"; } Loading