[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [krita/krita-testing-wolthera] libs/ui/widgets: Remove qstring compare in commonly called function.
From:       Wolthera van Hovell tot Westerflier <griffinvalley () gmail ! com>
Date:       2016-08-23 14:22:27
Message-ID: E1bcCax-0002U9-Rx () code ! kde ! org
[Download RAW message or body]

Git commit c33f2ae2939130d8a05b5e6596d07eba95bf87b7 by Wolthera van Hovell tot \
Westerflier. Committed on 23/08/2016 at 13:02.
Pushed by woltherav into branch 'krita-testing-wolthera'.

Remove qstring compare in commonly called function.

Should speed things up.

M  +11   -2    libs/ui/widgets/kis_visual_color_selector.cpp

http://commits.kde.org/krita/c33f2ae2939130d8a05b5e6596d07eba95bf87b7

diff --git a/libs/ui/widgets/kis_visual_color_selector.cpp \
b/libs/ui/widgets/kis_visual_color_selector.cpp index 719039b..84d6b6a 100644
--- a/libs/ui/widgets/kis_visual_color_selector.cpp
+++ b/libs/ui/widgets/kis_visual_color_selector.cpp
@@ -32,6 +32,7 @@
 #include "KoColorConversions.h"
 #include "KoColorDisplayRendererInterface.h"
 #include "KoChannelInfo.h"
+#include <KoColorModelStandardIds.h>
 #include <QPointer>
 #include "kis_signal_compressor.h"
 
@@ -351,7 +352,11 @@ KoColor \
KisVisualColorSelectorShape::convertShapeCoordinateToKoColor(QPointF coo  \
maxvalue.fill(1.0);  if (m_d->displayRenderer
             && m_d->displayRenderer->getPaintingColorSpace()==m_d->cs
-            && m_d->cs->colorDepthId().id().contains("F")) {
+            && m_d->cs->colorDepthId() == Float16BitsColorDepthID
+            && m_d->cs->colorDepthId() == Float32BitsColorDepthID
+            && m_d->cs->colorDepthId() == Float64BitsColorDepthID
+            && m_d->cs->colorModelId() != LABAColorModelID
+            && m_d->cs->colorModelId() != CMYKAColorModelID) {
         for (int ch = 0; ch<maxvalue.size(); ch++) {
             KoChannelInfo *channel = m_d->cs->channels()[ch];
             maxvalue[ch] = m_d->displayRenderer->maxVisibleFloatValue(channel);
@@ -466,7 +471,11 @@ QPointF \
KisVisualColorSelectorShape::convertKoColorToShapeCoordinate(KoColor c)  \
maxvalue.fill(1.0);  if (m_d->displayRenderer
             && m_d->displayRenderer->getPaintingColorSpace()==m_d->cs
-            && m_d->cs->colorDepthId().id().contains("F")) {
+            && m_d->cs->colorDepthId() == Float16BitsColorDepthID
+            && m_d->cs->colorDepthId() == Float32BitsColorDepthID
+            && m_d->cs->colorDepthId() == Float64BitsColorDepthID
+            && m_d->cs->colorModelId() != LABAColorModelID
+            && m_d->cs->colorModelId() != CMYKAColorModelID) {
         for (int ch = 0; ch<maxvalue.size(); ch++) {
             KoChannelInfo *channel = m_d->cs->channels()[ch];
             maxvalue[ch] = m_d->displayRenderer->maxVisibleFloatValue(channel);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic