From 99bcdc52dcb365ed7d8cfa13540fb33fbcbbac9d Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Wed, 13 Oct 2010 15:17:00 -0700 Subject: [PATCH] Return identity matrix when rendering in an FBO. Change-Id: I57438e745b30c8cfe16c269f3cafcd719049d705 --- libs/hwui/OpenGLRenderer.cpp | 5 ++++- libs/hwui/OpenGLRenderer.h | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 92875b18c22e1..d81760d96c83c 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -585,7 +585,10 @@ void OpenGLRenderer::setMatrix(SkMatrix* matrix) { } const float* OpenGLRenderer::getMatrix() const { - return &mSnapshot->transform->data[0]; + if (mSnapshot->fbo != 0) { + return &mSnapshot->transform->data[0]; + } + return &mIdentity.data[0]; } void OpenGLRenderer::getMatrix(SkMatrix* matrix) { diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h index f8828e2cbd7fb..423614bb3e3c1 100644 --- a/libs/hwui/OpenGLRenderer.h +++ b/libs/hwui/OpenGLRenderer.h @@ -432,6 +432,9 @@ private: // Misc GLint mMaxTextureSize; + // Indentity matrix + const mat4 mIdentity; + friend class DisplayListRenderer; }; // class OpenGLRenderer