Loading libs/input/TouchVideoFrame.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -43,13 +43,13 @@ const struct timeval& TouchVideoFrame::getTimestamp() const { return mTimestamp; void TouchVideoFrame::rotate(int32_t orientation) { void TouchVideoFrame::rotate(int32_t orientation) { switch (orientation) { switch (orientation) { case DISPLAY_ORIENTATION_90: case DISPLAY_ORIENTATION_90: rotateQuarterTurn(true /*clockwise*/); rotateQuarterTurn(false /*clockwise*/); break; break; case DISPLAY_ORIENTATION_180: case DISPLAY_ORIENTATION_180: rotate180(); rotate180(); break; break; case DISPLAY_ORIENTATION_270: case DISPLAY_ORIENTATION_270: rotateQuarterTurn(false /*clockwise*/); rotateQuarterTurn(true /*clockwise*/); break; break; } } } } Loading libs/input/tests/TouchVideoFrame_test.cpp +4 −4 Original line number Original line Diff line number Diff line Loading @@ -86,14 +86,14 @@ TEST(TouchVideoFrame, Rotate90_1x1) { TEST(TouchVideoFrame, Rotate90_2x2) { TEST(TouchVideoFrame, Rotate90_2x2) { TouchVideoFrame frame(2, 2, {1, 2, 3, 4}, TIMESTAMP); TouchVideoFrame frame(2, 2, {1, 2, 3, 4}, TIMESTAMP); TouchVideoFrame frameRotated(2, 2, {3, 1, 4, 2}, TIMESTAMP); TouchVideoFrame frameRotated(2, 2, {2, 4, 1, 3}, TIMESTAMP); frame.rotate(DISPLAY_ORIENTATION_90); frame.rotate(DISPLAY_ORIENTATION_90); ASSERT_EQ(frame, frameRotated); ASSERT_EQ(frame, frameRotated); } } TEST(TouchVideoFrame, Rotate90_3x2) { TEST(TouchVideoFrame, Rotate90_3x2) { TouchVideoFrame frame(3, 2, {1, 2, 3, 4, 5, 6}, TIMESTAMP); TouchVideoFrame frame(3, 2, {1, 2, 3, 4, 5, 6}, TIMESTAMP); TouchVideoFrame frameRotated(2, 3, {5, 3, 1, 6, 4, 2}, TIMESTAMP); TouchVideoFrame frameRotated(2, 3, {2, 4, 6, 1, 3, 5}, TIMESTAMP); frame.rotate(DISPLAY_ORIENTATION_90); frame.rotate(DISPLAY_ORIENTATION_90); ASSERT_EQ(frame, frameRotated); ASSERT_EQ(frame, frameRotated); } } Loading Loading @@ -171,14 +171,14 @@ TEST(TouchVideoFrame, Rotate270_1x1) { TEST(TouchVideoFrame, Rotate270_2x2) { TEST(TouchVideoFrame, Rotate270_2x2) { TouchVideoFrame frame(2, 2, {1, 2, 3, 4}, TIMESTAMP); TouchVideoFrame frame(2, 2, {1, 2, 3, 4}, TIMESTAMP); TouchVideoFrame frameRotated(2, 2, {2, 4, 1, 3}, TIMESTAMP); TouchVideoFrame frameRotated(2, 2, {3, 1, 4, 2}, TIMESTAMP); frame.rotate(DISPLAY_ORIENTATION_270); frame.rotate(DISPLAY_ORIENTATION_270); ASSERT_EQ(frame, frameRotated); ASSERT_EQ(frame, frameRotated); } } TEST(TouchVideoFrame, Rotate270_3x2) { TEST(TouchVideoFrame, Rotate270_3x2) { TouchVideoFrame frame(3, 2, {1, 2, 3, 4, 5, 6}, TIMESTAMP); TouchVideoFrame frame(3, 2, {1, 2, 3, 4, 5, 6}, TIMESTAMP); TouchVideoFrame frameRotated(2, 3, {2, 4, 6, 1, 3, 5}, TIMESTAMP); TouchVideoFrame frameRotated(2, 3, {5, 3, 1, 6, 4, 2}, TIMESTAMP); frame.rotate(DISPLAY_ORIENTATION_270); frame.rotate(DISPLAY_ORIENTATION_270); ASSERT_EQ(frame, frameRotated); ASSERT_EQ(frame, frameRotated); } } Loading Loading
libs/input/TouchVideoFrame.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -43,13 +43,13 @@ const struct timeval& TouchVideoFrame::getTimestamp() const { return mTimestamp; void TouchVideoFrame::rotate(int32_t orientation) { void TouchVideoFrame::rotate(int32_t orientation) { switch (orientation) { switch (orientation) { case DISPLAY_ORIENTATION_90: case DISPLAY_ORIENTATION_90: rotateQuarterTurn(true /*clockwise*/); rotateQuarterTurn(false /*clockwise*/); break; break; case DISPLAY_ORIENTATION_180: case DISPLAY_ORIENTATION_180: rotate180(); rotate180(); break; break; case DISPLAY_ORIENTATION_270: case DISPLAY_ORIENTATION_270: rotateQuarterTurn(false /*clockwise*/); rotateQuarterTurn(true /*clockwise*/); break; break; } } } } Loading
libs/input/tests/TouchVideoFrame_test.cpp +4 −4 Original line number Original line Diff line number Diff line Loading @@ -86,14 +86,14 @@ TEST(TouchVideoFrame, Rotate90_1x1) { TEST(TouchVideoFrame, Rotate90_2x2) { TEST(TouchVideoFrame, Rotate90_2x2) { TouchVideoFrame frame(2, 2, {1, 2, 3, 4}, TIMESTAMP); TouchVideoFrame frame(2, 2, {1, 2, 3, 4}, TIMESTAMP); TouchVideoFrame frameRotated(2, 2, {3, 1, 4, 2}, TIMESTAMP); TouchVideoFrame frameRotated(2, 2, {2, 4, 1, 3}, TIMESTAMP); frame.rotate(DISPLAY_ORIENTATION_90); frame.rotate(DISPLAY_ORIENTATION_90); ASSERT_EQ(frame, frameRotated); ASSERT_EQ(frame, frameRotated); } } TEST(TouchVideoFrame, Rotate90_3x2) { TEST(TouchVideoFrame, Rotate90_3x2) { TouchVideoFrame frame(3, 2, {1, 2, 3, 4, 5, 6}, TIMESTAMP); TouchVideoFrame frame(3, 2, {1, 2, 3, 4, 5, 6}, TIMESTAMP); TouchVideoFrame frameRotated(2, 3, {5, 3, 1, 6, 4, 2}, TIMESTAMP); TouchVideoFrame frameRotated(2, 3, {2, 4, 6, 1, 3, 5}, TIMESTAMP); frame.rotate(DISPLAY_ORIENTATION_90); frame.rotate(DISPLAY_ORIENTATION_90); ASSERT_EQ(frame, frameRotated); ASSERT_EQ(frame, frameRotated); } } Loading Loading @@ -171,14 +171,14 @@ TEST(TouchVideoFrame, Rotate270_1x1) { TEST(TouchVideoFrame, Rotate270_2x2) { TEST(TouchVideoFrame, Rotate270_2x2) { TouchVideoFrame frame(2, 2, {1, 2, 3, 4}, TIMESTAMP); TouchVideoFrame frame(2, 2, {1, 2, 3, 4}, TIMESTAMP); TouchVideoFrame frameRotated(2, 2, {2, 4, 1, 3}, TIMESTAMP); TouchVideoFrame frameRotated(2, 2, {3, 1, 4, 2}, TIMESTAMP); frame.rotate(DISPLAY_ORIENTATION_270); frame.rotate(DISPLAY_ORIENTATION_270); ASSERT_EQ(frame, frameRotated); ASSERT_EQ(frame, frameRotated); } } TEST(TouchVideoFrame, Rotate270_3x2) { TEST(TouchVideoFrame, Rotate270_3x2) { TouchVideoFrame frame(3, 2, {1, 2, 3, 4, 5, 6}, TIMESTAMP); TouchVideoFrame frame(3, 2, {1, 2, 3, 4, 5, 6}, TIMESTAMP); TouchVideoFrame frameRotated(2, 3, {2, 4, 6, 1, 3, 5}, TIMESTAMP); TouchVideoFrame frameRotated(2, 3, {5, 3, 1, 6, 4, 2}, TIMESTAMP); frame.rotate(DISPLAY_ORIENTATION_270); frame.rotate(DISPLAY_ORIENTATION_270); ASSERT_EQ(frame, frameRotated); ASSERT_EQ(frame, frameRotated); } } Loading