Merge pull request #3617 from boyu0/bug2745_after_PerformanceTextureTest_render_error

closed #2745: fix bug: _dataLen not set at Image::initWithString() and I...
This commit is contained in:
minggo 2013-09-16 03:08:40 -07:00
commit 0fe28b7410
7 changed files with 8 additions and 0 deletions

View File

@ -170,6 +170,7 @@ bool Image::initWithString(
_height = (short)dc._height;
_preMulti = true;
_renderFormat = Texture2D::PixelFormat::RGBA8888;
_dataLen = _width * _height * 4;
bRet = true;
} while (0);
@ -221,6 +222,7 @@ bool Image::initWithStringShadowStroke(
_height = (short)dc._height;
_preMulti = true;
_renderFormat = Texture2D::PixelFormat::RGBA8888;
_dataLen = _width * _height * 4;
// swap the alpha channel (ARGB to RGBA)
swapAlphaChannel((unsigned int *)_data, (_width * _height) );

View File

@ -344,6 +344,7 @@ bool Image::initWithString(
_height = (short)dc.iMaxLineHeight;
_preMulti = true;
_renderFormat = Texture2D::PixelFormat::RGBA8888;
_dataLen = _width * _height * 4;
bRet = true;

View File

@ -375,6 +375,7 @@ bool Image::initWithStringShadowStroke(
_renderFormat = Texture2D::PixelFormat::RGBA8888;
_preMulti = info.isPremultipliedAlpha;
_data = info.data;
_dataLen = _width * _height * 4;
return true;
}

View File

@ -452,6 +452,7 @@ bool Image::initWithString(
_height = (short)dc.iMaxLineHeight;
_renderFormat = Texture2D::PixelFormat::RGBA8888;
_preMulti = true;
_dataLen = _width * _height * 4;
bRet = true;

View File

@ -222,6 +222,7 @@ bool Image::initWithString(
CC_SAFE_DELETE_ARRAY(_data);
}
_data = info.data;
_dataLen = _width * _height * 4;
return true;
}

View File

@ -464,6 +464,7 @@ bool Image::initWithString(
_height = (short)dc.iMaxLineHeight;
_preMulti = true;
_renderFormat = Texture2D::PixelFormat::RGBA8888;
_dataLen = _width * _height * 4;
bRet = true;

View File

@ -451,6 +451,7 @@ bool Image::initWithString(
_height = (short)dc.iMaxLineHeight;
_preMulti = true;
_renderFormat = Texture2D::PixelFormat::RGBA8888;
_dataLen = _width * _height * 4;
bRet = true;