Merge lp:~niclasl/granite/threaded_blur into lp:~elementary-pantheon/granite/granite

Proposed by Niclas Lockner
Status: Merged
Approved by: David Gomes
Approved revision: 657
Merged at revision: 657
Proposed branch: lp:~niclasl/granite/threaded_blur
Merge into: lp:~elementary-pantheon/granite/granite
Diff against target: 75 lines (+20/-24)
1 file modified
lib/Drawing/BufferSurface.vala (+20/-24)
To merge this branch: bzr merge lp:~niclasl/granite/threaded_blur
Reviewer Review Type Date Requested Status
David Gomes (community) Approve
Review via email: mp+198571@code.launchpad.net

Commit message

Do the exponential blur and the gaussian blur in parallel

Description of the change

Do the exponential blur and the gaussian blur in parallel.

To post a comment you must log in.
Revision history for this message
Niclas Lockner (niclasl) wrote :

This is how the code looked before rev 494. The code in this branch is also equal to the corresponding code in Plank.

Revision history for this message
David Gomes (davidgomes) wrote :

+1 for parallel solution, very much approve.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/Drawing/BufferSurface.vala'
--- lib/Drawing/BufferSurface.vala 2013-04-05 07:11:07 +0000
+++ lib/Drawing/BufferSurface.vala 2013-12-11 14:24:12 +0000
@@ -385,23 +385,21 @@
385 385
386 try {386 try {
387 // Process Rows387 // Process Rows
388 var th = new Thread<void*>.try (null, () => {
389 exponential_blur_rows (pixels, width, height, 0, height / 2, 0, width, alpha);
390 return null;
391 });
392
388 exponential_blur_rows (pixels, width, height, height / 2, height, 0, width, alpha);393 exponential_blur_rows (pixels, width, height, height / 2, height, 0, width, alpha);
389
390 var th = new Thread<void*>.try (null, () => {
391 exponential_blur_rows (pixels, width, height, 0, height / 2, 0, width, alpha);
392 return null;
393 });
394
395 th.join ();394 th.join ();
396 395
397 // Process Columns396 // Process Columns
397 var th2 = new Thread<void*>.try (null, () => {
398 exponential_blur_columns (pixels, width, height, 0, width / 2, 0, height, alpha);
399 return null;
400 });
401
398 exponential_blur_columns (pixels, width, height, width / 2, width, 0, height, alpha);402 exponential_blur_columns (pixels, width, height, width / 2, width, 0, height, alpha);
399
400 var th2 = new Thread<void*>.try (null, () => {
401 exponential_blur_columns (pixels, width, height, 0, width / 2, 0, height, alpha);
402 return null;
403 });
404
405 th2.join ();403 th2.join ();
406 } catch (Error err) {404 } catch (Error err) {
407 warning (err.message);405 warning (err.message);
@@ -517,13 +515,12 @@
517 515
518 try {516 try {
519 // Horizontal Pass517 // Horizontal Pass
518 var th = new Thread<void*>.try (null, () => {
519 gaussian_blur_horizontal (abuffer, bbuffer, kernel, gausswidth, width, height, 0, height / 2, shiftar);
520 return null;
521 });
522
520 gaussian_blur_horizontal (abuffer, bbuffer, kernel, gausswidth, width, height, height / 2, height, shiftar);523 gaussian_blur_horizontal (abuffer, bbuffer, kernel, gausswidth, width, height, height / 2, height, shiftar);
521
522 var th = new Thread<void*>.try (null, () => {
523 gaussian_blur_horizontal (abuffer, bbuffer, kernel, gausswidth, width, height, 0, height / 2, shiftar);
524 return null;
525 });
526
527 th.join ();524 th.join ();
528 525
529 // Clear buffer526 // Clear buffer
@@ -541,13 +538,12 @@
541 }538 }
542 539
543 // Vertical Pass540 // Vertical Pass
541 var th2 = new Thread<void*>.try (null, () => {
542 gaussian_blur_vertical (bbuffer, abuffer, kernel, gausswidth, width, height, 0, width / 2, shiftar);
543 return null;
544 });
545
544 gaussian_blur_vertical (bbuffer, abuffer, kernel, gausswidth, width, height, width / 2, width, shiftar);546 gaussian_blur_vertical (bbuffer, abuffer, kernel, gausswidth, width, height, width / 2, width, shiftar);
545
546 var th2 = new Thread<void*>.try (null, () => {
547 gaussian_blur_vertical (bbuffer, abuffer, kernel, gausswidth, width, height, 0, width / 2, shiftar);
548 return null;
549 });
550
551 th2.join ();547 th2.join ();
552 } catch (Error err) {548 } catch (Error err) {
553 message (err.message);549 message (err.message);

Subscribers

People subscribed via source and target branches