Allow UI thread to be used

Where workers are not available, or if operations are trivial to run, the main UI thread can be used instead.  This also adds tests that run in real browsers.
This commit is contained in:
Tim Schaub
2015-07-21 17:10:44 -06:00
parent af3c38052e
commit 0c486c522a
4 changed files with 404 additions and 14 deletions

View File

@@ -4501,6 +4501,8 @@ olx.source.ImageVectorOptions.prototype.style;
/**
* @typedef {{sources: Array.<ol.source.Source>,
* operations: (Array.<ol.raster.Operation>|undefined),
* lib: (Object|undefined),
* threads: (number|undefined),
* operationType: (ol.raster.OperationType|undefined)}}
* @api
*/
@@ -4524,6 +4526,26 @@ olx.source.RasterOptions.prototype.sources;
olx.source.RasterOptions.prototype.operations;
/**
* Functions that will be made available to operations run in a worker.
* @type {Object|undefined}
* @api
*/
olx.source.RasterOptions.prototype.lib;
/**
* By default, operations will be run in a single worker thread. To avoid using
* workers altogether, set `threads: 0`. For pixel operations, operations can
* be run in multiple worker threads. Note that there some additional overhead
* in transferring data to multiple workers, and that depending on the user's
* system, it may not be possible to parallelize the work.
* @type {number|undefined}
* @api
*/
olx.source.RasterOptions.prototype.threads;
/**
* Operation type. Supported values are `'pixel'` and `'image'`. By default,
* `'pixel'` operations are assumed, and operations will be called with an