Store images as data when in a web worker.
More work may need to be done to transfer an image from a worker to the main thread, but this will at least prevent crashes.
This commit is contained in:
@@ -32,10 +32,11 @@ import lime.utils.UInt8Array;
|
|||||||
#if !display
|
#if !display
|
||||||
import lime._internal.backend.html5.HTML5HTTPRequest;
|
import lime._internal.backend.html5.HTML5HTTPRequest;
|
||||||
#end
|
#end
|
||||||
import js.html.CanvasElement;
|
|
||||||
import js.html.ImageElement;
|
|
||||||
import js.html.Image as JSImage;
|
|
||||||
import js.Browser;
|
import js.Browser;
|
||||||
|
import js.html.CanvasElement;
|
||||||
|
import js.html.Image as JSImage;
|
||||||
|
import js.html.ImageElement;
|
||||||
|
import lime._internal.backend.html5.HTML5Thread;
|
||||||
#elseif flash
|
#elseif flash
|
||||||
import flash.display.Bitmap;
|
import flash.display.Bitmap;
|
||||||
import flash.display.BitmapData;
|
import flash.display.BitmapData;
|
||||||
@@ -230,6 +231,13 @@ class Image
|
|||||||
{
|
{
|
||||||
#if (js && html5)
|
#if (js && html5)
|
||||||
type = CANVAS;
|
type = CANVAS;
|
||||||
|
|
||||||
|
#if lime_threads
|
||||||
|
if (HTML5Thread.current().isWorker())
|
||||||
|
{
|
||||||
|
type = DATA;
|
||||||
|
}
|
||||||
|
#end
|
||||||
#elseif flash
|
#elseif flash
|
||||||
type = FLASH;
|
type = FLASH;
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user