Bug 929484 - Remove nsTableBorderBackground displayitem and nsTablePainter. r=mstange

MozReview-Commit-ID: 1HmfGyBqWnf
This commit is contained in:
Morris Tseng
2017-05-04 17:32:08 +08:00
parent c7ae09f56f
commit e6760ea6c7
12 changed files with 0 additions and 1161 deletions

View File

@@ -23,7 +23,6 @@
#include "nsTableRowFrame.h"
#include "nsTableRowGroupFrame.h"
#include "nsTableWrapperFrame.h"
#include "nsTablePainter.h"
#include "BasicTableLayoutStrategy.h"
#include "FixedTableLayoutStrategy.h"
@@ -1278,36 +1277,6 @@ nsDisplayTableBorderCollapse::Paint(nsDisplayListBuilder* aBuilder,
static_cast<nsTableFrame*>(mFrame)->PaintBCBorders(*drawTarget, mVisibleRect - pt);
}
class nsDisplayTableBorderBackground : public nsDisplayTableItem {
public:
nsDisplayTableBorderBackground(nsDisplayListBuilder* aBuilder,
nsTableFrame* aFrame,
bool aDrawsBackground) :
nsDisplayTableItem(aBuilder, aFrame, aDrawsBackground) {
MOZ_COUNT_CTOR(nsDisplayTableBorderBackground);
}
#ifdef NS_BUILD_REFCNT_LOGGING
virtual ~nsDisplayTableBorderBackground() {
MOZ_COUNT_DTOR(nsDisplayTableBorderBackground);
}
#endif
virtual void Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) override;
NS_DISPLAY_DECL_NAME("TableBorderBackground", TYPE_TABLE_BORDER_BACKGROUND)
};
void
nsDisplayTableBorderBackground::Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx)
{
DrawResult result = static_cast<nsTableFrame*>(mFrame)->
PaintTableBorderBackground(aBuilder, *aCtx, mVisibleRect,
ToReferenceFrame());
nsDisplayTableItemGeometry::UpdateDrawResult(this, result);
}
/* static */ void
nsTableFrame::GenericTraversal(nsDisplayListBuilder* aBuilder, nsFrame* aFrame,
const nsRect& aDirtyRect, const nsDisplayListSet& aLists)
@@ -1516,59 +1485,6 @@ nsTableFrame::GetDeflationForBackground(nsPresContext* aPresContext) const
return GetOuterBCBorder(wm).GetPhysicalMargin(wm);
}
// XXX We don't put the borders and backgrounds in tree order like we should.
// That requires some major surgery which we aren't going to do right now.
DrawResult
nsTableFrame::PaintTableBorderBackground(nsDisplayListBuilder* aBuilder,
nsRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsPoint aPt)
{
nsPresContext* presContext = PresContext();
uint32_t bgFlags = aBuilder->GetBackgroundPaintFlags();
PaintBorderFlags borderFlags = aBuilder->ShouldSyncDecodeImages()
? PaintBorderFlags::SYNC_DECODE_IMAGES
: PaintBorderFlags();
TableBackgroundPainter painter(this, TableBackgroundPainter::eOrigin_Table,
presContext, aRenderingContext,
aDirtyRect, aPt, bgFlags);
nsMargin deflate = GetDeflationForBackground(presContext);
// If 'deflate' is (0,0,0,0) then we'll paint the table background
// in a separate display item, so don't do it here.
DrawResult result =
painter.PaintTable(this, deflate, deflate != nsMargin(0, 0, 0, 0));
if (StyleVisibility()->IsVisible()) {
if (!IsBorderCollapse()) {
Sides skipSides = GetSkipSides();
nsRect rect(aPt, mRect.Size());
result &=
nsCSSRendering::PaintBorder(presContext, aRenderingContext, this,
aDirtyRect, rect, mStyleContext,
borderFlags, skipSides);
} else {
DrawTarget* drawTarget = aRenderingContext.GetDrawTarget();
gfxPoint devPixelOffset =
nsLayoutUtils::PointToGfxPoint(aPt,
PresContext()->AppUnitsPerDevPixel());
// XXX we should probably get rid of this translation at some stage
// But that would mean modifying PaintBCBorders, ugh
AutoRestoreTransform autoRestoreTransform(drawTarget);
drawTarget->SetTransform(
drawTarget->GetTransform().PreTranslate(ToPoint(devPixelOffset)));
PaintBCBorders(*drawTarget, aDirtyRect - aPt);
}
}
return result;
}
nsIFrame::LogicalSides
nsTableFrame::GetLogicalSkipSides(const ReflowInput* aReflowInput) const
{