Bug 1083753, part 2 - Port the code that uses nsRenderingContext::FillRect(nsRect) to Moz2D. r=mattwoodrow

This commit is contained in:
Jonathan Watt
2014-10-19 13:22:22 +01:00
parent 6a0b572f7b
commit 40da0a5dbd
16 changed files with 108 additions and 141 deletions

View File

@@ -62,14 +62,18 @@ PaintIndeterminateMark(nsIFrame* aFrame,
const nsRect& aDirtyRect,
nsPoint aPt)
{
DrawTarget* drawTarget = aCtx->GetDrawTarget();
int32_t appUnitsPerDevPixel = aFrame->PresContext()->AppUnitsPerDevPixel();
nsRect rect(aPt, aFrame->GetSize());
rect.Deflate(aFrame->GetUsedBorderAndPadding());
rect.y += (rect.height - rect.height/4) / 2;
rect.height /= 4;
aCtx->SetColor(aFrame->StyleColor()->mColor);
aCtx->FillRect(rect);
Rect devPxRect = NSRectToRect(rect, appUnitsPerDevPixel, *drawTarget);
drawTarget->FillRect(devPxRect,
ColorPattern(ToDeviceColor(aFrame->StyleColor()->mColor)));
}
//------------------------------------------------------------