Merge pull request #1787 from pandamicro/master

Disable Image pool on most windows browsers
This commit is contained in:
Wang Nan
2017-07-07 13:54:15 +08:00
committed by GitHub
4 changed files with 18 additions and 5 deletions
+4
View File
@@ -76,6 +76,10 @@ cc.GridAction.getGrid(): it should be overridden in subclass.
Grid size must be (1,1)
### 1019
Failed to construct, Sequence construction needs two or more actions.
### 1100
Expected 'data' dict, but not found. Config file: %s
+7 -4
View File
@@ -1924,11 +1924,10 @@ cc.macro = {
};
/**
* @module cc
*/
/**
* !#en
* default gl blend src function. Compatible with premultiplied alpha images.
* !#zh
* 默认的混合源模式
* @property BLEND_SRC
* @type {Number}
*/
@@ -1942,6 +1941,10 @@ cc.defineGetterSetter(cc.macro, "BLEND_SRC", function (){
}
});
/**
* @module cc
*/
/**
* <p>
* Linear interpolation between 2 numbers, the ratio sets how much it is biased to each end
+2 -1
View File
@@ -196,7 +196,8 @@ var Texture2D = cc.Class(/** @lends cc.Texture2D# */{
},
/**
* HTMLElement Object getter.
* HTMLElement Object getter, available only on web.
* In most case, it will return null, because we are recycling the dom image element for better loading performance and lower image cache memory usage.
* @method getHtmlElementObj
* @return {HTMLImageElement|HTMLCanvasElement}
*/
+5
View File
@@ -24,6 +24,7 @@
****************************************************************************/
var JS = require('../platform/js');
var sys = require('../platform/CCSys');
var misc = exports;
@@ -123,6 +124,10 @@ misc.imagePool.get = function () {
return this._get() || new Image();
};
misc.imagePool._smallImg = "data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA=";
// Avoid problems on windows IE kernels, Edge, Firefox
if (sys.os === OS_WINDOWS && sys.browser !== sys.BROWSER_TYPE_CHROME) {
misc.imagePool.resize(0);
}
misc.isBuiltinClassId = function (id) {
return id.startsWith('cc.') || id.startsWith('dragonBones.') || id.startsWith('sp.') || id.startsWith('ccsg.');