[calligra] respin qreal patch
Rex Dieter
rdieter at fedoraproject.org
Tue Feb 11 20:21:54 UTC 2014
commit e329fe3b9a648bec0948898d323bea9429fc279b
Author: Rex Dieter <rdieter at math.unl.edu>
Date: Tue Feb 11 14:22:22 2014 -0600
respin qreal patch
calligra-2.7.92-qreal.patch | 92 ++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 90 insertions(+), 2 deletions(-)
---
diff --git a/calligra-2.7.92-qreal.patch b/calligra-2.7.92-qreal.patch
index 7e2775c..71838b7 100644
--- a/calligra-2.7.92-qreal.patch
+++ b/calligra-2.7.92-qreal.patch
@@ -1,7 +1,15 @@
-diff -up calligra-2.7.92/krita/image/kis_convolution_painter.cc.qreal calligra-2.7.92/krita/image/kis_convolution_painter.cc
diff -up calligra-2.7.92/krita/image/kis_convolution_worker_spatial.h.qreal calligra-2.7.92/krita/image/kis_convolution_worker_spatial.h
--- calligra-2.7.92/krita/image/kis_convolution_worker_spatial.h.qreal 2014-02-09 04:18:42.000000000 -0600
-+++ calligra-2.7.92/krita/image/kis_convolution_worker_spatial.h 2014-02-10 11:21:05.258576197 -0600
++++ calligra-2.7.92/krita/image/kis_convolution_worker_spatial.h 2014-02-11 13:04:35.488525286 -0600
+@@ -44,7 +44,7 @@ public:
+
+ inline void loadPixelToCache(qreal **cache, const quint8 *data, int index) {
+ // no alpha is rare case, so just multiply by 1.0 in that case
+- double alphaValue = m_alphaRealPos >= 0 ?
++ qreal alphaValue = m_alphaRealPos >= 0 ?
+ m_toDoubleFuncPtr[m_alphaCachePos](data, m_alphaRealPos) : 1.0;
+
+ for (quint32 k = 0; k < m_convolveChannelsNo; ++k) {
@@ -109,11 +109,11 @@ public:
this->m_progress->setProgress(0);
@@ -18,3 +26,83 @@ diff -up calligra-2.7.92/krita/image/kis_convolution_worker_spatial.h.qreal call
}
// decide caching strategy
+@@ -133,9 +133,9 @@ public:
+ return;
+
+ m_kernelFactor = kernel->factor() ? 1.0 / kernel->factor() : 1;
+- m_maxClamp = new double[m_convChannelList.count()];
+- m_minClamp = new double[m_convChannelList.count()];
+- m_absoluteOffset = new double[m_convChannelList.count()];
++ m_maxClamp = new qreal[m_convChannelList.count()];
++ m_minClamp = new qreal[m_convChannelList.count()];
++ m_absoluteOffset = new qreal[m_convChannelList.count()];
+ for (quint16 i = 0; i < m_convChannelList.count(); ++i) {
+ m_minClamp[i] = mathToolbox->minChannelValue(m_convChannelList[i]);
+ m_maxClamp[i] = mathToolbox->maxChannelValue(m_convChannelList[i]);
+@@ -170,7 +170,7 @@ public:
+ for (int prow = 0; prow < areaSize.height(); ++prow) {
+ // reload cache from copy
+ for (quint32 i = 0; i < m_cacheSize; ++i)
+- memcpy(m_pixelPtrCache[i], m_pixelPtrCacheCopy[i], channelCount * sizeof(double));
++ memcpy(m_pixelPtrCache[i], m_pixelPtrCacheCopy[i], channelCount * sizeof(qreal));
+
+ typename _IteratorFactory_::VLineConstIterator kitSrc = _IteratorFactory_::createVLineConstIterator(src, col + m_khalfWidth, row - m_khalfHeight, m_kh, dataRect);
+ for (int pcol = 0; pcol < areaSize.width(); ++pcol) {
+@@ -214,7 +214,7 @@ public:
+ for (int pcol = 0; pcol < areaSize.width(); pcol++) {
+ // reload cache from copy
+ for (quint32 i = 0; i < m_cacheSize; ++i)
+- memcpy(m_pixelPtrCache[i], m_pixelPtrCacheCopy[i], channelCount * sizeof(double));
++ memcpy(m_pixelPtrCache[i], m_pixelPtrCacheCopy[i], channelCount * sizeof(qreal));
+
+ typename _IteratorFactory_::HLineConstIterator khitSrc = _IteratorFactory_::createHLineConstIterator(src, col - m_khalfWidth, row + m_khalfHeight, m_kw, dataRect);
+ for (int prow = 0; prow < areaSize.height(); prow++) {
+@@ -267,7 +267,7 @@ public:
+ interimConvoResult += m_kernelData[m_cacheSize - pIndex - 1] * cacheValue;
+ }
+
+- double channelPixelValue;
++ qreal channelPixelValue;
+ if (additionalMultiplierActive) {
+ channelPixelValue = (interimConvoResult * m_kernelFactor + m_absoluteOffset[channel]) * additionalMultiplier;
+ } else {
+@@ -298,12 +298,12 @@ public:
+ }
+ }
+
+- inline void moveKernelRight(typename _IteratorFactory_::VLineConstIterator& kitSrc, double **pixelPtrCache) {
+- double** d = pixelPtrCache;
++ inline void moveKernelRight(typename _IteratorFactory_::VLineConstIterator& kitSrc, qreal **pixelPtrCache) {
++ qreal** d = pixelPtrCache;
+
+ for (quint32 krow = 0; krow < m_kh; ++krow) {
+- double* first = *d;
+- memmove(d, d + 1, (m_kw - 1) * sizeof(double *));
++ qreal* first = *d;
++ memmove(d, d + 1, (m_kw - 1) * sizeof(qreal *));
+ *(d + m_kw - 1) = first;
+ d += m_kw;
+ }
+@@ -316,9 +316,9 @@ public:
+ } while (kitSrc->nextPixel());
+ }
+
+- inline void moveKernelDown(typename _IteratorFactory_::HLineConstIterator& kitSrc, double **pixelPtrCache) {
++ inline void moveKernelDown(typename _IteratorFactory_::HLineConstIterator& kitSrc, qreal **pixelPtrCache) {
+ quint8 **tmp = new quint8*[m_kw];
+- memcpy(tmp, pixelPtrCache, m_kw * sizeof(double *));
++ memcpy(tmp, pixelPtrCache, m_kw * sizeof(qreal *));
+ memmove(pixelPtrCache, pixelPtrCache + m_kw, (m_kw * m_kh - m_kw) * sizeof(quint8 *));
+ memcpy(pixelPtrCache + m_kw *(m_kh - 1), tmp, m_kw * sizeof(quint8 *));
+ delete[] tmp;
+@@ -356,8 +356,8 @@ private:
+ int m_alphaRealPos;
+
+ qreal *m_kernelData;
+- double** m_pixelPtrCache, ** m_pixelPtrCacheCopy;
+- double* m_minClamp, *m_maxClamp, *m_absoluteOffset;
++ qreal** m_pixelPtrCache, ** m_pixelPtrCacheCopy;
++ qreal* m_minClamp, *m_maxClamp, *m_absoluteOffset;
+
+ qreal m_kernelFactor;
+ QList<KoChannelInfo *> m_convChannelList;
More information about the scm-commits
mailing list