From e9235c91724913a2cf3153d7e47b963917e51677 Mon Sep 17 00:00:00 2001 From: Tsu Jan Date: Wed, 24 Aug 2022 04:25:58 +0430 Subject: [PATCH] Enabled the new decoration blurring of KWin --- CMakeLists.txt | 22 +- ChangeLog | 4 + NEWS | 2 +- README.md | 2 + breezedecoration.cpp | 243 ++++++++++++++++---- breezedecoration.h | 2 + breezesizegrip.cpp | 4 + config/breezedetectwidget.cpp | 6 +- config/breezeexceptiondialog.cpp | 4 + config/breezeexceptiondialog.h | 2 +- config/breezeexceptionlistwidget.cpp | 1 + config/breezeitemmodel.h | 2 +- libbreezecommon/CMakeLists.txt | 2 +- libbreezecommon/breezeboxshadowrenderer.cpp | 26 +-- libbreezecommon/breezeboxshadowrenderer.h | 1 - 15 files changed, 245 insertions(+), 78 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 462929b..0557bd9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_SOURCE_DIR}/cmake) set(QT_MIN_VERSION "5.15.0") -set(KF5_MIN_VERSION "5.82") +set(KF5_MIN_VERSION "5.90") include(ECMInstallIcons) include(KDEInstallDirs) @@ -33,7 +33,7 @@ add_definitions(-DTRANSLATION_DOMAIN="breeze_kwin_deco") #find_package(KF5 REQUIRED COMPONENTS CoreAddons GuiAddons ConfigWidgets WindowSystem I18n IconThemes) find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS CoreAddons GuiAddons ConfigWidgets WindowSystem I18n) -find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS DBus) +find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS DBus) ### XCB find_package(XCB COMPONENTS XCB) @@ -47,7 +47,7 @@ set_package_properties(XCB PROPERTIES if(UNIX AND NOT APPLE) set(BREEZE_HAVE_X11 ${XCB_XCB_FOUND}) - if (XCB_XCB_FOUND) + if (XCB_XCB_FOUND AND TARGET Qt5::Core) find_package(Qt5 REQUIRED CONFIG COMPONENTS X11Extras) endif() @@ -117,14 +117,16 @@ target_link_libraries(breezeenhanced KF5::WindowSystem) if(BREEZE_HAVE_X11) - target_link_libraries(breezeenhanced - PUBLIC - Qt::X11Extras - XCB::XCB) + target_link_libraries(breezeenhanced PUBLIC XCB::XCB) + if (TARGET Qt5::X11Extras) + target_link_libraries(breezeenhanced PUBLIC Qt5::X11Extras) + else () + target_link_libraries(breezeenhanced PUBLIC Qt6::GuiPrivate) + endif() endif() install(TARGETS breezeenhanced DESTINATION ${KDE_INSTALL_PLUGINDIR}/org.kde.kdecoration2) -install(FILES config/breezeenhancedconfig.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}) -# install(TARGETS breezedecoration DESTINATION ${PLUGIN_INSTALL_DIR}/org.kde.kdecoration2) -# install(FILES config/breezedecorationconfig.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}) +install(FILES config/breezeenhancedconfig.desktop DESTINATION ${KDE_INSTALL_KSERVICESDIR}) +#install(TARGETS breezedecoration DESTINATION ${KDE_INSTALL_PLUGINDIR}/org.kde.kdecoration2) +#install(FILES config/breezedecorationconfig.desktop DESTINATION ${KDE_INSTALL_KSERVICESDIR}) diff --git a/ChangeLog b/ChangeLog index 8302680..f396dd4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +V5.25 +--------- + * Enabled the new decoration blurring of KWin (without "blur glitches"). + V5.24 --------- * Bumped the version to 5.24 and silenced compilation warnings. diff --git a/NEWS b/NEWS index 470cd68..302961e 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,5 @@ Latest version: - 22 Feb 2022, V5.24 + 24 Aug 2022, V5.25 See "ChangeLog" for changes. diff --git a/README.md b/README.md index 9164106..017212d 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ Needless to say, the main work behind BreezeEnhanced is the Breeze KWin decorati The version number in the file [NEWS](NEWS) shows the main version of KWin that is required for the compilation. *Compilation should not be done against other versions of KWin!* +In what follows, it is supposed that the name of the installation directory of KDE libraries is `lib` and the installation prefix is `/usr`. If they are different in your distro, please replace them! + Open a terminal inside the source directory and do: ```sh mkdir build && cd build diff --git a/breezedecoration.cpp b/breezedecoration.cpp index acf3fcd..00e3630 100644 --- a/breezedecoration.cpp +++ b/breezedecoration.cpp @@ -33,19 +33,22 @@ #include #include -#include #include -#include +#include #include +#include #include #include #include -#include #if BREEZE_HAVE_X11 +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include +#else #include #endif +#endif #include @@ -236,6 +239,7 @@ namespace Breeze // a change in font might cause the borders to change recalculateBorders(); + resetBlurRegion(); connect(s.data(), &KDecoration2::DecorationSettings::spacingChanged, this, &Decoration::recalculateBorders); // buttons @@ -252,6 +256,7 @@ namespace Breeze connect(c.data(), &KDecoration2::DecoratedClient::maximizedHorizontallyChanged, this, &Decoration::recalculateBorders); connect(c.data(), &KDecoration2::DecoratedClient::maximizedVerticallyChanged, this, &Decoration::recalculateBorders); connect(c.data(), &KDecoration2::DecoratedClient::shadedChanged, this, &Decoration::recalculateBorders); + connect(c.data(), &KDecoration2::DecoratedClient::captionChanged, this, [this]() { @@ -270,6 +275,18 @@ namespace Breeze connect(c.data(), &KDecoration2::DecoratedClient::adjacentScreenEdgesChanged, this, &Decoration::updateButtonsGeometry); connect(c.data(), &KDecoration2::DecoratedClient::shadedChanged, this, &Decoration::updateButtonsGeometry); + connect(s.data(), &KDecoration2::DecorationSettings::borderSizeChanged, this, &Decoration::resetBlurRegion); + connect(s.data(), &KDecoration2::DecorationSettings::spacingChanged, this, &Decoration::resetBlurRegion); + connect(c.data(), &KDecoration2::DecoratedClient::adjacentScreenEdgesChanged, this, &Decoration::resetBlurRegion); + connect(c.data(), &KDecoration2::DecoratedClient::maximizedHorizontallyChanged, this, &Decoration::resetBlurRegion); + connect(c.data(), &KDecoration2::DecoratedClient::maximizedVerticallyChanged, this, &Decoration::resetBlurRegion); + connect(c.data(), &KDecoration2::DecoratedClient::maximizedChanged, this, &Decoration::resetBlurRegion); + connect(c.data(), &KDecoration2::DecoratedClient::shadedChanged, this, &Decoration::resetBlurRegion); + connect(c.data(), &KDecoration2::DecoratedClient::widthChanged, this, &Decoration::resetBlurRegion); + connect(c.data(), &KDecoration2::DecoratedClient::heightChanged, this, [this]() { + if (!hasNoSideBorders()) resetBlurRegion(); + }); + createButtons(); createShadow(); } @@ -364,6 +381,9 @@ namespace Breeze // borders recalculateBorders(); + // blur region + resetBlurRegion(); + // shadow createShadow(); @@ -422,6 +442,135 @@ namespace Breeze setResizeOnlyBorders(QMargins(extSides, 0, extSides, extBottom)); } + //________________________________________________________________ + void Decoration::resetBlurRegion() + { + // NOTE: "BlurEffect::decorationBlurRegion()" will consider the intersection of + // the blur and decoration regions. Here we need to focus on corner rounding. + + if (titleBarAlpha() == 255 || !settings()->isAlphaChannelSupported()) + { // no blurring without translucency + setBlurRegion(QRegion()); + return; + } + + QRegion region; + const auto c = client().toStrongRef(); + QSize rSize(m_scaledCornerRadius, m_scaledCornerRadius); + + if (!c->isShaded() && !isMaximized() && !hasNoBorders()) + { + // exclude the titlebar + int topBorder = hideTitleBar() ? 0 : borderTop(); + QRect rect(0, topBorder, size().width(), size().height() - topBorder); + + QRegion vert(QRect(rect.topLeft() + QPoint(m_scaledCornerRadius, 0), + QSize(rect.width() - 2*m_scaledCornerRadius, rect.height()))); + QRegion topLeft, topRight, bottomLeft, bottomRight, horiz; + if (hasBorders()) + { + if (hideTitleBar()) + { + topLeft = QRegion(QRect(rect.topLeft(), 2*rSize), + isLeftEdge() ? QRegion::Rectangle : QRegion::Ellipse); + topRight = QRegion(QRect(rect.topLeft() + QPoint(rect.width() - 2*m_scaledCornerRadius, 0), + 2*rSize), + isRightEdge() ? QRegion::Rectangle : QRegion::Ellipse); + horiz = QRegion(QRect(rect.topLeft() + QPoint(0, m_scaledCornerRadius), + QSize(rect.width(), rect.height() - 2*m_scaledCornerRadius))); + } + else + { // "horiz" is at the top because the titlebar is excluded + horiz = QRegion(QRect(rect.topLeft(), + QSize(rect.width(), rect.height() - m_scaledCornerRadius))); + } + bottomLeft = QRegion(QRect(rect.topLeft() + QPoint(0, rect.height() - 2*m_scaledCornerRadius), + 2*rSize), + isLeftEdge() && isBottomEdge() ? QRegion::Rectangle : QRegion::Ellipse); + bottomRight = QRegion(QRect(rect.topLeft() + QPoint(rect.width() - 2*m_scaledCornerRadius, + rect.height() - 2*m_scaledCornerRadius), + 2*rSize), + isRightEdge() && isBottomEdge() ? QRegion::Rectangle : QRegion::Ellipse); + } + else // no side border + { + horiz = QRegion(QRect(rect.topLeft(), + QSize(rect.width(), rect.height() - m_scaledCornerRadius))); + bottomLeft = QRegion(QRect(rect.topLeft() + QPoint(0, rect.height() - 2*m_scaledCornerRadius), + 2*rSize), + isBottomEdge() ? QRegion::Rectangle : QRegion::Ellipse); + bottomRight = QRegion(QRect(rect.topLeft() + QPoint(rect.width() - 2*m_scaledCornerRadius, + rect.height() - 2*m_scaledCornerRadius), + 2*rSize), + isBottomEdge() ? QRegion::Rectangle : QRegion::Ellipse); + } + + region = topLeft + .united(topRight) + .united(bottomLeft) + .united(bottomRight) + .united(horiz) + .united(vert); + + if (hideTitleBar()) + { + setBlurRegion(region); + return; + } + } + + const QRect titleRect(QPoint(0, 0), QSize(size().width(), borderTop())); + + // add the titlebar + if (m_scaledCornerRadius == 0 + || isMaximized()) // maximized + no border when maximized + { + region |= QRegion(titleRect); + } + else if (c->isShaded()) + { + QRegion topLeft(QRect(titleRect.topLeft(), 2*rSize), QRegion::Ellipse); + QRegion topRight(QRect(titleRect.topLeft() + QPoint(titleRect.width() - 2*m_scaledCornerRadius, 0), + 2*rSize), + QRegion::Ellipse); + QRegion bottomLeft(QRect(titleRect.topLeft() + QPoint(0, titleRect.height() - 2*m_scaledCornerRadius), + 2*rSize), + QRegion::Ellipse); + QRegion bottomRight(QRect(titleRect.topLeft() + QPoint(titleRect.width() - 2*m_scaledCornerRadius, + titleRect.height() - 2*m_scaledCornerRadius), + 2*rSize), + QRegion::Ellipse); + region = topLeft + .united(topRight) + .united(bottomLeft) + .united(bottomRight) + // vertical + .united(QRect(titleRect.topLeft() + QPoint(m_scaledCornerRadius, 0), + QSize(titleRect.width() - 2*m_scaledCornerRadius, titleRect.height()))) + // horizontal + .united(QRect(titleRect.topLeft() + QPoint(0, m_scaledCornerRadius), + QSize(titleRect.width(), titleRect.height() - 2*m_scaledCornerRadius))); + } + else + { + QRegion topLeft(QRect(titleRect.topLeft(), 2*rSize), + isLeftEdge() || isTopEdge() ? QRegion::Rectangle : QRegion::Ellipse); + QRegion topRight(QRect(titleRect.topLeft() + QPoint(titleRect.width() - 2*m_scaledCornerRadius, 0), + 2*rSize), + isRightEdge() || isTopEdge() ? QRegion::Rectangle : QRegion::Ellipse); + region |= topLeft + .united(topRight) + // vertical + .united(QRect(titleRect.topLeft() + QPoint(m_scaledCornerRadius, 0), + QSize(titleRect.width() - 2*m_scaledCornerRadius, titleRect.height()))) + // horizontal + .united(QRect(titleRect.topLeft() + QPoint(0, m_scaledCornerRadius), + QSize(titleRect.width(), titleRect.height() - m_scaledCornerRadius))); + } + + setBlurRegion(region); + } + //________________________________________________________________ void Decoration::createButtons() { @@ -509,7 +658,7 @@ namespace Breeze auto s = settings(); // paint background - if( !c->isShaded() ) + if(!c->isShaded()) { painter->fillRect(rect(), Qt::transparent); painter->save(); @@ -521,26 +670,28 @@ namespace Breeze painter->setBrush(winCol); // clip away the top part - if( !hideTitleBar() ) painter->setClipRect(0, borderTop(), size().width(), size().height() - borderTop(), Qt::IntersectClip); + if(!hideTitleBar()) + painter->setClipRect(0, borderTop(), size().width(), size().height() - borderTop(), Qt::IntersectClip); - if( s->isAlphaChannelSupported() ) painter->drawRoundedRect(rect(), m_scaledCornerRadius, m_scaledCornerRadius); - else painter->drawRect( rect() ); + if(s->isAlphaChannelSupported()) + painter->drawRoundedRect(rect(), m_scaledCornerRadius, m_scaledCornerRadius); + else + painter->drawRect(rect()); painter->restore(); } - if( !hideTitleBar() ) paintTitleBar(painter, repaintRegion); + if(!hideTitleBar()) paintTitleBar(painter, repaintRegion); - if( hasBorders() && !s->isAlphaChannelSupported() ) + if(hasBorders() && !s->isAlphaChannelSupported()) { painter->save(); painter->setRenderHint(QPainter::Antialiasing, false); - painter->setBrush( Qt::NoBrush ); - painter->setPen( c->isActive() ? - c->color( ColorGroup::Active, ColorRole::TitleBar ): - c->color( ColorGroup::Inactive, ColorRole::Foreground ) ); + painter->setBrush(Qt::NoBrush); + painter->setPen(c->isActive() ? c->color(ColorGroup::Active, ColorRole::TitleBar) + : c->color(ColorGroup::Inactive, ColorRole::Foreground)); - painter->drawRect( rect().adjusted( 0, 0, -1, -1 ) ); + painter->drawRect(rect().adjusted(0, 0, -1, -1 )); painter->restore(); } @@ -552,64 +703,60 @@ namespace Breeze const auto c = client().toStrongRef(); const QRect titleRect(QPoint(0, 0), QSize(size().width(), borderTop())); - if ( !titleRect.intersects(repaintRegion) ) return; + if (!titleRect.intersects(repaintRegion)) return; painter->save(); painter->setPen(Qt::NoPen); // render a linear gradient on title area and draw a light border at the top - if( m_internalSettings->drawBackgroundGradient() && !flatTitleBar() ) + if(m_internalSettings->drawBackgroundGradient() && !flatTitleBar()) { - - QColor titleBarColor( this->titleBarColor() ); + QColor titleBarColor(this->titleBarColor()); titleBarColor.setAlpha(titleBarAlpha()); - QLinearGradient gradient( 0, 0, 0, titleRect.height() ); - QColor lightCol( titleBarColor.lighter( 130 + m_internalSettings->backgroundGradientIntensity() ) ); - gradient.setColorAt(0.0, lightCol ); + QLinearGradient gradient(0, 0, 0, titleRect.height()); + QColor lightCol(titleBarColor.lighter(130 + m_internalSettings->backgroundGradientIntensity())); + gradient.setColorAt(0.0, lightCol); gradient.setColorAt(0.99 / static_cast(titleRect.height()), lightCol ); - gradient.setColorAt(1.0 / static_cast(titleRect.height()), titleBarColor.lighter( 100 + m_internalSettings->backgroundGradientIntensity() ) ); + gradient.setColorAt(1.0 / static_cast(titleRect.height()), + titleBarColor.lighter(100 + m_internalSettings->backgroundGradientIntensity())); gradient.setColorAt(1.0, titleBarColor); painter->setBrush(gradient); - - } else { - - QColor titleBarColor = this->titleBarColor(); + } + else + { + QColor titleBarColor(this->titleBarColor()); titleBarColor.setAlpha(titleBarAlpha()); - QLinearGradient gradient( 0, 0, 0, titleRect.height() ); - QColor lightCol( titleBarColor.lighter( 130 ) ); - gradient.setColorAt(0.0, lightCol ); - gradient.setColorAt(0.99 / static_cast(titleRect.height()), lightCol ); - gradient.setColorAt(1.0 / static_cast(titleRect.height()), titleBarColor ); + QLinearGradient gradient(0, 0, 0, titleRect.height()); + QColor lightCol(titleBarColor.lighter(130)); + gradient.setColorAt(0.0, lightCol); + gradient.setColorAt(0.99 / static_cast(titleRect.height()), lightCol); + gradient.setColorAt(1.0 / static_cast(titleRect.height()), titleBarColor); gradient.setColorAt(1.0, titleBarColor); - painter->setBrush( gradient ); - + painter->setBrush(gradient); } auto s = settings(); - if( isMaximized() || !s->isAlphaChannelSupported() ) + if(isMaximized() || !s->isAlphaChannelSupported()) { - painter->drawRect(titleRect); - - } else if( c->isShaded() ) { - + } + else if(c->isShaded()) + { painter->drawRoundedRect(titleRect, m_scaledCornerRadius, m_scaledCornerRadius); - - } else { - + } + else + { painter->setClipRect(titleRect, Qt::IntersectClip); - // the rect is made a little bit larger to be able to clip away the rounded corners at the bottom and sides - painter->drawRoundedRect(titleRect.adjusted( - isLeftEdge() ? -m_scaledCornerRadius:0, - isTopEdge() ? -m_scaledCornerRadius:0, - isRightEdge() ? m_scaledCornerRadius:0, - m_scaledCornerRadius), - m_scaledCornerRadius, m_scaledCornerRadius); + painter->drawRoundedRect(titleRect.adjusted(isLeftEdge() ? -m_scaledCornerRadius :0, + isTopEdge() ? -m_scaledCornerRadius :0, + isRightEdge() ? m_scaledCornerRadius :0, + m_scaledCornerRadius), + m_scaledCornerRadius, m_scaledCornerRadius); } diff --git a/breezedecoration.h b/breezedecoration.h index 5eef31e..1c68e3c 100644 --- a/breezedecoration.h +++ b/breezedecoration.h @@ -31,6 +31,7 @@ #include #include +#include class QVariantAnimation; @@ -103,6 +104,7 @@ namespace Breeze private Q_SLOTS: void reconfigure(); void recalculateBorders(); + void resetBlurRegion(); void updateButtonsGeometry(); void updateButtonsGeometryDelayed(); void updateTitleBar(); diff --git a/breezesizegrip.cpp b/breezesizegrip.cpp index 3d47f5d..d1471eb 100644 --- a/breezesizegrip.cpp +++ b/breezesizegrip.cpp @@ -27,8 +27,12 @@ #include #if BREEZE_HAVE_X11 +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include +#else #include #endif +#endif namespace Breeze { diff --git a/config/breezedetectwidget.cpp b/config/breezedetectwidget.cpp index c57f9bf..3316a25 100644 --- a/config/breezedetectwidget.cpp +++ b/config/breezedetectwidget.cpp @@ -33,11 +33,15 @@ #include -#include #include +#include #include #if BREEZE_HAVE_X11 +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include +#else #include +#endif #include #endif diff --git a/config/breezeexceptiondialog.cpp b/config/breezeexceptiondialog.cpp index c225274..8def732 100644 --- a/config/breezeexceptiondialog.cpp +++ b/config/breezeexceptiondialog.cpp @@ -28,8 +28,12 @@ #include "config-breeze.h" #if BREEZE_HAVE_X11 +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include +#else #include #endif +#endif namespace Breeze { diff --git a/config/breezeexceptiondialog.h b/config/breezeexceptiondialog.h index 9846ff2..7c53b48 100644 --- a/config/breezeexceptiondialog.h +++ b/config/breezeexceptiondialog.h @@ -63,7 +63,7 @@ namespace Breeze Q_SIGNALS: - //* emmited when changed + //* emitted when changed void changed( bool ); protected: diff --git a/config/breezeexceptionlistwidget.cpp b/config/breezeexceptionlistwidget.cpp index 15d3711..77b08d0 100644 --- a/config/breezeexceptionlistwidget.cpp +++ b/config/breezeexceptionlistwidget.cpp @@ -87,6 +87,7 @@ namespace Breeze InternalSettingsList ExceptionListWidget::exceptions() { return model().get(); + setChanged( false ); } //__________________________________________________________ diff --git a/config/breezeitemmodel.h b/config/breezeitemmodel.h index 3af4ab3..150493b 100644 --- a/config/breezeitemmodel.h +++ b/config/breezeitemmodel.h @@ -73,7 +73,7 @@ namespace Breeze void privateSort() { privateSort( m_sortColumn, m_sortOrder ); } - //* private sort, with no signals emmitted + //* private sort, with no signals emitted virtual void privateSort( int column, Qt::SortOrder order ) = 0; //* used to sort items in list diff --git a/libbreezecommon/CMakeLists.txt b/libbreezecommon/CMakeLists.txt index 41c2d75..12df033 100644 --- a/libbreezecommon/CMakeLists.txt +++ b/libbreezecommon/CMakeLists.txt @@ -1,6 +1,6 @@ ################# dependencies ################# ### Qt/KDE -find_package(Qt5 REQUIRED CONFIG COMPONENTS Widgets) +find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED CONFIG COMPONENTS Widgets) ################# breezestyle target ################# set(breezeenhancedcommon_LIB_SRCS diff --git a/libbreezecommon/breezeboxshadowrenderer.cpp b/libbreezecommon/breezeboxshadowrenderer.cpp index 912b507..824283f 100644 --- a/libbreezecommon/breezeboxshadowrenderer.cpp +++ b/libbreezecommon/breezeboxshadowrenderer.cpp @@ -27,7 +27,6 @@ namespace Breeze { - static inline int calculateBlurRadius(qreal stdDev) { // See https://www.w3.org/TR/SVG11/filters.html#feGaussianBlurElement @@ -47,9 +46,8 @@ static inline QSize calculateBlurExtent(int radius) return QSize(blurRadius, blurRadius); } -struct BoxLobes -{ - int left; ///< how many pixels sample to the left +struct BoxLobes { + int left; ///< how many pixels sample to the left int right; ///< how many pixels sample to the right }; @@ -94,11 +92,7 @@ static QVector computeLobes(int radius) Q_ASSERT(major + minor + final == blurRadius); - return { - {major, minor}, - {minor, major}, - {final, final} - }; + return {{major, minor}, {minor, major}, {final, final}}; } /** @@ -114,8 +108,13 @@ static QVector computeLobes(int radius) * @param transposeInput Whether the input is transposed. * @param transposeOutput Whether the output should be transposed. **/ -static inline void boxBlurRowAlpha(const uint8_t *src, uint8_t *dst, int width, int horizontalStride, - int verticalStride, const BoxLobes &lobes, bool transposeInput, +static inline void boxBlurRowAlpha(const uint8_t *src, + uint8_t *dst, + int width, + int horizontalStride, + int verticalStride, + const BoxLobes &lobes, + bool transposeInput, bool transposeOutput) { const int inputStep = transposeInput ? verticalStride : horizontalStride; @@ -192,7 +191,7 @@ static inline void boxBlurAlpha(QImage &image, int radius, const QRect &rect = { const int pixelStride = image.depth() >> 3; const int bufferStride = qMax(width, height) * pixelStride; - QScopedPointer > buf(new uint8_t[2 * bufferStride]); + QScopedPointer> buf(new uint8_t[2 * bufferStride]); uint8_t *buf1 = buf.data(); uint8_t *buf2 = buf1 + bufferStride; @@ -315,8 +314,7 @@ QImage BoxShadowRenderer::render() const QSize canvasSize; for (const Shadow &shadow : qAsConst(m_shadows)) { - canvasSize = canvasSize.expandedTo( - calculateMinimumShadowTextureSize(m_boxSize, shadow.radius, shadow.offset)); + canvasSize = canvasSize.expandedTo(calculateMinimumShadowTextureSize(m_boxSize, shadow.radius, shadow.offset)); } QImage canvas(canvasSize, QImage::Format_ARGB32_Premultiplied); diff --git a/libbreezecommon/breezeboxshadowrenderer.h b/libbreezecommon/breezeboxshadowrenderer.h index 7c6625d..11e11ce 100644 --- a/libbreezecommon/breezeboxshadowrenderer.h +++ b/libbreezecommon/breezeboxshadowrenderer.h @@ -29,7 +29,6 @@ namespace Breeze { - class BREEZECOMMON_EXPORT BoxShadowRenderer { public: