When using Thebes, we need to Flush the surface before drawing directly to the surface with GDI.

This commit is contained in:
pavlov%pavlov.net 2006-01-20 04:14:05 +00:00
Родитель 150ae470b9
Коммит 9df26bea25
1 изменённых файлов: 13 добавлений и 0 удалений

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

@ -775,6 +775,9 @@ nsNativeThemeWin::DrawWidgetBackground(nsIRenderingContext* aContext,
#ifdef MOZ_CAIRO_GFX
gfxContext *ctx = (gfxContext*)aContext->GetNativeGraphicData(nsIRenderingContext::NATIVE_THEBES_CONTEXT);
ctx->CurrentSurface()->Flush();
#if 0
gfxMatrix m = ctx->CurrentMatrix();
XFORM xform;
@ -1787,6 +1790,11 @@ nsresult nsNativeThemeWin::ClassicDrawWidgetBackground(nsIRenderingContext* aCon
nsRect tr(aRect);
transformMatrix->TransformCoord(&tr.x,&tr.y,&tr.width,&tr.height);
#ifdef MOZ_CAIRO_GFX
gfxContext *ctx = (gfxContext*)aContext->GetNativeGraphicData(nsIRenderingContext::NATIVE_THEBES_CONTEXT);
// flush the surface to make sure things are set up right
ctx->CurrentSurface()->Flush();
tr.x = NSToCoordRound(tr.x * T2P);
tr.y = NSToCoordRound(tr.y * T2P);
tr.width = NSToCoordRound(tr.width * T2P);
@ -2086,6 +2094,11 @@ nsresult nsNativeThemeWin::ClassicDrawWidgetBackground(nsIRenderingContext* aCon
break;
}
RestoreDC(hdc, -1);
#ifdef MOZ_CAIRO_GFX
ctx->CurrentSurface()->MarkDirty();
#endif
return rv;
}