mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1209765 (Part 4) - Support sync decoding and track draw results when drawing borders in nsFieldSetFrame. r=tn
This commit is contained in:
parent
8a7848a0be
commit
3f4eeadbe7
@ -128,8 +128,7 @@ nsDisplayFieldSetBorderBackground::Paint(nsDisplayListBuilder* aBuilder,
|
||||
nsRenderingContext* aCtx)
|
||||
{
|
||||
DrawResult result = static_cast<nsFieldSetFrame*>(mFrame)->
|
||||
PaintBorderBackground(*aCtx, ToReferenceFrame(),
|
||||
mVisibleRect, aBuilder->GetBackgroundPaintFlags());
|
||||
PaintBorderBackground(aBuilder, *aCtx, ToReferenceFrame(), mVisibleRect);
|
||||
|
||||
nsDisplayItemGenericImageGeometry::UpdateDrawResult(this, result);
|
||||
}
|
||||
@ -210,8 +209,11 @@ nsFieldSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
}
|
||||
|
||||
DrawResult
|
||||
nsFieldSetFrame::PaintBorderBackground(nsRenderingContext& aRenderingContext,
|
||||
nsPoint aPt, const nsRect& aDirtyRect, uint32_t aBGFlags)
|
||||
nsFieldSetFrame::PaintBorderBackground(
|
||||
nsDisplayListBuilder* aBuilder,
|
||||
nsRenderingContext& aRenderingContext,
|
||||
nsPoint aPt,
|
||||
const nsRect& aDirtyRect)
|
||||
{
|
||||
// if the border is smaller than the legend. Move the border down
|
||||
// to be centered on the legend.
|
||||
@ -223,9 +225,14 @@ nsFieldSetFrame::PaintBorderBackground(nsRenderingContext& aRenderingContext,
|
||||
rect += aPt;
|
||||
nsPresContext* presContext = PresContext();
|
||||
|
||||
uint32_t bgFlags = aBuilder->GetBackgroundPaintFlags();
|
||||
PaintBorderFlags borderFlags = aBuilder->ShouldSyncDecodeImages()
|
||||
? PaintBorderFlags::SYNC_DECODE_IMAGES
|
||||
: PaintBorderFlags();
|
||||
|
||||
DrawResult result =
|
||||
nsCSSRendering::PaintBackground(presContext, aRenderingContext, this,
|
||||
aDirtyRect, rect, aBGFlags);
|
||||
aDirtyRect, rect, bgFlags);
|
||||
|
||||
nsCSSRendering::PaintBoxShadowInner(presContext, aRenderingContext,
|
||||
this, rect, aDirtyRect);
|
||||
@ -253,8 +260,9 @@ nsFieldSetFrame::PaintBorderBackground(nsRenderingContext& aRenderingContext,
|
||||
gfx->Save();
|
||||
gfx->Clip(NSRectToSnappedRect(clipRect.GetPhysicalRect(wm, rect.Size()),
|
||||
appUnitsPerDevPixel, *drawTarget));
|
||||
nsCSSRendering::PaintBorder(presContext, aRenderingContext, this,
|
||||
aDirtyRect, rect, mStyleContext);
|
||||
result &=
|
||||
nsCSSRendering::PaintBorder(presContext, aRenderingContext, this,
|
||||
aDirtyRect, rect, mStyleContext, borderFlags);
|
||||
gfx->Restore();
|
||||
|
||||
// draw inline-end portion of the block-start side of the border
|
||||
@ -266,8 +274,9 @@ nsFieldSetFrame::PaintBorderBackground(nsRenderingContext& aRenderingContext,
|
||||
gfx->Save();
|
||||
gfx->Clip(NSRectToSnappedRect(clipRect.GetPhysicalRect(wm, rect.Size()),
|
||||
appUnitsPerDevPixel, *drawTarget));
|
||||
nsCSSRendering::PaintBorder(presContext, aRenderingContext, this,
|
||||
aDirtyRect, rect, mStyleContext);
|
||||
result &=
|
||||
nsCSSRendering::PaintBorder(presContext, aRenderingContext, this,
|
||||
aDirtyRect, rect, mStyleContext, borderFlags);
|
||||
gfx->Restore();
|
||||
|
||||
// draw remainder of the border (omitting the block-start side)
|
||||
@ -278,14 +287,15 @@ nsFieldSetFrame::PaintBorderBackground(nsRenderingContext& aRenderingContext,
|
||||
gfx->Save();
|
||||
gfx->Clip(NSRectToSnappedRect(clipRect.GetPhysicalRect(wm, rect.Size()),
|
||||
appUnitsPerDevPixel, *drawTarget));
|
||||
nsCSSRendering::PaintBorder(presContext, aRenderingContext, this,
|
||||
aDirtyRect, rect, mStyleContext);
|
||||
result &=
|
||||
nsCSSRendering::PaintBorder(presContext, aRenderingContext, this,
|
||||
aDirtyRect, rect, mStyleContext, borderFlags);
|
||||
gfx->Restore();
|
||||
} else {
|
||||
nsCSSRendering::PaintBorder(presContext, aRenderingContext, this,
|
||||
aDirtyRect,
|
||||
nsRect(aPt, mRect.Size()),
|
||||
mStyleContext);
|
||||
result &=
|
||||
nsCSSRendering::PaintBorder(presContext, aRenderingContext, this,
|
||||
aDirtyRect, nsRect(aPt, mRect.Size()),
|
||||
mStyleContext, borderFlags);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -50,9 +50,9 @@ public:
|
||||
const nsRect& aDirtyRect,
|
||||
const nsDisplayListSet& aLists) override;
|
||||
|
||||
DrawResult PaintBorderBackground(nsRenderingContext& aRenderingContext,
|
||||
nsPoint aPt, const nsRect& aDirtyRect,
|
||||
uint32_t aBGFlags);
|
||||
DrawResult PaintBorderBackground(nsDisplayListBuilder* aBuilder,
|
||||
nsRenderingContext& aRenderingContext,
|
||||
nsPoint aPt, const nsRect& aDirtyRect);
|
||||
|
||||
#ifdef DEBUG
|
||||
virtual void SetInitialChildList(ChildListID aListID,
|
||||
|
Loading…
Reference in New Issue
Block a user