Skip to content

Commit ad47883

Browse files
committed
Add ENABLE_IMAEG_POOL setting
1 parent 7bf6632 commit ad47883

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CCBoot.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ cc._canvas = null;
8282
cc.container = null;
8383
cc._gameDiv = null;
8484

85+
window.ENABLE_IMAEG_POOL = true;
86+
8587
/**
8688
* Iterate over an object or an array, executing a function for each matched element.
8789
* @param {object|array} obj
@@ -938,7 +940,7 @@ cc.loader = (function () {
938940
delete _queue[url];
939941
}
940942

941-
if (cc._renderType === cc.game.RENDER_TYPE_WEBGL) {
943+
if (ENABLE_IMAEG_POOL && cc._renderType === cc.game.RENDER_TYPE_WEBGL) {
942944
imagePool.put(img);
943945
}
944946
};

cocos2d/core/textures/TexturesWebGL.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,9 @@ cc._tmp.WebGLTexture2D = function () {
496496

497497
self._hasPremultipliedAlpha = premultiplied;
498498
self._hasMipmaps = false;
499-
self._htmlElementObj = null;
499+
if (ENABLE_IMAEG_POOL) {
500+
self._htmlElementObj = null;
501+
}
500502

501503
//dispatch load event to listener.
502504
self.dispatchEvent("load");

0 commit comments

Comments
 (0)