mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Allow SIMD vector unit to be toggled on/off #172
Currently defaults to off but future versions may default to on
This commit is contained in:
@@ -35,6 +35,8 @@ var magickFilterBicubic = 'Lanczos';
|
||||
|
||||
// Disable libvips cache to ensure tests are as fair as they can be
|
||||
sharp.cache(0);
|
||||
// Enable use of SIMD
|
||||
sharp.simd(true);
|
||||
|
||||
async.series({
|
||||
'jpeg-linear': function(callback) {
|
||||
@@ -496,6 +498,24 @@ async.series({
|
||||
}
|
||||
});
|
||||
}
|
||||
}).add('sharp-without-simd', {
|
||||
defer: true,
|
||||
fn: function(deferred) {
|
||||
sharp.simd(false);
|
||||
sharp(inputJpgBuffer)
|
||||
.rotate(90)
|
||||
.interpolateWith(sharp.interpolator.bilinear)
|
||||
.resize(width, height)
|
||||
.toBuffer(function(err, buffer) {
|
||||
sharp.simd(true);
|
||||
if (err) {
|
||||
throw err;
|
||||
} else {
|
||||
assert.notStrictEqual(null, buffer);
|
||||
deferred.resolve();
|
||||
}
|
||||
});
|
||||
}
|
||||
}).add('sharp-sequentialRead', {
|
||||
defer: true,
|
||||
fn: function(deferred) {
|
||||
|
||||
Reference in New Issue
Block a user