b=328241, antialiasing problem with joining borders, temporary diable-aa fix for non-rounded borders, r=dbaron

This commit is contained in:
vladimir%pobox.com 2006-04-21 17:52:05 +00:00
parent 6f1bd4dc40
commit 97d6375b31
2 changed files with 21 additions and 1 deletions

View File

@ -386,11 +386,18 @@ void gfxContext::PixelSnappedRectangleAndSetPattern(const gfxRect& rect,
void gfxContext::SetAntialiasMode(AntialiasMode mode)
{
// XXX implement me
if (mode == MODE_ALIASED) {
cairo_set_antialias(mCairo, CAIRO_ANTIALIAS_NONE);
} else if (mode == MODE_COVERAGE) {
cairo_set_antialias(mCairo, CAIRO_ANTIALIAS_DEFAULT);
}
}
gfxContext::AntialiasMode gfxContext::CurrentAntialiasMode() const
{
cairo_antialias_t aa = cairo_get_antialias(mCairo);
if (aa == CAIRO_ANTIALIAS_NONE)
return MODE_ALIASED;
return MODE_COVERAGE;
}

View File

@ -73,6 +73,10 @@
#include "nsLayoutUtils.h"
#include "nsINameSpaceManager.h"
#ifdef MOZ_CAIRO_GFX
#include "gfxContext.h"
#endif
#define BORDER_FULL 0 //entire side
#define BORDER_INSIDE 1 //inside half
#define BORDER_OUTSIDE 2 //outside half
@ -1825,6 +1829,11 @@ void nsCSSRendering::PaintBorder(nsPresContext* aPresContext,
nscolor sideColor;
nsBorderColors* compositeColors = nsnull;
#ifdef MOZ_CAIRO_GFX
gfxContext *ctx = (gfxContext*) aRenderingContext.GetNativeGraphicData(nsIRenderingContext::NATIVE_THEBES_CONTEXT);
ctx->SetAntialiasMode(gfxContext::MODE_ALIASED);
#endif
for (cnt = 0; cnt < 4; cnt++) {
PRUint8 side = sideOrder[cnt];
@ -1855,6 +1864,10 @@ void nsCSSRendering::PaintBorder(nsPresContext* aPresContext,
}
}
}
#ifdef MOZ_CAIRO_GFX
ctx->SetAntialiasMode(gfxContext::MODE_COVERAGE);
#endif
}
void nsCSSRendering::DrawCompositeSide(nsIRenderingContext& aRenderingContext,