summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJinhyung Jo <jinhyung.jo@samsung.com>2016-10-05 15:15:30 +0900
committerJinhyung Jo <jinhyung.jo@samsung.com>2016-10-06 19:59:54 +0900
commit71d39cb8c22781add76c426664320be46225b042 (patch)
treea340603ecb4ffbf18dfa569bc4950d3a0860ae2e
parentd9569bc324b6ae1dfa6fb63b7ab106faf12958cc (diff)
downloadqemu-71d39cb8c22781add76c426664320be46225b042.tar.gz
qemu-71d39cb8c22781add76c426664320be46225b042.tar.bz2
qemu-71d39cb8c22781add76c426664320be46225b042.zip
display: change QMatrix to QTransform
QMatrix class that we use for 2D transformation is obsolete. QTransform is the recommended transformation class in Qt. Change-Id: Ib4361575ac8fc519c4947ad927b3fa58b506a3a3 Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
-rw-r--r--tizen/src/ui/mainwindow.cpp18
-rw-r--r--tizen/src/ui/mainwindow.h6
-rw-r--r--tizen/src/ui/qt5_supplement.cpp2
-rw-r--r--tizen/src/ui/skinpainter.cpp7
4 files changed, 16 insertions, 17 deletions
diff --git a/tizen/src/ui/mainwindow.cpp b/tizen/src/ui/mainwindow.cpp
index 7737da1d66..04936100a4 100644
--- a/tizen/src/ui/mainwindow.cpp
+++ b/tizen/src/ui/mainwindow.cpp
@@ -97,7 +97,7 @@ MainWindow::MainWindow(UiInformation *uiInfo, QWidget *parent) :
}
/* display */
- updateDisplayMatrix();
+ updateDisplayTransform();
display = createDisplay(uiInfo->getMainFormDpyType());
/* set HW Key shortcut */
@@ -211,9 +211,9 @@ UIState *MainWindow::getUiState()
return uiInfo->getUiState();
}
-const QMatrix &MainWindow::getDisplayMatrix()
+const QTransform &MainWindow::getDisplayTransform()
{
- return dpyMatrix;
+ return dpyTransform;
}
MainView *MainWindow::getMainView()
@@ -412,12 +412,12 @@ void MainWindow::setMask(const QRegion &region)
}
}
-void MainWindow::updateDisplayMatrix()
+void MainWindow::updateDisplayTransform()
{
- dpyMatrix.reset();
- dpyMatrix.scale(
+ dpyTransform.reset();
+ dpyTransform.scale(
getUiState()->getScaleFactor(), getUiState()->getScaleFactor());
- dpyMatrix.rotate(uiInfo->getMainFormDpyType()->getAngle());
+ dpyTransform.rotate(uiInfo->getMainFormDpyType()->getAngle());
}
void MainWindow::switchForm(int index)
@@ -436,7 +436,7 @@ void MainWindow::switchForm(int index)
/* register new HW key shortcuts */
keyboardShortcut->registerHwKeyShortcuts(uiInfo->getMainForm()->getKeyList());
- updateDisplayMatrix();
+ updateDisplayTransform();
if (getDockingCon() != NULL) {
getDockingCon()->updateGeometry();
@@ -467,7 +467,7 @@ void MainWindow::scaleForm(int scale)
/* scale changing */
getUiState()->setScalePct(scale);
- updateDisplayMatrix();
+ updateDisplayTransform();
if (getDockingCon() != NULL) {
getDockingCon()->updateGeometry();
diff --git a/tizen/src/ui/mainwindow.h b/tizen/src/ui/mainwindow.h
index 183aeb337c..b83ff7ea65 100644
--- a/tizen/src/ui/mainwindow.h
+++ b/tizen/src/ui/mainwindow.h
@@ -58,14 +58,14 @@ public:
UiInformation *getUiInfo(void);
UIState *getUiState(void);
- const QMatrix &getDisplayMatrix();
+ const QTransform &getDisplayTransform();
MainView *getMainView();
ContextMenu *getPopupMenu();
DisplayBase *getDisplay();
KeyboardShortcut *getKeyboardShortcut();
QLabel *getScreenWidget();
- void updateDisplayMatrix();
+ void updateDisplayTransform();
void switchForm(int angle);
void scaleForm(int scale);
void capture(void);
@@ -105,7 +105,7 @@ private:
UiInformation *uiInfo;
/* windowing */
- QMatrix dpyMatrix;
+ QTransform dpyTransform;
QGraphicsScene *mainScene;
MainView *mainView;
DisplayBase *display;
diff --git a/tizen/src/ui/qt5_supplement.cpp b/tizen/src/ui/qt5_supplement.cpp
index 33c68a49f9..00dec85f97 100644
--- a/tizen/src/ui/qt5_supplement.cpp
+++ b/tizen/src/ui/qt5_supplement.cpp
@@ -493,7 +493,7 @@ void qt5_update_internal(void *data, int width, int height)
mainwindow->getScreenWidget()->setPixmap(QPixmap::fromImage(
image.convertToFormat(QImage::Format_RGB32).transformed(
- mainwindow->getDisplayMatrix(), Qt::SmoothTransformation)));
+ mainwindow->getDisplayTransform(), Qt::SmoothTransformation)));
}
void qt5_switch_internal(void)
diff --git a/tizen/src/ui/skinpainter.cpp b/tizen/src/ui/skinpainter.cpp
index 0dac529d34..2c2bb3d3dc 100644
--- a/tizen/src/ui/skinpainter.cpp
+++ b/tizen/src/ui/skinpainter.cpp
@@ -88,12 +88,11 @@ void SkinPainter::drawSkin(QString patchPath, QSize center, int degree,
painter.drawEllipse(tagLeftTop, COLOR_TAG_SIZE, COLOR_TAG_SIZE);
/* rotate */
- QMatrix matrix;
- matrix.rotate(degree);
- skin = new QPixmap(image.transformed(matrix));
+ QTransform transform;
+ skin = new QPixmap(image.transformed(transform.rotate(degree)));
centeralRect = QRect(
- centeralRect0.topLeft(), matrix.mapRect(centeralRect0).size());
+ centeralRect0.topLeft(), transform.mapRect(centeralRect0).size());
}
QImage SkinPainter::getSkinImage() const