From 389988c42f901f2d8f75a023039d641cf5fba9de Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 11 Jul 2019 17:51:15 +0200 Subject: QColorTransform: make fit for release - Unexport the value class, export only out-of-line public member functions to give us more leeway in changing code later (otherwise, we'd be bound by BC with MSVC debug builds, which call even inline methods from the DLL. - Don't use QSharedPointer as the d_ptr. It's twice the size of a pointer. Use a naked pointer-to-const. Derive Private from QSharedData. This requires some changes in QColorSpace, and, as usual, an out-of-line copy ctor. - Add member-swap(), Q_DECLARE_SHARED(). - Drop noexcept from the dtor. It implicitly is, adding it explicitly looks weird. - Pass QRgb and QRgba64 by value, not by cref. They're trivially-copyable, so passed in registers if passed by value. Passing by cref forces them onto the stack. Change-Id: I669643d219ede6b7d07f15afbf8728e16150b3b2 Reviewed-by: Allan Sandfeld Jensen --- src/gui/image/qimage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui/image/qimage.cpp') diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 61d32b0dec..cd2fe5bc10 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -5067,12 +5067,12 @@ void QImage::applyColorTransform(const QColorTransform &transform) if (depth() > 32) { for (int i = 0; i < height(); ++i) { QRgba64 *scanline = reinterpret_cast(scanLine(i)); - transform.d_func()->apply(scanline, scanline, width(), flags); + transform.d->apply(scanline, scanline, width(), flags); } } else { for (int i = 0; i < height(); ++i) { QRgb *scanline = reinterpret_cast(scanLine(i)); - transform.d_func()->apply(scanline, scanline, width(), flags); + transform.d->apply(scanline, scanline, width(), flags); } } -- cgit v1.2.3