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

Commit 70311132 authored by Chih-Chung Chang's avatar Chih-Chung Chang Committed by Android (Google) Code Review
Browse files

Merge "Add support for 180/270 degrees rotation."

parents 18b0997a 5994a330
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -55,8 +55,11 @@ public:
    class BufferHeap {
    public:
        enum {
            /* rotate source image 90 degrees */
            /* rotate source image */
            ROT_0     = 0,
            ROT_90    = HAL_TRANSFORM_ROT_90,
            ROT_180   = HAL_TRANSFORM_ROT_180,
            ROT_270   = HAL_TRANSFORM_ROT_270,
        };
        BufferHeap();
        
+14 −5
Original line number Diff line number Diff line
@@ -444,10 +444,19 @@ 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
        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) {