diff options
| author | 2010-01-22 16:30:39 -0800 | |
|---|---|---|
| committer | 2010-01-22 16:30:39 -0800 | |
| commit | 5994a330ac949e7706540f22cd73d76d9f2a96cb (patch) | |
| tree | 46250601cda14ac8a44572be4566a8ac0869701d /libs/surfaceflinger/LayerBase.cpp | |
| parent | 32f6863e218e19f8a3daab7e345bb4ae6587865a (diff) | |
Add support for 180/270 degrees rotation.
Diffstat (limited to 'libs/surfaceflinger/LayerBase.cpp')
| -rw-r--r-- | libs/surfaceflinger/LayerBase.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/libs/surfaceflinger/LayerBase.cpp b/libs/surfaceflinger/LayerBase.cpp index 17db6f4573..4d7bef8da7 100644 --- a/libs/surfaceflinger/LayerBase.cpp +++ b/libs/surfaceflinger/LayerBase.cpp @@ -444,12 +444,21 @@ void LayerBase::drawWithOpenGL(const Region& clip, const Texture& texture) const glLoadIdentity(); // the texture's source is rotated - if (texture.transform == HAL_TRANSFORM_ROT_90) { - // TODO: handle the other orientations - glTranslatef(0, 1, 0); - glRotatef(-90, 0, 0, 1); + switch (texture.transform) { + case HAL_TRANSFORM_ROT_90: + glTranslatef(0, 1, 0); + glRotatef(-90, 0, 0, 1); + break; + case HAL_TRANSFORM_ROT_180: + glTranslatef(1, 1, 0); + glRotatef(-180, 0, 0, 1); + break; + case HAL_TRANSFORM_ROT_270: + glTranslatef(1, 0, 0); + glRotatef(-270, 0, 0, 1); + break; } - + if (texture.NPOTAdjust) { glScalef(texture.wScale, texture.hScale, 1.0f); } |