Merge pull request #1438 from zilongshanren/fix-label-opacity-rendering-performance

fix label opacity performance issue
This commit is contained in:
Wang Nan
2017-01-16 10:30:20 +08:00
committed by GitHub
2 changed files with 7 additions and 8 deletions
@@ -36,17 +36,21 @@
var colorDirty = locFlag & flags.colorDirty,
opacityDirty = locFlag & flags.opacityDirty;
if (colorDirty)
if (colorDirty) {
this._updateDisplayColor();
if (opacityDirty)
}
if (opacityDirty) {
this._updateDisplayOpacity();
this._notifyRegionStatus && this._notifyRegionStatus(_ccsg.Node.CanvasRenderCmd.RegionStatus.Dirty);
}
if(locFlag & dirtyFlags.contentDirty) {
this._notifyRegionStatus && this._notifyRegionStatus(_ccsg.Node.CanvasRenderCmd.RegionStatus.Dirty);
this._dirtyFlag &= ~dirtyFlags.contentDirty;
}
if (colorDirty || opacityDirty || (locFlag & flags.textDirty)) {
if (colorDirty || (locFlag & flags.textDirty)) {
this._notifyRegionStatus && this._notifyRegionStatus(_ccsg.Node.CanvasRenderCmd.RegionStatus.Dirty);
this._rebuildLabelSkin();
}
@@ -61,11 +61,6 @@ cc.js.mixin(proto, _ccsg.Label.TTFLabelBaker.prototype);
proto.constructor = _ccsg.Label.WebGLRenderCmd;
proto._updateDisplayOpacity = function (parentOpacity) {
_ccsg.Node.WebGLRenderCmd.prototype._updateDisplayOpacity.call(this, parentOpacity);
this._rebuildLabelSkin();
};
proto.transform = function (parentCmd, recursive) {
this.originTransform(parentCmd, recursive);