diff options
Diffstat (limited to 'src/gui/painting/qcompositionfunctions.cpp')
-rw-r--r-- | src/gui/painting/qcompositionfunctions.cpp | 70 |
1 files changed, 17 insertions, 53 deletions
diff --git a/src/gui/painting/qcompositionfunctions.cpp b/src/gui/painting/qcompositionfunctions.cpp index 5a98dfcf29..00fd749fe6 100644 --- a/src/gui/painting/qcompositionfunctions.cpp +++ b/src/gui/painting/qcompositionfunctions.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include <qglobal.h> @@ -433,25 +397,25 @@ struct RgbaFPOperationsSSE2 : public RgbaFPOperationsBase typedef __m128 OptimalType; typedef __m128 OptimalScalar; - static OptimalType load(const Type *ptr) + static OptimalType Q_DECL_VECTORCALL load(const Type *ptr) { - return _mm_load_ps(reinterpret_cast<const float *>(ptr)); + return _mm_loadu_ps(reinterpret_cast<const float *>(ptr)); } - static OptimalType convert(const Type &value) + static OptimalType Q_DECL_VECTORCALL convert(const Type &value) { return load(&value); } - static void store(Type *ptr, OptimalType value) + static void Q_DECL_VECTORCALL store(Type *ptr, OptimalType value) { - _mm_store_ps(reinterpret_cast<float *>(ptr), value); + _mm_storeu_ps(reinterpret_cast<float *>(ptr), value); } - static OptimalType add(OptimalType a, OptimalType b) + static OptimalType Q_DECL_VECTORCALL add(OptimalType a, OptimalType b) { return _mm_add_ps(a, b); } // same as above: // static OptimalScalar add(OptimalScalar a, OptimalScalar b) - static OptimalType plus(OptimalType a, OptimalType b) + static OptimalType Q_DECL_VECTORCALL plus(OptimalType a, OptimalType b) { a = _mm_add_ps(a, b); __m128 aa = _mm_min_ps(a, _mm_set1_ps(1.0f)); @@ -461,37 +425,37 @@ struct RgbaFPOperationsSSE2 : public RgbaFPOperationsBase a = _mm_shuffle_ps(a, aa, _MM_SHUFFLE(0, 2, 1, 0)); return a; } - static OptimalScalar alpha(OptimalType c) + static OptimalScalar Q_DECL_VECTORCALL alpha(OptimalType c) { return _mm_shuffle_ps(c, c, _MM_SHUFFLE(3, 3, 3, 3)); } - static OptimalScalar invAlpha(Scalar c) + static OptimalScalar Q_DECL_VECTORCALL invAlpha(Scalar c) { return _mm_set1_ps(1.0f - float(c)); } - static OptimalScalar invAlpha(OptimalType c) + static OptimalScalar Q_DECL_VECTORCALL invAlpha(OptimalType c) { return _mm_sub_ps(_mm_set1_ps(1.0f), alpha(c)); } - static OptimalScalar scalar(Scalar n) + static OptimalScalar Q_DECL_VECTORCALL scalar(Scalar n) { return _mm_set1_ps(float(n)); } - static OptimalType multiplyAlpha(OptimalType val, OptimalScalar a) + static OptimalType Q_DECL_VECTORCALL multiplyAlpha(OptimalType val, OptimalScalar a) { return _mm_mul_ps(val, a); } - static OptimalType interpolate(OptimalType x, OptimalScalar a1, OptimalType y, OptimalScalar a2) + static OptimalType Q_DECL_VECTORCALL interpolate(OptimalType x, OptimalScalar a1, OptimalType y, OptimalScalar a2) { return add(multiplyAlpha(x, a1), multiplyAlpha(y, a2)); } - static OptimalType multiplyAlpha8bit(OptimalType val, uint8_t a) + static OptimalType Q_DECL_VECTORCALL multiplyAlpha8bit(OptimalType val, uint8_t a) { return multiplyAlpha(val, _mm_set1_ps(a * (1.0f / 255.0f))); } // same as above: // static OptimalScalar multiplyAlpha8bit(OptimalScalar a, uint8_t a) - static OptimalType interpolate8bit(OptimalType x, uint8_t a1, OptimalType y, uint8_t a2) + static OptimalType Q_DECL_VECTORCALL interpolate8bit(OptimalType x, uint8_t a1, OptimalType y, uint8_t a2) { return add(multiplyAlpha8bit(x, a1), multiplyAlpha8bit(y, a2)); } |