From a09e67c2f7a796ec66c217fc25b2b8cd45812591 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 24 Feb 2015 12:08:34 +0100 Subject: [PATCH] Remove unused CGImage in qcocoabackingstore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since 916dfcb8275bcce6b39606cd0b930239a60dc5df m_cgImage has been unsed in the QCocoaBackingStore and can be removed. Change-Id: Ib289b1a3b848e05dda2dfc76ca5d857770883a0b Reviewed-by: Morten Johan Sørvig Reviewed-by: Timur Pocheptsov --- src/plugins/platforms/cocoa/qcocoabackingstore.h | 1 - src/plugins/platforms/cocoa/qcocoabackingstore.mm | 15 --------------- 2 files changed, 16 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoabackingstore.h b/src/plugins/platforms/cocoa/qcocoabackingstore.h index 15445faca0..d012ede5f9 100644 --- a/src/plugins/platforms/cocoa/qcocoabackingstore.h +++ b/src/plugins/platforms/cocoa/qcocoabackingstore.h @@ -58,7 +58,6 @@ public: private: QImage m_qImage; - CGImageRef m_cgImage; QSize m_requestedSize; }; diff --git a/src/plugins/platforms/cocoa/qcocoabackingstore.mm b/src/plugins/platforms/cocoa/qcocoabackingstore.mm index a90db00d42..cddb960197 100644 --- a/src/plugins/platforms/cocoa/qcocoabackingstore.mm +++ b/src/plugins/platforms/cocoa/qcocoabackingstore.mm @@ -39,14 +39,11 @@ QT_BEGIN_NAMESPACE QCocoaBackingStore::QCocoaBackingStore(QWindow *window) : QPlatformBackingStore(window) - , m_cgImage(0) { } QCocoaBackingStore::~QCocoaBackingStore() { - CGImageRelease(m_cgImage); - m_cgImage = 0; } QPaintDevice *QCocoaBackingStore::paintDevice() @@ -58,9 +55,6 @@ QPaintDevice *QCocoaBackingStore::paintDevice() // either due to a window resize or devicePixelRatio change. QSize effectiveBufferSize = m_requestedSize * windowDevicePixelRatio; if (m_qImage.size() != effectiveBufferSize) { - CGImageRelease(m_cgImage); - m_cgImage = 0; - QImage::Format format = (window()->format().hasAlpha() || cocoaWindow->m_drawContentBorderGradient) ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32; m_qImage = QImage(effectiveBufferSize, format); @@ -73,15 +67,6 @@ QPaintDevice *QCocoaBackingStore::paintDevice() void QCocoaBackingStore::flush(QWindow *win, const QRegion ®ion, const QPoint &offset) { - // A flush means that qImage has changed. Since CGImages are seen as - // immutable, CoreImage fails to pick up this change for m_cgImage - // (since it usually cached), so we must recreate it. We await doing this - // until one of the views needs it, since, together with calling - // "setNeedsDisplayInRect" instead of "displayRect" we will, in most - // cases, get away with doing this once for every repaint. Also note that - // m_cgImage is only a reference to the data inside m_qImage, it is not a copy. - CGImageRelease(m_cgImage); - m_cgImage = 0; if (!m_qImage.isNull()) { if (QCocoaWindow *cocoaWindow = static_cast(win->handle())) [cocoaWindow->m_qtView flushBackingStore:this region:region offset:offset];