Read prop for Skia tracing after boot
Mendel sets the sysprop after RenderEngine has been created, but before
boot finishes. Delay reading the sysprop until boot has finished so it
will get the correct value.
Rather thatn calling into Skia directly from SurfaceFlinger, pass the
boolean to RenderEngine, which now has an API that is implemented by
SkiaRenderEngine to turn on tracing inside Skia. This also allows us to
call the thread-unsafe method from the right thread.
Use FlagManager, which follows the normal path for setting Mendel flags
in SurfaceFlinger.
Bug: 204205165
Test: manual
Change-Id: Iba93ad6a4b51e336019a1c91dbfd10baafb6576f
diff --git a/libs/renderengine/skia/SkiaRenderEngine.cpp b/libs/renderengine/skia/SkiaRenderEngine.cpp
index 29175a2..1fb24f5 100644
--- a/libs/renderengine/skia/SkiaRenderEngine.cpp
+++ b/libs/renderengine/skia/SkiaRenderEngine.cpp
@@ -20,15 +20,15 @@
#include "SkiaRenderEngine.h"
-#include <android-base/properties.h>
#include <src/core/SkTraceEventCommon.h>
namespace android {
namespace renderengine {
namespace skia {
-SkiaRenderEngine::SkiaRenderEngine(RenderEngineType type) : RenderEngine(type) {
- SkAndroidFrameworkTraceUtil::setEnableTracing(
- base::GetBoolProperty(PROPERTY_SKIA_ATRACE_ENABLED, false));
+SkiaRenderEngine::SkiaRenderEngine(RenderEngineType type) : RenderEngine(type) {}
+
+void SkiaRenderEngine::setEnableTracing(bool tracingEnabled) {
+ SkAndroidFrameworkTraceUtil::setEnableTracing(tracingEnabled);
}
} // namespace skia
} // namespace renderengine