Apply ComposeShader's local matrix to children
Change-Id: Idf9b8e7d7b30f8fcd8ba1fd4bfe8991e9ca148e2
diff --git a/libs/hwui/SkiaShader.cpp b/libs/hwui/SkiaShader.cpp
index 9013fd5..c38eedb 100644
--- a/libs/hwui/SkiaShader.cpp
+++ b/libs/hwui/SkiaShader.cpp
@@ -411,8 +411,14 @@
void SkiaComposeShader::setupProgram(Program* program, const mat4& modelView,
const Snapshot& snapshot, GLuint* textureUnit) {
- mFirst->setupProgram(program, modelView, snapshot, textureUnit);
- mSecond->setupProgram(program, modelView, snapshot, textureUnit);
+ // Apply this compose shader's local transform and pass it down to
+ // the child shaders. They will in turn apply their local transform
+ // to this matrix.
+ mat4 transform;
+ computeScreenSpaceMatrix(transform, modelView);
+
+ mFirst->setupProgram(program, transform, snapshot, textureUnit);
+ mSecond->setupProgram(program, transform, snapshot, textureUnit);
}
}; // namespace uirenderer