mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 13:07:52 +00:00
Bug 812795 (Part 2) - Disable subpixel AA on SVG text when requested to. r=jwatt
This commit is contained in:
parent
5216dde30b
commit
72c629af31
@ -3058,7 +3058,8 @@ class nsDisplaySVGText : public nsDisplayItem {
|
||||
public:
|
||||
nsDisplaySVGText(nsDisplayListBuilder* aBuilder,
|
||||
SVGTextFrame* aFrame)
|
||||
: nsDisplayItem(aBuilder, aFrame)
|
||||
: nsDisplayItem(aBuilder, aFrame),
|
||||
mDisableSubpixelAA(false)
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsDisplaySVGText);
|
||||
NS_ABORT_IF_FALSE(aFrame, "Must have a frame!");
|
||||
@ -3071,10 +3072,15 @@ public:
|
||||
|
||||
NS_DISPLAY_DECL_NAME("nsDisplaySVGText", TYPE_SVG_TEXT)
|
||||
|
||||
virtual void DisableComponentAlpha() MOZ_OVERRIDE {
|
||||
mDisableSubpixelAA = true;
|
||||
}
|
||||
virtual void HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect,
|
||||
HitTestState* aState, nsTArray<nsIFrame*> *aOutFrames);
|
||||
virtual void Paint(nsDisplayListBuilder* aBuilder,
|
||||
nsRenderingContext* aCtx);
|
||||
private:
|
||||
bool mDisableSubpixelAA;
|
||||
};
|
||||
|
||||
void
|
||||
@ -3097,6 +3103,9 @@ void
|
||||
nsDisplaySVGText::Paint(nsDisplayListBuilder* aBuilder,
|
||||
nsRenderingContext* aCtx)
|
||||
{
|
||||
gfxContextAutoDisableSubpixelAntialiasing
|
||||
disable(aCtx->ThebesContext(), mDisableSubpixelAA);
|
||||
|
||||
// ToReferenceFrame includes our mRect offset, but painting takes
|
||||
// account of that too. To avoid double counting, we subtract that
|
||||
// here.
|
||||
|
Loading…
x
Reference in New Issue
Block a user