Bug 711063 - Part 7: Adjust Border rendering code for Azure-Thebes wrapper. r=roc

This commit is contained in:
Bas Schouten 2012-01-05 08:17:52 +01:00
Родитель 1897e8ad30
Коммит eac3fe19e3
1 изменённых файлов: 4 добавлений и 3 удалений

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

@ -1088,15 +1088,16 @@ nsCSSBorderRenderer::CreateCornerGradient(mozilla::css::Corner aCorner,
float gradientOffset;
if (mContext->OriginalSurface()->GetType() == gfxASurface::SurfaceTypeD2D ||
mContext->OriginalSurface()->GetType() == gfxASurface::SurfaceTypeQuartz)
if (mContext->IsCairo() &&
(mContext->OriginalSurface()->GetType() == gfxASurface::SurfaceTypeD2D ||
mContext->OriginalSurface()->GetType() == gfxASurface::SurfaceTypeQuartz))
{
// On quarz this doesn't do exactly the right thing, but it does do what
// most other browsers do and doing the 'right' thing seems to be
// hard with the quartz cairo backend.
gradientOffset = 0;
} else {
// When cairo does the gradient drawing this gives us pretty nice behavior!
// When cairo/Azure does the gradient drawing this gives us pretty nice behavior!
gradientOffset = 0.25 / sqrt(pow(mBorderWidths[cornerHeight[aCorner]], 2) +
pow(mBorderWidths[cornerHeight[aCorner]], 2));
}