mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 06:36:11 +03:00
Revert "- Undo removing prefixUrl option in memorycheck-with-simple-image demo."
This reverts commit 344ddb924f
.
This commit is contained in:
parent
344ddb924f
commit
c2ed66415f
@ -196,16 +196,11 @@
|
||||
return context;
|
||||
},
|
||||
/**
|
||||
* Free up canvas memory
|
||||
* (iOS 12 or higher on 2GB RAM device has only 224MB canvas memory,
|
||||
* and Safari keeps canvas until its height and width will be set to 0).
|
||||
* Destroys ImageTileSource
|
||||
* @function
|
||||
*/
|
||||
freeupCanvasMemory: function () {
|
||||
for (var i = 0; i < this.levels.length; i++) {
|
||||
this.levels[i].context2D.canvas.height = 0;
|
||||
this.levels[i].context2D.canvas.width = 0;
|
||||
}
|
||||
destroy: function () {
|
||||
this._freeupCanvasMemory();
|
||||
},
|
||||
|
||||
// private
|
||||
@ -270,7 +265,19 @@
|
||||
bigContext = smallContext;
|
||||
}
|
||||
return levels;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Free up canvas memory
|
||||
* (iOS 12 or higher on 2GB RAM device has only 224MB canvas memory,
|
||||
* and Safari keeps canvas until its height and width will be set to 0).
|
||||
* @function
|
||||
*/
|
||||
_freeupCanvasMemory: function () {
|
||||
for (var i = 0; i < this.levels.length; i++) {
|
||||
this.levels[i].context2D.canvas.height = 0;
|
||||
this.levels[i].context2D.canvas.width = 0;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
}(OpenSeadragon));
|
||||
|
@ -615,17 +615,7 @@ $.TileSource.prototype = {
|
||||
y >= 0 &&
|
||||
x < numTiles.x &&
|
||||
y < numTiles.y;
|
||||
},
|
||||
|
||||
/**
|
||||
* Destroys TileSource
|
||||
* @function
|
||||
*/
|
||||
destroy: function () {
|
||||
if ( this.freeupCanvasMemory ) {
|
||||
this.freeupCanvasMemory();
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
@ -742,7 +742,10 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
|
||||
return;
|
||||
}
|
||||
|
||||
this.source.destroy();
|
||||
//TODO: implement destroy and _freeupCanvasMemory method for all child classes of TileSource, then remove if statement wrap below.
|
||||
if (this.source.destroy) {
|
||||
this.source.destroy();
|
||||
}
|
||||
|
||||
this.close();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user