Add an API to set the transform on a TextureView's surface texture.
Bug #5156689
Change-Id: I635a625885c9b832a60d44ece0de7613ceb84109
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 4864cff..a0f806a 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -627,6 +627,12 @@
void OpenGLRenderer::drawTextureLayer(Layer* layer, const Rect& rect) {
float alpha = layer->getAlpha() / 255.0f;
+ mat4& transform = layer->getTransform();
+ if (!transform.isIdentity()) {
+ save(0);
+ mSnapshot->transform->multiply(transform);
+ }
+
setupDraw();
if (layer->getRenderTarget() == GL_TEXTURE_2D) {
setupDrawWithTexture();
@@ -663,6 +669,10 @@
glDrawArrays(GL_TRIANGLE_STRIP, 0, gMeshCount);
finishDrawTexture();
+
+ if (!transform.isIdentity()) {
+ restore();
+ }
}
void OpenGLRenderer::composeLayerRect(Layer* layer, const Rect& rect, bool swap) {