@@ -62,15 +62,13 @@ var canUseImageBitmapOptions = detectCreateImageBitmap( [
62
62
* Self-contained worker for fetching and decoding an image, returning an
63
63
* ImageBitmap to the main thread.
64
64
*/
65
- var Parser = ( function ( ) {
65
+ var ImageBitmapWorker = ( function ( ) {
66
66
67
- function Parser ( ) {
67
+ function ImageBitmapWorker ( ) {
68
68
this . callbackBuilder = null ;
69
- this . callbackProgress = null ;
70
69
}
71
70
72
- /* global self */
73
- Parser . prototype . parse = function ( input , options ) {
71
+ ImageBitmapWorker . prototype . parse = function ( input , options ) {
74
72
var imageBitmapCreator = ( options === undefined ) ? this . workerScope . createImageBitmap ( input ) : this . workerScope . createImageBitmap ( input , options ) ;
75
73
76
74
var scope = this ;
@@ -86,8 +84,6 @@ var Parser = (function () {
86
84
} ) . catch ( function ( error ) {
87
85
88
86
var errorMessage = 'THREE.ImageBitmapWorker: ' + error ;
89
- console . error ( errorMessage ) ;
90
-
91
87
scope . callbackBuilder (
92
88
{
93
89
cmd : 'error' ,
@@ -98,7 +94,7 @@ var Parser = (function () {
98
94
} ) ;
99
95
} ;
100
96
101
- return Parser ;
97
+ return ImageBitmapWorker ;
102
98
} ) ( ) ;
103
99
104
100
var createAbsolutePath = function ( href ) {
@@ -178,7 +174,7 @@ THREE.ImageBitmapLoader.prototype = {
178
174
workerCode += '/**\n' ;
179
175
workerCode += ' * This code was constructed by ImageBitmapLoader buildWorkerCode.\n' ;
180
176
workerCode += ' */\n\n' ;
181
- workerCode += funcBuildSingelton ( 'Parser' , 'Parser' , Parser ) ;
177
+ workerCode += funcBuildSingelton ( 'Parser' , 'Parser' , ImageBitmapWorker ) ;
182
178
183
179
return workerCode ;
184
180
} ;
@@ -210,16 +206,15 @@ THREE.ImageBitmapLoader.prototype = {
210
206
211
207
return response . blob ( ) ;
212
208
213
- } ) . then ( function ( arrayBuffer ) {
209
+ } ) . then ( function ( blob ) {
214
210
215
211
workerSupport . run (
216
212
{
217
213
data : {
218
- input : arrayBuffer ,
214
+ input : blob ,
219
215
options : scope . options
220
216
}
221
- } ,
222
- [ arrayBuffer . buffer ]
217
+ }
223
218
) ;
224
219
225
220
} )
0 commit comments