Bug 942688 - Part2: Draw corner mask with Azure (r=mstange).

This commit is contained in:
Andreas Gal 2013-11-26 21:50:33 -08:00
parent ec6fa07244
commit 5ce9727faf

View File

@ -2363,9 +2363,12 @@ nsChildView::MaybeDrawRoundedCorners(GLManager* aManager, const nsIntRect& aRect
nsIntSize size(mDevPixelCornerRadius, mDevPixelCornerRadius);
mCornerMaskImage->UpdateIfNeeded(size, nsIntRegion(), ^(gfx::DrawTarget* drawTarget, const nsIntRegion& updateRegion) {
ClearRegion(drawTarget, updateRegion);
gfx::BorrowedCGContext borrow(drawTarget);
DrawTopLeftCornerMask(borrow.cg, mDevPixelCornerRadius);
borrow.Finish();
RefPtr<gfx::PathBuilder> builder = drawTarget->CreatePathBuilder();
builder->Arc(gfx::Point(mDevPixelCornerRadius, mDevPixelCornerRadius), mDevPixelCornerRadius, 0, 2.0f * M_PI);
RefPtr<gfx::Path> path = builder->Finish();
drawTarget->Fill(path,
gfx::ColorPattern(gfx::Color(1.0, 1.0, 1.0, 1.0)),
gfx::DrawOptions(1.0f, gfx::OP_SOURCE));
});
// Use operator destination in: multiply all 4 channels with source alpha.