diff --git a/gfx/thebes/gfxPlatformGtk.cpp b/gfx/thebes/gfxPlatformGtk.cpp index acef53403ca..30a6bfec810 100644 --- a/gfx/thebes/gfxPlatformGtk.cpp +++ b/gfx/thebes/gfxPlatformGtk.cpp @@ -16,6 +16,7 @@ #include "gfxPangoFonts.h" #include "gfxContext.h" #include "gfxUserFontSet.h" +#include "gfxUtils.h" #include "gfxFT2FontBase.h" #include "mozilla/gfx/2D.h" @@ -125,9 +126,7 @@ gfxPlatformGtk::CreateOffscreenSurface(const IntSize& size, } if (newSurface && needsClear) { - nsRefPtr tmpCtx = new gfxContext(newSurface); - tmpCtx->SetOperator(gfxContext::OPERATOR_CLEAR); - tmpCtx->Paint(); + gfxUtils::ClearThebesSurface(newSurface); } return newSurface.forget();