Loading graphics/java/android/graphics/HardwareRenderer.java +3 −0 Original line number Diff line number Diff line Loading @@ -1195,6 +1195,7 @@ public class HardwareRenderer { // so not checking for isolated process here. initHintSession(); nSetIsHighEndGfx(ActivityManager.isHighEndGfx()); // Defensively clear out the context in case we were passed a context that can leak // if we live longer than it, e.g. an activity context. mContext = null; Loading Loading @@ -1315,6 +1316,8 @@ public class HardwareRenderer { private static native void nSetSdrWhitePoint(long nativeProxy, float whitePoint); private static native void nSetIsHighEndGfx(boolean isHighEndGfx); private static native int nSyncAndDrawFrame(long nativeProxy, long[] frameInfo, int size); private static native void nDestroy(long nativeProxy, long rootRenderNode); Loading libs/hwui/DamageAccumulator.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -157,7 +157,7 @@ static inline void applyMatrix(const SkMatrix& transform, SkRect* rect) { static inline void mapRect(const RenderProperties& props, const SkRect& in, SkRect* out) { if (in.isEmpty()) return; SkRect temp(in); if (Properties::stretchEffectBehavior == StretchEffectBehavior::UniformScale) { if (Properties::getStretchEffectBehavior() == StretchEffectBehavior::UniformScale) { const StretchEffect& stretch = props.layerProperties().getStretchEffect(); if (!stretch.isEmpty()) { applyMatrix(stretch.makeLinearStretch(props.getWidth(), props.getHeight()), &temp); Loading libs/hwui/Properties.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -137,10 +137,6 @@ bool Properties::load() { targetCpuTimePercentage = base::GetIntProperty(PROPERTY_TARGET_CPU_TIME_PERCENTAGE, 70); if (targetCpuTimePercentage <= 0 || targetCpuTimePercentage > 100) targetCpuTimePercentage = 70; int stretchType = base::GetIntProperty(PROPERTY_STRETCH_EFFECT_TYPE, 0); stretchType = std::clamp(stretchType, 0, static_cast<int>(StretchEffectBehavior::UniformScale)); stretchEffectBehavior = static_cast<StretchEffectBehavior>(stretchType); return (prevDebugLayersUpdates != debugLayersUpdates) || (prevDebugOverdraw != debugOverdraw); } Loading libs/hwui/Properties.h +18 −3 Original line number Diff line number Diff line Loading @@ -171,8 +171,6 @@ enum DebugLevel { */ #define PROPERTY_TARGET_CPU_TIME_PERCENTAGE "debug.hwui.target_cpu_time_percent" #define PROPERTY_STRETCH_EFFECT_TYPE "debug.hwui.stretch_mode" /** * Property for whether this is running in the emulator. */ Loading Loading @@ -278,9 +276,26 @@ public: static bool useHintManager; static int targetCpuTimePercentage; static StretchEffectBehavior stretchEffectBehavior; static StretchEffectBehavior getStretchEffectBehavior() { return stretchEffectBehavior; } static void setIsHighEndGfx(bool isHighEndGfx) { stretchEffectBehavior = isHighEndGfx ? StretchEffectBehavior::ShaderHWUI : StretchEffectBehavior::UniformScale; } /** * Used for testing. Typical configuration of stretch behavior is done * through setIsHighEndGfx */ static void setStretchEffectBehavior(StretchEffectBehavior behavior) { stretchEffectBehavior = behavior; } private: static StretchEffectBehavior stretchEffectBehavior; static ProfileType sProfileType; static bool sDisableProfileBars; static RenderPipelineType sRenderPipelineType; Loading libs/hwui/RenderNode.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -478,7 +478,7 @@ void RenderNode::applyViewPropertyTransforms(mat4& matrix, bool true3dTransform) } } if (Properties::stretchEffectBehavior == StretchEffectBehavior::UniformScale) { if (Properties::getStretchEffectBehavior() == StretchEffectBehavior::UniformScale) { const StretchEffect& stretch = properties().layerProperties().getStretchEffect(); if (!stretch.isEmpty()) { matrix.multiply( Loading Loading
graphics/java/android/graphics/HardwareRenderer.java +3 −0 Original line number Diff line number Diff line Loading @@ -1195,6 +1195,7 @@ public class HardwareRenderer { // so not checking for isolated process here. initHintSession(); nSetIsHighEndGfx(ActivityManager.isHighEndGfx()); // Defensively clear out the context in case we were passed a context that can leak // if we live longer than it, e.g. an activity context. mContext = null; Loading Loading @@ -1315,6 +1316,8 @@ public class HardwareRenderer { private static native void nSetSdrWhitePoint(long nativeProxy, float whitePoint); private static native void nSetIsHighEndGfx(boolean isHighEndGfx); private static native int nSyncAndDrawFrame(long nativeProxy, long[] frameInfo, int size); private static native void nDestroy(long nativeProxy, long rootRenderNode); Loading
libs/hwui/DamageAccumulator.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -157,7 +157,7 @@ static inline void applyMatrix(const SkMatrix& transform, SkRect* rect) { static inline void mapRect(const RenderProperties& props, const SkRect& in, SkRect* out) { if (in.isEmpty()) return; SkRect temp(in); if (Properties::stretchEffectBehavior == StretchEffectBehavior::UniformScale) { if (Properties::getStretchEffectBehavior() == StretchEffectBehavior::UniformScale) { const StretchEffect& stretch = props.layerProperties().getStretchEffect(); if (!stretch.isEmpty()) { applyMatrix(stretch.makeLinearStretch(props.getWidth(), props.getHeight()), &temp); Loading
libs/hwui/Properties.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -137,10 +137,6 @@ bool Properties::load() { targetCpuTimePercentage = base::GetIntProperty(PROPERTY_TARGET_CPU_TIME_PERCENTAGE, 70); if (targetCpuTimePercentage <= 0 || targetCpuTimePercentage > 100) targetCpuTimePercentage = 70; int stretchType = base::GetIntProperty(PROPERTY_STRETCH_EFFECT_TYPE, 0); stretchType = std::clamp(stretchType, 0, static_cast<int>(StretchEffectBehavior::UniformScale)); stretchEffectBehavior = static_cast<StretchEffectBehavior>(stretchType); return (prevDebugLayersUpdates != debugLayersUpdates) || (prevDebugOverdraw != debugOverdraw); } Loading
libs/hwui/Properties.h +18 −3 Original line number Diff line number Diff line Loading @@ -171,8 +171,6 @@ enum DebugLevel { */ #define PROPERTY_TARGET_CPU_TIME_PERCENTAGE "debug.hwui.target_cpu_time_percent" #define PROPERTY_STRETCH_EFFECT_TYPE "debug.hwui.stretch_mode" /** * Property for whether this is running in the emulator. */ Loading Loading @@ -278,9 +276,26 @@ public: static bool useHintManager; static int targetCpuTimePercentage; static StretchEffectBehavior stretchEffectBehavior; static StretchEffectBehavior getStretchEffectBehavior() { return stretchEffectBehavior; } static void setIsHighEndGfx(bool isHighEndGfx) { stretchEffectBehavior = isHighEndGfx ? StretchEffectBehavior::ShaderHWUI : StretchEffectBehavior::UniformScale; } /** * Used for testing. Typical configuration of stretch behavior is done * through setIsHighEndGfx */ static void setStretchEffectBehavior(StretchEffectBehavior behavior) { stretchEffectBehavior = behavior; } private: static StretchEffectBehavior stretchEffectBehavior; static ProfileType sProfileType; static bool sDisableProfileBars; static RenderPipelineType sRenderPipelineType; Loading
libs/hwui/RenderNode.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -478,7 +478,7 @@ void RenderNode::applyViewPropertyTransforms(mat4& matrix, bool true3dTransform) } } if (Properties::stretchEffectBehavior == StretchEffectBehavior::UniformScale) { if (Properties::getStretchEffectBehavior() == StretchEffectBehavior::UniformScale) { const StretchEffect& stretch = properties().layerProperties().getStretchEffect(); if (!stretch.isEmpty()) { matrix.multiply( Loading