From f6c6a0e700cf4dc4827e991e24d753a07da51c5e Mon Sep 17 00:00:00 2001 From: Hualet Wang Date: Mon, 2 Jul 2018 14:05:20 +0800 Subject: [PATCH] perf(mem): avoid some extra QImage copy Change-Id: I840d35f05177640513ef159b2a2850f96ec7ab6f --- .gitignore | 2 +- frame/item/components/appsnapshot.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index aef026624..a3dabe17f 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,7 @@ build*/ *.pro.user* -CMakeLists.txt.user +CMakeLists.txt.user* *.DS_Store *.qm diff --git a/frame/item/components/appsnapshot.cpp b/frame/item/components/appsnapshot.cpp index d9bff6767..4e0f5dc20 100644 --- a/frame/item/components/appsnapshot.cpp +++ b/frame/item/components/appsnapshot.cpp @@ -148,7 +148,7 @@ void AppSnapshot::fetchSnapshot() m_snapshot = qimage.copy(left, top, width - left - right, height - top - bottom); } else { - m_snapshot = qimage.copy(); + m_snapshot = qimage; } const auto size = rect().marginsRemoved(QMargins(8, 8, 8, 8)).size();