b=568526 (related); add env var for switching 2d canvas to image surfaces; r=bz

This commit is contained in:
Vladimir Vukicevic 2010-05-28 21:13:08 -07:00
Родитель 34ebfb3b84
Коммит 8d6816b2c9
1 изменённых файлов: 7 добавлений и 2 удалений

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

@ -46,6 +46,7 @@
#endif
#include "prmem.h"
#include "prenv.h"
#include "nsIServiceManager.h"
@ -950,8 +951,12 @@ nsCanvasRenderingContext2D::SetDimensions(PRInt32 width, PRInt32 height)
if (mOpaque)
format = gfxASurface::ImageFormatRGB24;
surface = gfxPlatform::GetPlatform()->CreateOffscreenSurface
(gfxIntSize(width, height), format);
if (PR_GetEnv("MOZ_CANVAS_IMAGE_SURFACE")) {
surface = new gfxImageSurface(gfxIntSize(width, height), format);
} else {
surface = gfxPlatform::GetPlatform()->CreateOffscreenSurface
(gfxIntSize(width, height), format);
}
if (surface->CairoStatus() != 0) {
surface = NULL;