зеркало из https://github.com/mozilla/gecko-dev.git
Bug 746344 - gfxImageSurface should allow allocation without memset. r=jmuizelaar a=jpr
--HG-- extra : rebase_source : 271a72ec7911299d2a185df7c5139c00997e55df
This commit is contained in:
Родитель
c61e941e9f
Коммит
27feb4a559
|
@ -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();
|
||||
|
|
Загрузка…
Ссылка в новой задаче