mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 664764. Part 3: Don't record memory used by gfxWindowsSurface if we actually failed to allocate the surface. r=mattwoodrow
This commit is contained in:
parent
4ba1788a98
commit
f17021b3aa
@ -104,9 +104,11 @@ gfxWindowsSurface::gfxWindowsSurface(HDC dc, const gfxIntSize& realSize, gfxImag
|
||||
|
||||
Init(surf);
|
||||
|
||||
// DDBs will generally only use 3 bytes per pixel when RGB24
|
||||
int bytesPerPixel = ((imageFormat == gfxASurface::ImageFormatRGB24) ? 3 : 4);
|
||||
RecordMemoryUsed(size.width * size.height * bytesPerPixel + sizeof(gfxWindowsSurface));
|
||||
if (mSurfaceValid) {
|
||||
// DDBs will generally only use 3 bytes per pixel when RGB24
|
||||
int bytesPerPixel = ((imageFormat == gfxASurface::ImageFormatRGB24) ? 3 : 4);
|
||||
RecordMemoryUsed(size.width * size.height * bytesPerPixel + sizeof(gfxWindowsSurface));
|
||||
}
|
||||
|
||||
if (CairoStatus() == 0)
|
||||
mDC = cairo_win32_surface_get_dc(CairoSurface());
|
||||
|
Loading…
Reference in New Issue
Block a user