Bug 746344 - gfxImageSurface should allow allocation without memset. r=jmuizelaar a=jpr

--HG--
extra : rebase_source : 271a72ec7911299d2a185df7c5139c00997e55df
This commit is contained in:
Benoit Girard 2012-04-17 17:55:11 -04:00
Родитель c61e941e9f
Коммит 27feb4a559
2 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -123,7 +123,7 @@ TryAllocAlignedBytes(size_t aSize)
#endif
}
gfxImageSurface::gfxImageSurface(const gfxIntSize& size, gfxImageFormat format) :
gfxImageSurface::gfxImageSurface(const gfxIntSize& size, gfxImageFormat format, bool aClear) :
mSize(size), mOwnsData(false), mData(nsnull), mFormat(format)
{
mStride = ComputeStride();
@ -139,7 +139,8 @@ gfxImageSurface::gfxImageSurface(const gfxIntSize& size, gfxImageFormat format)
mData = (unsigned char *) TryAllocAlignedBytes(mSize.height * mStride);
if (!mData)
return;
memset(mData, 0, mSize.height * mStride);
if (aClear)
memset(mData, 0, mSize.height * mStride);
}
mOwnsData = true;

Просмотреть файл

@ -71,7 +71,7 @@ public:
*
* @see gfxImageFormat
*/
gfxImageSurface(const gfxIntSize& size, gfxImageFormat format);
gfxImageSurface(const gfxIntSize& size, gfxImageFormat format, bool aClear = true);
gfxImageSurface(cairo_surface_t *csurf);
virtual ~gfxImageSurface();