Unreviewed, rolling out r100988.
authorkbalazs@webkit.org <kbalazs@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Nov 2011 12:58:20 +0000 (12:58 +0000)
committerkbalazs@webkit.org <kbalazs@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Nov 2011 12:58:20 +0000 (12:58 +0000)
http://trac.webkit.org/changeset/100988
https://bugs.webkit.org/show_bug.cgi?id=72941

"Broke pixel tests on Chromium-Linux" (Requested by kbalazs on
#webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2011-11-22

Source/JavaScriptCore:

* JavaScriptCore.gypi:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
* wtf/ParallelJobs.h:
* wtf/ParallelJobsGeneric.cpp:
* wtf/ParallelJobsGeneric.h:
(WTF::ParallelEnvironment::ParallelEnvironment):
(WTF::ParallelEnvironment::execute):
* wtf/Platform.h:

Source/WebCore:

* platform/graphics/filters/FEConvolveMatrix.cpp:
(WebCore::FEConvolveMatrix::platformApplySoftware):
* platform/graphics/filters/FEConvolveMatrix.h:
* platform/graphics/filters/FEGaussianBlur.cpp:
(WebCore::FEGaussianBlur::platformApply):
* platform/graphics/filters/FEGaussianBlur.h:
* platform/graphics/filters/FELighting.cpp:
(WebCore::FELighting::platformApplyGeneric):
* platform/graphics/filters/FELighting.h:
* platform/graphics/filters/FEMorphology.cpp:
(WebCore::FEMorphology::platformApply):
* platform/graphics/filters/FEMorphology.h:
* platform/graphics/filters/FETurbulence.cpp:
(WebCore::FETurbulence::platformApplySoftware):
* platform/graphics/filters/FETurbulence.h:
* platform/graphics/filters/arm/FELightingNEON.cpp:
* platform/graphics/filters/arm/FELightingNEON.h:
(WebCore::FELighting::platformApplyNeon):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@100989 268f45cc-cd09-0410-ab3c-d52691b4dbfc

20 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.gypi
Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
Source/JavaScriptCore/wtf/ParallelJobs.h
Source/JavaScriptCore/wtf/ParallelJobsGeneric.cpp
Source/JavaScriptCore/wtf/ParallelJobsGeneric.h
Source/JavaScriptCore/wtf/Platform.h
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp
Source/WebCore/platform/graphics/filters/FEConvolveMatrix.h
Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
Source/WebCore/platform/graphics/filters/FEGaussianBlur.h
Source/WebCore/platform/graphics/filters/FELighting.cpp
Source/WebCore/platform/graphics/filters/FELighting.h
Source/WebCore/platform/graphics/filters/FEMorphology.cpp
Source/WebCore/platform/graphics/filters/FEMorphology.h
Source/WebCore/platform/graphics/filters/FETurbulence.cpp
Source/WebCore/platform/graphics/filters/FETurbulence.h
Source/WebCore/platform/graphics/filters/arm/FELightingNEON.cpp
Source/WebCore/platform/graphics/filters/arm/FELightingNEON.h

index 333f780..f2a15fd 100644 (file)
@@ -1,3 +1,21 @@
+2011-11-22  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r100988.
+        http://trac.webkit.org/changeset/100988
+        https://bugs.webkit.org/show_bug.cgi?id=72941
+
+        "Broke pixel tests on Chromium-Linux" (Requested by kbalazs on
+        #webkit).
+
+        * JavaScriptCore.gypi:
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+        * wtf/ParallelJobs.h:
+        * wtf/ParallelJobsGeneric.cpp:
+        * wtf/ParallelJobsGeneric.h:
+        (WTF::ParallelEnvironment::ParallelEnvironment):
+        (WTF::ParallelEnvironment::execute):
+        * wtf/Platform.h:
+
 2011-11-21  Balazs Kelemen  <kbalazs@webkit.org>
 
         Enable ParallelJobs by default
index 9a49c4b..81db2b4 100644 (file)
             'wtf/OSRandomSource.h',
             'wtf/PageAllocationAligned.cpp',
             'wtf/PageBlock.cpp',
-            'wtf/ParallelJobs.h',
-            'wtf/ParallelJobsGeneric.cpp',
-            'wtf/ParallelJobsGeneric.h',
-            'wtf/ParallelJobsLibdispatch.h',
-            'wtf/ParallelJobsOpenMP.h',
             'wtf/RandomNumber.cpp',
             'wtf/RandomNumberSeed.h',
             'wtf/RefCountedLeakCounter.cpp',
index 72f78ef..2a420b6 100644 (file)
@@ -13,7 +13,6 @@ EXPORTS
     ??0JSLock@JSC@@QAE@PAVExecState@1@@Z
     ??0MD5@WTF@@QAE@XZ
     ??0Mutex@WTF@@QAE@XZ
-    ??0ParallelEnvironment@WTF@@QAE@P6AXPAX@ZIH@Z
     ??0RefCountedLeakCounter@WTF@@QAE@PBD@Z
     ??0RegExpObject@JSC@@IAE@PAVJSGlobalObject@1@PAVStructure@1@PAVRegExp@1@@Z
     ??0SHA1@WTF@@QAE@XZ
@@ -129,7 +128,6 @@ EXPORTS
     ?currentThread@WTF@@YAIXZ
     ?currentThreadIsHoldingLock@JSLock@JSC@@SA_NXZ
     ?currentTime@WTF@@YANXZ
-       ?execute@ParallelEnvironment@WTF@@QAEXPAX@Z
     ?data@CString@WTF@@QBEPBDXZ
     ?dateToDaysFrom1970@WTF@@YANHHH@Z
     ?dayInMonthFromDayInYear@WTF@@YAHH_N@Z
index 92b9c5b..77b51c2 100644 (file)
 #include "RefPtr.h"
 #include <wtf/Vector.h>
 
+#if ENABLE(PARALLEL_JOBS)
+
 // Usage:
 //
+// #if ENABLE(PARALLEL_JOBS)
+//
 //     // Initialize parallel jobs
 //     ParallelJobs<TypeOfParameter> parallelJobs(&worker [, requestedNumberOfJobs]);
 //
 //     // Execute parallel jobs
 //     parallelJobs.execute();
 //
+// #else
+//
+//     inlineFunction(args...);
+//
+// #endif // ENABLE(PARALLEL_JOBS)
 
 #if ENABLE(THREADING_GENERIC)
 #include "ParallelJobsGeneric.h"
@@ -102,4 +111,6 @@ private:
 
 using WTF::ParallelJobs;
 
+#endif // ENABLE(PARALLEL_JOBS)
+
 #endif // ParallelJobs_h
index 69fa6ab..7677427 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "config.h"
 
-#if ENABLE(THREADING_GENERIC)
+#if ENABLE(PARALLEL_JOBS) && ENABLE(THREADING_GENERIC)
 
 #include "ParallelJobs.h"
 #include "UnusedParam.h"
@@ -38,7 +38,7 @@
 #elif OS(LINUX) || OS(AIX) || OS(SOLARIS)
 #include <unistd.h>
 #elif OS(WINDOWS)
-#include <windows.h>
+#include <Windows.h>
 #endif
 
 namespace WTF {
@@ -47,52 +47,6 @@ Vector< RefPtr<ParallelEnvironment::ThreadPrivate> >* ParallelEnvironment::s_thr
 
 int ParallelEnvironment::s_maxNumberOfParallelThreads = -1;
 
-ParallelEnvironment::ParallelEnvironment(ThreadFunction threadFunction, size_t sizeOfParameter, int requestedJobNumber) :
-    m_threadFunction(threadFunction),
-    m_sizeOfParameter(sizeOfParameter)
-{
-    ASSERT_ARG(requestedJobNumber, requestedJobNumber >= 1);
-
-    if (s_maxNumberOfParallelThreads == -1)
-        determineMaxNumberOfParallelThreads();
-
-    if (!requestedJobNumber || requestedJobNumber > s_maxNumberOfParallelThreads)
-        requestedJobNumber = static_cast<unsigned>(s_maxNumberOfParallelThreads);
-
-    if (!s_threadPool)
-        s_threadPool = new Vector< RefPtr<ThreadPrivate> >();
-
-    // The main thread should be also a worker.
-    int maxNumberOfNewThreads = requestedJobNumber - 1;
-
-    for (int i = 0; i < s_maxNumberOfParallelThreads && m_threads.size() < static_cast<unsigned>(maxNumberOfNewThreads); ++i) {
-        if (s_threadPool->size() < i + 1)
-            s_threadPool->append(ThreadPrivate::create());
-
-        if ((*s_threadPool)[i]->tryLockFor(this))
-            m_threads.append((*s_threadPool)[i]);
-    }
-
-    m_numberOfJobs = m_threads.size() + 1;
-}
-
-void ParallelEnvironment::execute(void* parameters)
-{
-    unsigned char* currentParameter = static_cast<unsigned char*>(parameters);
-    size_t i;
-    for (i = 0; i < m_threads.size(); ++i) {
-        m_threads[i]->execute(m_threadFunction, parameters);
-        currentParameter += m_sizeOfParameter;
-    }
-
-    // The work for the main thread.
-    (*m_threadFunction)(parameters);
-
-    // Wait until all jobs are done.
-    for (i = 0; i < m_threads.size(); ++i)
-        m_threads[i]->waitForFinish();
-}
-
 void ParallelEnvironment::determineMaxNumberOfParallelThreads()
 {
     const int defaultIfUnavailable = 2;
@@ -178,4 +132,5 @@ void* ParallelEnvironment::ThreadPrivate::workerThread(void* threadData)
 }
 
 } // namespace WTF
-#endif // ENABLE(THREADING_GENERIC)
+
+#endif // ENABLE(PARALLEL_JOBS) && ENABLE(THREADING_GENERIC)
index dab6dd9..e7d2441 100644 (file)
@@ -40,14 +40,55 @@ class ParallelEnvironment {
 public:
     typedef void (*ThreadFunction)(void*);
 
-    ParallelEnvironment(ThreadFunction, size_t sizeOfParameter, int requestedJobNumber);
+    ParallelEnvironment(ThreadFunction threadFunction, size_t sizeOfParameter, int requestedJobNumber) :
+        m_threadFunction(threadFunction),
+        m_sizeOfParameter(sizeOfParameter)
+    {
+        ASSERT_ARG(requestedJobNumber, requestedJobNumber >= 1);
+
+        if (s_maxNumberOfParallelThreads == -1)
+            determineMaxNumberOfParallelThreads();
+
+        if (!requestedJobNumber || requestedJobNumber > s_maxNumberOfParallelThreads)
+            requestedJobNumber = static_cast<unsigned>(s_maxNumberOfParallelThreads);
+
+        if (!s_threadPool)
+            s_threadPool = new Vector< RefPtr<ThreadPrivate> >();
+
+        // The main thread should be also a worker.
+        int maxNumberOfNewThreads = requestedJobNumber - 1;
+
+        for (int i = 0; i < s_maxNumberOfParallelThreads && m_threads.size() < maxNumberOfNewThreads; ++i) {
+            if (s_threadPool->size() < i + 1)
+                s_threadPool->append(ThreadPrivate::create());
+
+            if ((*s_threadPool)[i]->tryLockFor(this))
+                m_threads.append((*s_threadPool)[i]);
+        }
+
+        m_numberOfJobs = m_threads.size() + 1;
+    }
 
     int numberOfJobs()
     {
         return m_numberOfJobs;
     }
 
-    void execute(void* parameters);
+    void execute(unsigned char* parameters)
+    {
+        size_t i;
+        for (i = 0; i < m_threads.size(); ++i) {
+            m_threads[i]->execute(m_threadFunction, parameters);
+            parameters += m_sizeOfParameter;
+        }
+
+        // The work for the main thread
+        (*m_threadFunction)(parameters);
+
+        // Wait until all jobs are done.
+        for (i = 0; i < m_threads.size(); ++i)
+            m_threads[i]->waitForFinish();
+    }
 
     class ThreadPrivate : public RefCounted<ThreadPrivate> {
     public:
index 7245b7b..a686616 100644 (file)
 #define ENABLE_BRANCH_COMPACTION 1
 #endif
 
-#if !defined(ENABLE_THREADING_LIBDISPATCH) && HAVE(DISPATCH_H)
-#define ENABLE_THREADING_LIBDISPATCH 1
-#elif !defined(ENABLE_THREADING_OPENMP) && defined(_OPENMP)
+#if !defined(ENABLE_THREADING_OPENMP) && defined(_OPENMP)
 #define ENABLE_THREADING_OPENMP 1
-#elif !defined(THREADING_GENERIC)
-#define ENABLE_THREADING_GENERIC 1
+#endif
+
+#if !defined(ENABLE_PARALLEL_JOBS) && (ENABLE(THREADING_GENERIC) || ENABLE(THREADING_LIBDISPATCH) || ENABLE(THREADING_OPENMP))
+#define ENABLE_PARALLEL_JOBS 1
 #endif
 
 #if ENABLE(GLIB_SUPPORT)
index 6efe9c6..c38160e 100644 (file)
@@ -1,3 +1,31 @@
+2011-11-22  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r100988.
+        http://trac.webkit.org/changeset/100988
+        https://bugs.webkit.org/show_bug.cgi?id=72941
+
+        "Broke pixel tests on Chromium-Linux" (Requested by kbalazs on
+        #webkit).
+
+        * platform/graphics/filters/FEConvolveMatrix.cpp:
+        (WebCore::FEConvolveMatrix::platformApplySoftware):
+        * platform/graphics/filters/FEConvolveMatrix.h:
+        * platform/graphics/filters/FEGaussianBlur.cpp:
+        (WebCore::FEGaussianBlur::platformApply):
+        * platform/graphics/filters/FEGaussianBlur.h:
+        * platform/graphics/filters/FELighting.cpp:
+        (WebCore::FELighting::platformApplyGeneric):
+        * platform/graphics/filters/FELighting.h:
+        * platform/graphics/filters/FEMorphology.cpp:
+        (WebCore::FEMorphology::platformApply):
+        * platform/graphics/filters/FEMorphology.h:
+        * platform/graphics/filters/FETurbulence.cpp:
+        (WebCore::FETurbulence::platformApplySoftware):
+        * platform/graphics/filters/FETurbulence.h:
+        * platform/graphics/filters/arm/FELightingNEON.cpp:
+        * platform/graphics/filters/arm/FELightingNEON.h:
+        (WebCore::FELighting::platformApplyNeon):
+
 2011-11-21  Balazs Kelemen  <kbalazs@webkit.org>
 
         Enable ParallelJobs by default
index cda5f19..7dd74b3 100644 (file)
@@ -394,10 +394,12 @@ ALWAYS_INLINE void FEConvolveMatrix::setOuterPixels(PaintingData& paintingData,
         fastSetOuterPixels<false>(paintingData, x1, y1, x2, y2);
 }
 
+#if ENABLE(PARALLEL_JOBS)
 void FEConvolveMatrix::setInteriorPixelsWorker(InteriorPixelParameters* param)
 {
     param->filter->setInteriorPixels(*param->paintingData, param->clipRight, param->clipBottom, param->yStart, param->yEnd);
 }
+#endif
 
 void FEConvolveMatrix::platformApplySoftware()
 {
@@ -433,9 +435,10 @@ void FEConvolveMatrix::platformApplySoftware()
 
     if (clipRight >= 0 && clipBottom >= 0) {
 
+#if ENABLE(PARALLEL_JOBS)
         int optimalThreadNumber = (absolutePaintRect().width() * absolutePaintRect().height()) / s_minimalRectDimension;
         if (optimalThreadNumber > 1) {
-            WTF::ParallelJobs<InteriorPixelParameters> parallelJobs(&WebCore::FEConvolveMatrix::setInteriorPixelsWorker, optimalThreadNumber);
+            ParallelJobs<InteriorPixelParameters> parallelJobs(&WebCore::FEConvolveMatrix::setInteriorPixelsWorker, optimalThreadNumber);
             const int numOfThreads = parallelJobs.numberOfJobs();
             const int heightPerThread = clipBottom / numOfThreads;
             int startY = 0;
@@ -455,10 +458,10 @@ void FEConvolveMatrix::platformApplySoftware()
             }
 
             parallelJobs.execute();
-        } else {
-            // Fallback to single threaded mode.
-            setInteriorPixels(paintingData, clipRight, clipBottom, 0, clipBottom);
-        }
+        } else
+            // Fallback to the default setInteriorPixels call.
+#endif
+        setInteriorPixels(paintingData, clipRight, clipBottom, 0, clipBottom);
 
         clipRight += m_targetOffset.x() + 1;
         clipBottom += m_targetOffset.y() + 1;
index 34baf6f..dca4324 100644 (file)
@@ -105,6 +105,7 @@ private:
     ALWAYS_INLINE void setOuterPixels(PaintingData&, int x1, int y1, int x2, int y2);
 
     // Parallelization parts
+#if ENABLE(PARALLEL_JOBS)
     static const int s_minimalRectDimension = (100 * 100); // Empirical data limit for parallel jobs
 
     template<typename Type>
@@ -120,6 +121,7 @@ private:
     };
 
     static void setInteriorPixelsWorker(InteriorPixelParameters*);
+#endif
 
     IntSize m_kernelSize;
     float m_divisor;
index 3459301..0d54e57 100644 (file)
@@ -135,6 +135,7 @@ inline void FEGaussianBlur::platformApplyGeneric(ByteArray* srcPixelArray, ByteA
     }
 }
 
+#if ENABLE(PARALLEL_JOBS)
 void FEGaussianBlur::platformApplyWorker(PlatformApplyParameters* parameters)
 {
     IntSize paintSize(parameters->width, parameters->height);
@@ -146,15 +147,17 @@ void FEGaussianBlur::platformApplyWorker(PlatformApplyParameters* parameters)
         parameters->kernelSizeX, parameters->kernelSizeY, paintSize);
 #endif
 }
+#endif
 
 inline void FEGaussianBlur::platformApply(ByteArray* srcPixelArray, ByteArray* tmpPixelArray, unsigned kernelSizeX, unsigned kernelSizeY, IntSize& paintSize)
 {
+#if ENABLE(PARALLEL_JOBS)
     int scanline = 4 * paintSize.width();
     int extraHeight = 3 * kernelSizeY * 0.5f;
     int optimalThreadNumber = (paintSize.width() * paintSize.height()) / (s_minimalRectDimension + extraHeight * paintSize.width());
 
     if (optimalThreadNumber > 1) {
-        WTF::ParallelJobs<PlatformApplyParameters> parallelJobs(&platformApplyWorker, optimalThreadNumber);
+        ParallelJobs<PlatformApplyParameters> parallelJobs(&platformApplyWorker, optimalThreadNumber);
 
         int jobs = parallelJobs.numberOfJobs();
         if (jobs > 1) {
@@ -213,8 +216,8 @@ inline void FEGaussianBlur::platformApply(ByteArray* srcPixelArray, ByteArray* t
             }
             return;
         }
-        // Fallback to single threaded mode.
     }
+#endif // PARALLEL_JOBS
 
     // The selection here eventually should happen dynamically on some platforms.
 #if CPU(ARM_NEON) && COMPILER(GCC)
index fbb0d9a..2d96a40 100644 (file)
@@ -49,6 +49,7 @@ public:
     virtual TextStream& externalRepresentation(TextStream&, int indention) const;
 
 private:
+#if ENABLE(PARALLEL_JOBS)
     static const int s_minimalRectDimension = 100 * 100; // Empirical data limit for parallel jobs
 
     template<typename Type>
@@ -65,6 +66,7 @@ private:
     };
 
     static void platformApplyWorker(PlatformApplyParameters*);
+#endif // ENABLE(PARALLEL_JOBS)
 
     FEGaussianBlur(Filter*, float, float);
 
index e795d35..2c97a11 100644 (file)
@@ -242,17 +242,20 @@ inline void FELighting::platformApplyGenericPaint(LightingData& data, LightSourc
     }
 }
 
+#if ENABLE(PARALLEL_JOBS)
 void FELighting::platformApplyGenericWorker(PlatformApplyGenericParameters* parameters)
 {
     parameters->filter->platformApplyGenericPaint(parameters->data, parameters->paintingData, parameters->yStart, parameters->yEnd);
 }
+#endif // ENABLE(PARALLEL_JOBS)
 
 inline void FELighting::platformApplyGeneric(LightingData& data, LightSource::PaintingData& paintingData)
 {
+#if ENABLE(PARALLEL_JOBS)
     int optimalThreadNumber = ((data.widthDecreasedByOne - 1) * (data.heightDecreasedByOne - 1)) / s_minimalRectDimension;
     if (optimalThreadNumber > 1) {
         // Initialize parallel jobs
-        WTF::ParallelJobs<PlatformApplyGenericParameters> parallelJobs(&platformApplyGenericWorker, optimalThreadNumber);
+        ParallelJobs<PlatformApplyGenericParameters> parallelJobs(&platformApplyGenericWorker, optimalThreadNumber);
 
         // Fill the parameter array
         int job = parallelJobs.numberOfJobs();
@@ -274,9 +277,8 @@ inline void FELighting::platformApplyGeneric(LightingData& data, LightSource::Pa
             parallelJobs.execute();
             return;
         }
-        // Fallback to single threaded mode.
     }
-
+#endif
     platformApplyGenericPaint(data, paintingData, 1, data.heightDecreasedByOne);
 }
 
index 5426f91..04d7a1f 100644 (file)
@@ -50,7 +50,9 @@ public:
     virtual void determineAbsolutePaintRect() { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); }
 
 protected:
+#if ENABLE(PARALLEL_JOBS)
     static const int s_minimalRectDimension = 100 * 100; // Empirical data limit for parallel jobs
+#endif
 
     enum LightingType {
         DiffuseLighting,
@@ -76,6 +78,7 @@ protected:
         inline void bottomRight(int offset, IntPoint& normalVector);
     };
 
+#if ENABLE(PARALLEL_JOBS)
     template<typename Type>
     friend class ParallelJobs;
 
@@ -89,6 +92,7 @@ protected:
 
     static void platformApplyGenericWorker(PlatformApplyGenericParameters*);
     static void platformApplyNeonWorker(FELightingPaintingDataForNeon*);
+#endif
 
     FELighting(Filter*, LightingType, const Color&, float, float, float, float, float, float, PassRefPtr<LightSource>);
 
index bd75e2b..85445d9 100644 (file)
@@ -158,13 +158,16 @@ void FEMorphology::platformApplyGeneric(PaintingData* paintingData, int yStart,
     }
 }
 
+#if ENABLE(PARALLEL_JOBS)
 void FEMorphology::platformApplyWorker(PlatformApplyParameters* param)
 {
     param->filter->platformApplyGeneric(param->paintingData, param->startY, param->endY);
 }
+#endif
 
 void FEMorphology::platformApply(PaintingData* paintingData)
 {
+#if ENABLE(PARALLEL_JOBS)
     int optimalThreadNumber = (paintingData->width * paintingData->height) / s_minimalArea;
     if (optimalThreadNumber > 1) {
         ParallelJobs<PlatformApplyParameters> parallelJobs(&WebCore::FEMorphology::platformApplyWorker, optimalThreadNumber);
@@ -185,7 +188,7 @@ void FEMorphology::platformApply(PaintingData* paintingData)
         }
         // Fallback to single thread model
     }
-
+#endif
     platformApplyGeneric(paintingData, 0, paintingData->height);
 }
 
index f925403..72c6f4e 100644 (file)
@@ -62,6 +62,7 @@ public:
         int radiusY;
     };
 
+#if ENABLE(PARALLEL_JOBS)
     static const int s_minimalArea = (300 * 300); // Empirical data limit for parallel jobs
 
     struct PlatformApplyParameters {
@@ -72,6 +73,7 @@ public:
     };
 
     static void platformApplyWorker(PlatformApplyParameters*);
+#endif
 
     inline void platformApply(PaintingData*);
     inline void platformApplyGeneric(PaintingData*, const int yStart, const int yEnd);
index 3ca4571..9460fe2 100644 (file)
@@ -357,10 +357,12 @@ inline void FETurbulence::fillRegion(ByteArray* pixelArray, PaintingData& painti
     }
 }
 
+#if ENABLE(PARALLEL_JOBS)
 void FETurbulence::fillRegionWorker(FillRegionParameters* parameters)
 {
     parameters->filter->fillRegion(parameters->pixelArray, *parameters->paintingData, parameters->startY, parameters->endY);
 }
+#endif // ENABLE(PARALLEL_JOBS)
 
 void FETurbulence::platformApplySoftware()
 {
@@ -376,10 +378,12 @@ void FETurbulence::platformApplySoftware()
     PaintingData paintingData(m_seed, roundedIntSize(filterPrimitiveSubregion().size()));
     initPaint(paintingData);
 
+#if ENABLE(PARALLEL_JOBS)
+
     int optimalThreadNumber = (absolutePaintRect().width() * absolutePaintRect().height()) / s_minimalRectDimension;
     if (optimalThreadNumber > 1) {
         // Initialize parallel jobs
-        WTF::ParallelJobs<FillRegionParameters> parallelJobs(&WebCore::FETurbulence::fillRegionWorker, optimalThreadNumber);
+        ParallelJobs<FillRegionParameters> parallelJobs(&WebCore::FETurbulence::fillRegionWorker, optimalThreadNumber);
 
         // Fill the parameter array
         int i = parallelJobs.numberOfJobs();
@@ -401,11 +405,14 @@ void FETurbulence::platformApplySoftware()
 
             // Execute parallel jobs
             parallelJobs.execute();
+
             return;
         }
     }
+    // Fallback to sequential mode if there is no room for a new thread or the paint area is too small
+
+#endif // ENABLE(PARALLEL_JOBS)
 
-    // Fallback to single threaded mode if there is no room for a new thread or the paint area is too small.
     fillRegion(pixelArray, paintingData, 0, absolutePaintRect().height());
 }
 
index 01d3c59..641ca76 100644 (file)
@@ -58,7 +58,9 @@ public:
     bool stitchTiles() const;
     bool setStitchTiles(bool);
 
+#if ENABLE(PARALLEL_JOBS)
     static void fillRegionWorker(void*);
+#endif
 
     virtual void platformApplySoftware();
     virtual void dump();
@@ -70,8 +72,9 @@ public:
 private:
     static const int s_blockSize = 256;
     static const int s_blockMask = s_blockSize - 1;
-
-    static const int s_minimalRectDimension = (100 * 100); // Empirical data limit for parallel jobs.
+#if ENABLE(PARALLEL_JOBS)
+    static const int s_minimalRectDimension = (100 * 100); // Empirical data limit for parallel jobs
+#endif
 
     struct PaintingData {
         long seed;
@@ -87,6 +90,7 @@ private:
         inline long random();
     };
 
+#if ENABLE(PARALLEL_JOBS)
     template<typename Type>
     friend class ParallelJobs;
 
@@ -99,6 +103,7 @@ private:
     };
 
     static void fillRegionWorker(FillRegionParameters*);
+#endif
 
     FETurbulence(Filter*, TurbulenceType, float, float, int, float, bool);
 
index 110b528..513b749 100644 (file)
@@ -50,10 +50,12 @@ short* feLightingConstantsForNeon()
     return s_FELightingConstantsForNeon;
 }
 
+#if ENABLE(PARALLEL_JOBS)
 void FELighting::platformApplyNeonWorker(FELightingPaintingDataForNeon* parameters)
 {
     neonDrawLighting(parameters);
 }
+#endif
 
 #define ASSTRING(str) #str
 #define TOSTRING(value) ASSTRING(value)
index 9094153..d69e227 100644 (file)
@@ -167,6 +167,7 @@ inline void FELighting::platformApplyNeon(LightingData& data, LightSource::Paint
     if (floatArguments.diffuseConstant == 1)
         neonData.flags |= FLAG_DIFFUSE_CONST_IS_1;
 
+#if ENABLE(PARALLEL_JOBS)
     int optimalThreadNumber = ((data.widthDecreasedByOne - 1) * (data.heightDecreasedByOne - 1)) / s_minimalRectDimension;
     if (optimalThreadNumber > 1) {
         // Initialize parallel jobs
@@ -192,6 +193,7 @@ inline void FELighting::platformApplyNeon(LightingData& data, LightSource::Paint
             return;
         }
     }
+#endif
 
     neonDrawLighting(&neonData);
 }