Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Unified Diff: Source/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp

Issue 11192059: Merge 129796 - Rewrite multithreaded filter job dispatching (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1271/
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp
===================================================================
--- Source/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp (revision 131761)
+++ Source/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp (working copy)
@@ -444,9 +444,13 @@
if (optimalThreadNumber > 1) {
WTF::ParallelJobs<InteriorPixelParameters> parallelJobs(&WebCore::FEConvolveMatrix::setInteriorPixelsWorker, optimalThreadNumber);
const int numOfThreads = parallelJobs.numberOfJobs();
+
+ // Split the job into "heightPerThread" jobs but there a few jobs that need to be slightly larger since
+ // heightPerThread * jobs < total size. These extras are handled by the remainder "jobsWithExtra".
const int heightPerThread = clipBottom / numOfThreads;
+ const int jobsWithExtra = clipBottom % numOfThreads;
+
int startY = 0;
-
for (int job = 0; job < numOfThreads; ++job) {
InteriorPixelParameters& param = parallelJobs.parameter(job);
param.filter = this;
@@ -454,11 +458,8 @@
param.clipRight = clipRight;
param.clipBottom = clipBottom;
param.yStart = startY;
- if (job < numOfThreads - 1) {
- startY += heightPerThread;
- param.yEnd = startY - 1;
- } else
- param.yEnd = clipBottom;
+ startY += job < jobsWithExtra ? heightPerThread + 1 : heightPerThread;
+ param.yEnd = startY;
}
parallelJobs.execute();
« no previous file with comments | « LayoutTests/svg/filters/feMorphology-crash-expected.txt ('k') | Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698