[SurfaceFlinger] Hide SyncFeatures behind RenderEngine
This allows a future test that uses BufferLayerConsumer as-is and does
not actually set up a GL context to work by adding call expectations to
RenderEngine for what sync configuration should be used.
SyncFeatures is a singleton, and makes a bunch of GL queries when first
constructed to determine what is supported by the GL driver. It made
most sense to me to hide this inside the RenderEngine for that reason.
Test: Builds
Bug: None
Change-Id: Ic62bfb689a84fd9e509139c7f189223cf215277e
diff --git a/services/surfaceflinger/RenderEngine/RenderEngine.cpp b/services/surfaceflinger/RenderEngine/RenderEngine.cpp
index 0b8b838..39f7e30 100644
--- a/services/surfaceflinger/RenderEngine/RenderEngine.cpp
+++ b/services/surfaceflinger/RenderEngine/RenderEngine.cpp
@@ -29,6 +29,7 @@
#include <android/hardware/configstore/1.0/ISurfaceFlingerConfigs.h>
#include <configstore/Utils.h>
+#include <private/gui/SyncFeatures.h>
using namespace android::hardware::configstore;
using namespace android::hardware::configstore::V1_0;
@@ -175,6 +176,14 @@
return mEGLConfig;
}
+bool RenderEngine::useNativeFenceSync() const {
+ return SyncFeatures::getInstance().useNativeFenceSync();
+}
+
+bool RenderEngine::useWaitSync() const {
+ return SyncFeatures::getInstance().useWaitSync();
+}
+
bool RenderEngine::isCurrent() const {
return mEGLDisplay == eglGetCurrentDisplay() && mEGLContext == eglGetCurrentContext();
}