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

Commit 42b86c11 authored by Huihong Luo's avatar Huihong Luo
Browse files

Scale buffer to fit the layer boundary

Skia render engine incorrectly renders garbled video layer, due to lack of scaling to the layer's boundary.

Bug: 171404534
Test: adb root; adb shell setprop debug.renderengine.backend skiagl; adb shell stop; adb shell start
then take a screenshot from playing this video inside web browser with this url: https://www.reddit.com/r/Awww/comments/jjkvdm/if_a_cat_loves_you_sure_you_are_a_lovely_person/

Change-Id: I67da06f384345e300380f34afe1b60cfa2b5fe0b
parent acbb032c
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -560,6 +560,10 @@ status_t SkiaGLRenderEngine::drawLayers(const DisplaySettings& display,
            }
            }


            auto texMatrix = getSkM44(item.textureTransform).asM33();
            auto texMatrix = getSkM44(item.textureTransform).asM33();

            // b/171404534, scale to fix the layer
            matrix.postScale(bounds.getWidth() / bufferWidth, bounds.getHeight() / bufferHeight);

            // textureTansform was intended to be passed directly into a shader, so when
            // textureTansform was intended to be passed directly into a shader, so when
            // building the total matrix with the textureTransform we need to first
            // building the total matrix with the textureTransform we need to first
            // normalize it, then apply the textureTransform, then scale back up.
            // normalize it, then apply the textureTransform, then scale back up.