From fda3aee5b7b17bc64e66e1f6f7aaa7d2e3ac1419 Mon Sep 17 00:00:00 2001 From: Siarhei Vishniakou Date: Fri, 15 Feb 2019 17:10:53 -0600 Subject: Swap width and height in TouchVideoFrame Currently in TouchVideoFrame and related code, the field 'width' precedes the field 'height'. But these fields should be interpreted as follows: width -> number of columns height -> number of rows In most notations in mathematics, the matrix sizes are designated as 'mxn', where m is the number of rows and n is the number of columns. So we make TouchVideoFrame consistent with this, and swap these 2 fields. Test: atest libinput_tests The actual test is added in the next commit. Bug: 123241238 Change-Id: I808e7f354bd7b62d5599324eef205bf4450a91c1 --- libs/input/TouchVideoFrame.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'libs/input/TouchVideoFrame.cpp') diff --git a/libs/input/TouchVideoFrame.cpp b/libs/input/TouchVideoFrame.cpp index 2c47fdf36f..35cb4a73ea 100644 --- a/libs/input/TouchVideoFrame.cpp +++ b/libs/input/TouchVideoFrame.cpp @@ -18,23 +18,23 @@ namespace android { -TouchVideoFrame::TouchVideoFrame(uint32_t width, uint32_t height, std::vector data, +TouchVideoFrame::TouchVideoFrame(uint32_t height, uint32_t width, std::vector data, const struct timeval& timestamp) : - mWidth(width), mHeight(height), mData(std::move(data)), mTimestamp(timestamp) { + mHeight(height), mWidth(width),mData(std::move(data)), mTimestamp(timestamp) { } bool TouchVideoFrame::operator==(const TouchVideoFrame& rhs) const { - return mWidth == rhs.mWidth - && mHeight == rhs.mHeight + return mHeight == rhs.mHeight + && mWidth == rhs.mWidth && mData == rhs.mData && mTimestamp.tv_sec == rhs.mTimestamp.tv_sec && mTimestamp.tv_usec == rhs.mTimestamp.tv_usec; } -uint32_t TouchVideoFrame::getWidth() const { return mWidth; } - uint32_t TouchVideoFrame::getHeight() const { return mHeight; } +uint32_t TouchVideoFrame::getWidth() const { return mWidth; } + const std::vector& TouchVideoFrame::getData() const { return mData; } const struct timeval& TouchVideoFrame::getTimestamp() const { return mTimestamp; } -- cgit v1.2.3-59-g8ed1b