Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a429ff13 authored by John Reck's avatar John Reck Committed by Automerger Merge Worker
Browse files

Merge "Add some more scenes, replace linear with uniform" into sc-dev am: f5c29811 am: a1a460e2

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14509696

Change-Id: Ie84d25ea856d606cc8cb2c23fb2e8d260d50c57b
parents c53c0a5d a1a460e2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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::LinearScale) {
    if (Properties::stretchEffectBehavior == StretchEffectBehavior::UniformScale) {
        const StretchEffect& stretch = props.layerProperties().getStretchEffect();
        if (!stretch.isEmpty()) {
            applyMatrix(stretch.makeLinearStretch(props.getWidth(), props.getHeight()), &temp);
+1 −1
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@ bool Properties::load() {
    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::LinearScale));
    stretchType = std::clamp(stretchType, 0, static_cast<int>(StretchEffectBehavior::UniformScale));
    stretchEffectBehavior = static_cast<StretchEffectBehavior>(stretchType);

    return (prevDebugLayersUpdates != debugLayersUpdates) || (prevDebugOverdraw != debugOverdraw);
+3 −3
Original line number Diff line number Diff line
@@ -202,7 +202,7 @@ enum class RenderPipelineType { SkiaGL, SkiaVulkan, NotInitialized = 128 };
enum class StretchEffectBehavior {
    ShaderHWUI,   // Stretch shader in HWUI only, matrix scale in SF
    Shader,       // Stretch shader in both HWUI and SF
    LinearScale // Linear stretch everywhere
    UniformScale  // Uniform scale stretch everywhere
};

/**
+1 −1
Original line number Diff line number Diff line
@@ -478,7 +478,7 @@ void RenderNode::applyViewPropertyTransforms(mat4& matrix, bool true3dTransform)
        }
    }

    if (Properties::stretchEffectBehavior == StretchEffectBehavior::LinearScale) {
    if (Properties::stretchEffectBehavior == StretchEffectBehavior::UniformScale) {
        const StretchEffect& stretch = properties().layerProperties().getStretchEffect();
        if (!stretch.isEmpty()) {
            matrix.multiply(
+1 −1
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ public:

    bool requiresLayer() const {
        return !(isEmpty() ||
                 Properties::stretchEffectBehavior == StretchEffectBehavior::LinearScale);
                 Properties::stretchEffectBehavior == StretchEffectBehavior::UniformScale);
    }

private:
Loading