Remove unused CGImage in qcocoabackingstore
Since 916dfcb827 m_cgImage has been unsed
in the QCocoaBackingStore and can be removed.
Change-Id: Ib289b1a3b848e05dda2dfc76ca5d857770883a0b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
bb10
parent
05e0dfa006
commit
a09e67c2f7
|
|
@ -58,7 +58,6 @@ public:
|
|||
|
||||
private:
|
||||
QImage m_qImage;
|
||||
CGImageRef m_cgImage;
|
||||
QSize m_requestedSize;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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<QCocoaWindow *>(win->handle()))
|
||||
[cocoaWindow->m_qtView flushBackingStore:this region:region offset:offset];
|
||||
|
|
|
|||
Loading…
Reference in New Issue