File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -421,6 +421,9 @@ cc._tmp.WebGLTexture2D = function () {
421
421
this . _webTextureObj = cc . _renderContext . createTexture ( ) ;
422
422
this . _htmlElementObj = element ;
423
423
this . _textureLoaded = true ;
424
+ // Textures should be loaded with premultiplied alpha in order to avoid gray bleeding
425
+ // when semitransparent textures are interpolated (e.g. when scaled).
426
+ this . _hasPremultipliedAlpha = true ;
424
427
} ,
425
428
426
429
/**
@@ -444,8 +447,11 @@ cc._tmp.WebGLTexture2D = function () {
444
447
* @param {Boolean } [premultiplied=false]
445
448
*/
446
449
handleLoadedTexture : function ( premultiplied ) {
447
- premultiplied = ( premultiplied === undefined ) ? false : premultiplied ;
448
450
var self = this ;
451
+ premultiplied =
452
+ ( premultiplied !== undefined )
453
+ ? premultiplied
454
+ : self . _hasPremultipliedAlpha ;
449
455
// Not sure about this ! Some texture need to be updated even after loaded
450
456
if ( ! cc . game . _rendererInitialized )
451
457
return ;
You can’t perform that action at this time.
0 commit comments