From 02daab6ff28f6a09098c226c30472307686dfb30 Mon Sep 17 00:00:00 2001 From: Stan Iliev Date: Fri, 29 Jun 2018 15:16:11 -0400 Subject: Add a debug property to enable Skia systrace Add a "debug.hwui.skia_atrace_enabled" property that allows to record a systrace with skia drawing ops. App need to be restarted after setting the new propety to true. Test: collected skia trace with systemui Change-Id: I2d1c5911714bfc911894f633ec2df2f6bb953b48 --- libs/hwui/Properties.cpp | 4 ++++ libs/hwui/Properties.h | 5 +++++ 2 files changed, 9 insertions(+) (limited to 'libs') diff --git a/libs/hwui/Properties.cpp b/libs/hwui/Properties.cpp index d284269986d6..0338a3aba97d 100644 --- a/libs/hwui/Properties.cpp +++ b/libs/hwui/Properties.cpp @@ -17,6 +17,7 @@ #include "Properties.h" #include "Debug.h" #include "DeviceInfo.h" +#include "SkTraceEventCommon.h" #include #include @@ -140,6 +141,9 @@ bool Properties::load() { skpCaptureEnabled = debuggingEnabled && property_get_bool(PROPERTY_CAPTURE_SKP_ENABLED, false); + SkAndroidFrameworkTraceUtil::setEnableTracing( + property_get_bool(PROPERTY_SKIA_ATRACE_ENABLED, false)); + runningInEmulator = property_get_bool(PROPERTY_QEMU_KERNEL, false); return (prevDebugLayersUpdates != debugLayersUpdates) || (prevDebugOverdraw != debugOverdraw) || diff --git a/libs/hwui/Properties.h b/libs/hwui/Properties.h index 657f9aa5466e..d640c749d829 100644 --- a/libs/hwui/Properties.h +++ b/libs/hwui/Properties.h @@ -170,6 +170,11 @@ enum DebugLevel { */ #define PROPERTY_CAPTURE_SKP_ENABLED "debug.hwui.capture_skp_enabled" +/** + * Allows to record Skia drawing commands with systrace. + */ +#define PROPERTY_SKIA_ATRACE_ENABLED "debug.hwui.skia_atrace_enabled" + /** * Defines how many frames in a sequence to capture. */ -- cgit v1.2.3-59-g8ed1b