Merge "Update profiling properties"

This commit is contained in:
Romain Guy
2013-01-07 11:20:19 -08:00
committed by Android (Google) Code Review

View File

@@ -88,26 +88,22 @@ public abstract class HardwareRenderer {
* *
* Possible values: * Possible values:
* "true", to enable profiling * "true", to enable profiling
* "visual", to enable profiling and visualize the results on screen
* "false", to disable profiling * "false", to disable profiling
* *
* @see #PROFILE_PROPERTY_VISUALIZE
*
* @hide * @hide
*/ */
public static final String PROFILE_PROPERTY = "debug.hwui.profile"; public static final String PROFILE_PROPERTY = "debug.hwui.profile";
/** /**
* System property used to enable or disable hardware rendering profiling * Value for {@link #PROFILE_PROPERTY}. When the property is set to this
* visualization. The default value of this property is assumed to be false. * value, profiling data will be visualized on screen.
*
* This property is only taken into account when {@link #PROFILE_PROPERTY} is
* turned on.
*
* Possible values:
* "true", to enable on screen profiling
* "false", to disable on screen profiling
* *
* @hide * @hide
*/ */
public static final String PROFILE_VISUALIZER_PROPERTY = "debug.hwui.profile_visualizer"; public static final String PROFILE_PROPERTY_VISUALIZE = "visual";
/** /**
* System property used to specify the number of frames to be used * System property used to specify the number of frames to be used
@@ -694,9 +690,26 @@ public abstract class HardwareRenderer {
@Override @Override
boolean loadSystemProperties(Surface surface) { boolean loadSystemProperties(Surface surface) {
boolean value;
boolean changed = false; boolean changed = false;
boolean value = SystemProperties.getBoolean(PROFILE_PROPERTY, false); String profiling = SystemProperties.get(PROFILE_PROPERTY);
value = PROFILE_PROPERTY_VISUALIZE.equalsIgnoreCase(profiling);
if (value != mProfileVisualizerEnabled) {
changed = true;
mProfileVisualizerEnabled = value;
mProfileRects = null;
mProfilePaint = null;
}
// If on-screen profiling is not enabled, we need to check whether
// console profiling only is enabled
if (!value) {
value = Boolean.parseBoolean(profiling);
}
if (value != mProfileEnabled) { if (value != mProfileEnabled) {
changed = true; changed = true;
mProfileEnabled = value; mProfileEnabled = value;
@@ -723,15 +736,6 @@ public abstract class HardwareRenderer {
mProfilePaint = null; mProfilePaint = null;
} }
value = SystemProperties.getBoolean(PROFILE_VISUALIZER_PROPERTY, false);
if (value != mProfileVisualizerEnabled) {
changed = true;
mProfileVisualizerEnabled = value;
mProfileRects = null;
mProfilePaint = null;
}
value = SystemProperties.getBoolean(DEBUG_DIRTY_REGIONS_PROPERTY, false); value = SystemProperties.getBoolean(DEBUG_DIRTY_REGIONS_PROPERTY, false);
if (value != mDebugDirtyRegions) { if (value != mDebugDirtyRegions) {
changed = true; changed = true;