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

Commit b09f1471 authored by Romain Guy's avatar Romain Guy
Browse files

Don't apply scale to glyphs when a perspective is set.

Bug #8337925

Magazines uses very large scale factors that blow up font cache & CPU.

Change-Id: I1c0ed430ed91b86cc6c6f59f7e8bdcc89a464e46
parent 8afce816
Loading
Loading
Loading
Loading
+1 −10
Original line number Diff line number Diff line
@@ -2633,16 +2633,7 @@ mat4 OpenGLRenderer::findBestFontTransform(const mat4& transform) const {
        fontTransform = mat4::identity();
    } else {
        if (CC_UNLIKELY(transform.isPerspective())) {
            // When the below condition is true, we are rendering text with a
            // perspective transform inside a layer (either an inline layer
            // created by Canvas.saveLayer() or a hardware layer.)
            if (hasLayer() || getTargetFbo() != 0) {
                float sx, sy;
                currentTransform().decomposeScale(sx, sy);
                fontTransform.loadScale(sx, sy, 1.0f);
            } else {
            fontTransform = mat4::identity();
            }
        } else {
            float sx, sy;
            currentTransform().decomposeScale(sx, sy);