Commit c12f0487 authored by hyatt's avatar hyatt

Implement phased painting to correct the paint order of blocks,

	floats, and inlines.

        * khtml/rendering/render_body.cpp:
        (RenderBody::paintBoxDecorations):
        * khtml/rendering/render_body.h:
        * khtml/rendering/render_box.cpp:
        (RenderBox::paint):
        (RenderBox::paintBoxDecorations):
        (RenderBox::paintBackground):
        * khtml/rendering/render_box.h:
        * khtml/rendering/render_br.h:
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::paint):
        (RenderFlow::paintObject):
        (RenderFlow::paintFloats):
        (RenderFlow::addChild):
        * khtml/rendering/render_flow.h:
        * khtml/rendering/render_html.cpp:
        (RenderHtml::setStyle):
        (RenderHtml::paint):
        (RenderHtml::paintBoxDecorations):
        * khtml/rendering/render_html.h:
        * khtml/rendering/render_image.cpp:
        (RenderImage::setStyle):
        (RenderImage::paintObject):
        * khtml/rendering/render_image.h:
        * khtml/rendering/render_layer.cpp:
        (RenderLayer::paint):
        (RenderLayer::nodeAtPoint):
        * khtml/rendering/render_list.cpp:
        (RenderListItem::paint):
        (RenderListItem::paintObject):
        (RenderListMarker::paint):
        (RenderListMarker::paintObject):
        * khtml/rendering/render_list.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::RenderObject):
        (RenderObject::paintBorder):
        (RenderObject::paintOutline):
        (RenderObject::paint):
        (RenderObject::dump):
        (RenderObject::setStyle):
        * khtml/rendering/render_object.h:
        * khtml/rendering/render_replaced.cpp:
        (RenderReplaced::paint):
        (RenderWidget::setStyle):
        (RenderWidget::paintObject):
        * khtml/rendering/render_replaced.h:
        * khtml/rendering/render_root.cpp:
        (RenderRoot::paint):
        (RenderRoot::paintObject):
        * khtml/rendering/render_root.h:
        * khtml/rendering/render_table.cpp:
        (RenderTable::paint):
        (RenderTableCell::RenderTableCell):
        (RenderTableCell::setStyle):
        (RenderTableCell::paint):
        (RenderTableCell::paintBoxDecorations):
        * khtml/rendering/render_table.h:
        * khtml/rendering/render_text.cpp:
        (TextSlave::paintSelection):
        (TextSlave::paintDecoration):
        (TextSlave::paintBoxDecorations):
        (RenderText::paintObject):
        (RenderText::paint):
        (RenderText::paintTextOutline):
        * khtml/rendering/render_text.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2752 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f1fce4bd
2002-11-18 David Hyatt <hyatt@apple.com>
Implement phased painting to correct the paint order of blocks,
floats, and inlines.
* khtml/rendering/render_body.cpp:
(RenderBody::paintBoxDecorations):
* khtml/rendering/render_body.h:
* khtml/rendering/render_box.cpp:
(RenderBox::paint):
(RenderBox::paintBoxDecorations):
(RenderBox::paintBackground):
* khtml/rendering/render_box.h:
* khtml/rendering/render_br.h:
* khtml/rendering/render_flow.cpp:
(RenderFlow::paint):
(RenderFlow::paintObject):
(RenderFlow::paintFloats):
(RenderFlow::addChild):
* khtml/rendering/render_flow.h:
* khtml/rendering/render_html.cpp:
(RenderHtml::setStyle):
(RenderHtml::paint):
(RenderHtml::paintBoxDecorations):
* khtml/rendering/render_html.h:
* khtml/rendering/render_image.cpp:
(RenderImage::setStyle):
(RenderImage::paintObject):
* khtml/rendering/render_image.h:
* khtml/rendering/render_layer.cpp:
(RenderLayer::paint):
(RenderLayer::nodeAtPoint):
* khtml/rendering/render_list.cpp:
(RenderListItem::paint):
(RenderListItem::paintObject):
(RenderListMarker::paint):
(RenderListMarker::paintObject):
* khtml/rendering/render_list.h:
* khtml/rendering/render_object.cpp:
(RenderObject::RenderObject):
(RenderObject::paintBorder):
(RenderObject::paintOutline):
(RenderObject::paint):
(RenderObject::dump):
(RenderObject::setStyle):
* khtml/rendering/render_object.h:
* khtml/rendering/render_replaced.cpp:
(RenderReplaced::paint):
(RenderWidget::setStyle):
(RenderWidget::paintObject):
* khtml/rendering/render_replaced.h:
* khtml/rendering/render_root.cpp:
(RenderRoot::paint):
(RenderRoot::paintObject):
* khtml/rendering/render_root.h:
* khtml/rendering/render_table.cpp:
(RenderTable::paint):
(RenderTableCell::RenderTableCell):
(RenderTableCell::setStyle):
(RenderTableCell::paint):
(RenderTableCell::paintBoxDecorations):
* khtml/rendering/render_table.h:
* khtml/rendering/render_text.cpp:
(TextSlave::paintSelection):
(TextSlave::paintDecoration):
(TextSlave::paintBoxDecorations):
(RenderText::paintObject):
(RenderText::paint):
(RenderText::paintTextOutline):
* khtml/rendering/render_text.h:
2002-11-18 Darin Adler <darin@apple.com>
* force-js-clean-timestamp: I changed the size of ObjectImp.
......
2002-11-18 David Hyatt <hyatt@apple.com>
Implement phased painting to correct the paint order of blocks,
floats, and inlines.
* khtml/rendering/render_body.cpp:
(RenderBody::paintBoxDecorations):
* khtml/rendering/render_body.h:
* khtml/rendering/render_box.cpp:
(RenderBox::paint):
(RenderBox::paintBoxDecorations):
(RenderBox::paintBackground):
* khtml/rendering/render_box.h:
* khtml/rendering/render_br.h:
* khtml/rendering/render_flow.cpp:
(RenderFlow::paint):
(RenderFlow::paintObject):
(RenderFlow::paintFloats):
(RenderFlow::addChild):
* khtml/rendering/render_flow.h:
* khtml/rendering/render_html.cpp:
(RenderHtml::setStyle):
(RenderHtml::paint):
(RenderHtml::paintBoxDecorations):
* khtml/rendering/render_html.h:
* khtml/rendering/render_image.cpp:
(RenderImage::setStyle):
(RenderImage::paintObject):
* khtml/rendering/render_image.h:
* khtml/rendering/render_layer.cpp:
(RenderLayer::paint):
(RenderLayer::nodeAtPoint):
* khtml/rendering/render_list.cpp:
(RenderListItem::paint):
(RenderListItem::paintObject):
(RenderListMarker::paint):
(RenderListMarker::paintObject):
* khtml/rendering/render_list.h:
* khtml/rendering/render_object.cpp:
(RenderObject::RenderObject):
(RenderObject::paintBorder):
(RenderObject::paintOutline):
(RenderObject::paint):
(RenderObject::dump):
(RenderObject::setStyle):
* khtml/rendering/render_object.h:
* khtml/rendering/render_replaced.cpp:
(RenderReplaced::paint):
(RenderWidget::setStyle):
(RenderWidget::paintObject):
* khtml/rendering/render_replaced.h:
* khtml/rendering/render_root.cpp:
(RenderRoot::paint):
(RenderRoot::paintObject):
* khtml/rendering/render_root.h:
* khtml/rendering/render_table.cpp:
(RenderTable::paint):
(RenderTableCell::RenderTableCell):
(RenderTableCell::setStyle):
(RenderTableCell::paint):
(RenderTableCell::paintBoxDecorations):
* khtml/rendering/render_table.h:
* khtml/rendering/render_text.cpp:
(TextSlave::paintSelection):
(TextSlave::paintDecoration):
(TextSlave::paintBoxDecorations):
(RenderText::paintObject):
(RenderText::paint):
(RenderText::paintTextOutline):
* khtml/rendering/render_text.h:
2002-11-18 Darin Adler <darin@apple.com>
* force-js-clean-timestamp: I changed the size of ObjectImp.
......
2002-11-18 David Hyatt <hyatt@apple.com>
Implement phased painting to correct the paint order of blocks,
floats, and inlines.
* khtml/rendering/render_body.cpp:
(RenderBody::paintBoxDecorations):
* khtml/rendering/render_body.h:
* khtml/rendering/render_box.cpp:
(RenderBox::paint):
(RenderBox::paintBoxDecorations):
(RenderBox::paintBackground):
* khtml/rendering/render_box.h:
* khtml/rendering/render_br.h:
* khtml/rendering/render_flow.cpp:
(RenderFlow::paint):
(RenderFlow::paintObject):
(RenderFlow::paintFloats):
(RenderFlow::addChild):
* khtml/rendering/render_flow.h:
* khtml/rendering/render_html.cpp:
(RenderHtml::setStyle):
(RenderHtml::paint):
(RenderHtml::paintBoxDecorations):
* khtml/rendering/render_html.h:
* khtml/rendering/render_image.cpp:
(RenderImage::setStyle):
(RenderImage::paintObject):
* khtml/rendering/render_image.h:
* khtml/rendering/render_layer.cpp:
(RenderLayer::paint):
(RenderLayer::nodeAtPoint):
* khtml/rendering/render_list.cpp:
(RenderListItem::paint):
(RenderListItem::paintObject):
(RenderListMarker::paint):
(RenderListMarker::paintObject):
* khtml/rendering/render_list.h:
* khtml/rendering/render_object.cpp:
(RenderObject::RenderObject):
(RenderObject::paintBorder):
(RenderObject::paintOutline):
(RenderObject::paint):
(RenderObject::dump):
(RenderObject::setStyle):
* khtml/rendering/render_object.h:
* khtml/rendering/render_replaced.cpp:
(RenderReplaced::paint):
(RenderWidget::setStyle):
(RenderWidget::paintObject):
* khtml/rendering/render_replaced.h:
* khtml/rendering/render_root.cpp:
(RenderRoot::paint):
(RenderRoot::paintObject):
* khtml/rendering/render_root.h:
* khtml/rendering/render_table.cpp:
(RenderTable::paint):
(RenderTableCell::RenderTableCell):
(RenderTableCell::setStyle):
(RenderTableCell::paint):
(RenderTableCell::paintBoxDecorations):
* khtml/rendering/render_table.h:
* khtml/rendering/render_text.cpp:
(TextSlave::paintSelection):
(TextSlave::paintDecoration):
(TextSlave::paintBoxDecorations):
(RenderText::paintObject):
(RenderText::paint):
(RenderText::paintTextOutline):
* khtml/rendering/render_text.h:
2002-11-18 Darin Adler <darin@apple.com>
* force-js-clean-timestamp: I changed the size of ObjectImp.
......
......@@ -49,10 +49,10 @@ void RenderBody::setStyle(RenderStyle* style)
scrollbarsStyled = false;
}
void RenderBody::printBoxDecorations(QPainter *p,int, int _y,
int, int _h, int _tx, int _ty)
void RenderBody::paintBoxDecorations(QPainter *p,int, int _y,
int, int _h, int _tx, int _ty)
{
//kdDebug( 6040 ) << renderName() << "::printDecorations()" << endl;
//kdDebug( 6040 ) << renderName() << "::paintBoxDecorations()" << endl;
QColor c;
CachedImage *bg = 0;
......@@ -72,10 +72,10 @@ void RenderBody::printBoxDecorations(QPainter *p,int, int _y,
else
mh = QMIN(_h,h);
printBackground(p, c, bg, my, mh, _tx, _ty, w, h);
paintBackground(p, c, bg, my, mh, _tx, _ty, w, h);
if(style()->hasBorder())
printBorder(p, _tx, _ty, w, h, style());
paintBorder(p, _tx, _ty, w, h, style());
}
void RenderBody::repaint(bool immediate)
......
......@@ -48,7 +48,7 @@ public:
virtual void setStyle(RenderStyle* style);
protected:
virtual void printBoxDecorations(QPainter *p,int _x, int _y,
virtual void paintBoxDecorations(QPainter *p,int _x, int _y,
int _w, int _h, int _tx, int _ty);
bool scrollbarsStyled;
};
......
......@@ -143,10 +143,10 @@ int RenderBox::height() const
}
// --------------------- printing stuff -------------------------------
// --------------------- painting stuff -------------------------------
void RenderBox::print(QPainter *p, int _x, int _y, int _w, int _h,
int _tx, int _ty)
void RenderBox::paint(QPainter *p, int _x, int _y, int _w, int _h,
int _tx, int _ty, int paintPhase)
{
_tx += m_x;
_ty += m_y;
......@@ -155,7 +155,7 @@ void RenderBox::print(QPainter *p, int _x, int _y, int _w, int _h,
RenderObject *child = firstChild();
while(child != 0)
{
child->print(p, _x, _y, _w, _h, _tx, _ty);
child->paint(p, _x, _y, _w, _h, _tx, _ty, paintPhase);
child = child->nextSibling();
}
}
......@@ -167,10 +167,10 @@ void RenderBox::setPixmap(const QPixmap &, const QRect&, CachedImage *image)
}
void RenderBox::printBoxDecorations(QPainter *p,int, int _y,
int, int _h, int _tx, int _ty)
void RenderBox::paintBoxDecorations(QPainter *p,int, int _y,
int, int _h, int _tx, int _ty)
{
//kdDebug( 6040 ) << renderName() << "::printDecorations()" << endl;
//kdDebug( 6040 ) << renderName() << "::paintDecorations()" << endl;
int w = width();
int h = height() + borderTopExtra() + borderBottomExtra();
......@@ -183,13 +183,13 @@ void RenderBox::printBoxDecorations(QPainter *p,int, int _y,
else
mh = QMIN(_h,h);
printBackground(p, style()->backgroundColor(), style()->backgroundImage(), my, mh, _tx, _ty, w, h);
paintBackground(p, style()->backgroundColor(), style()->backgroundImage(), my, mh, _tx, _ty, w, h);
if(style()->hasBorder())
printBorder(p, _tx, _ty, w, h, style());
paintBorder(p, _tx, _ty, w, h, style());
}
void RenderBox::printBackground(QPainter *p, const QColor &c, CachedImage *bg, int clipy, int cliph, int _tx, int _ty, int w, int h)
void RenderBox::paintBackground(QPainter *p, const QColor &c, CachedImage *bg, int clipy, int cliph, int _tx, int _ty, int w, int h)
{
if(c.isValid())
p->fillRect(_tx, clipy, w, cliph, c);
......
......@@ -44,8 +44,8 @@ public:
virtual const char *renderName() const { return "RenderBox"; }
virtual void setStyle(RenderStyle *style);
virtual void print(QPainter *p, int _x, int _y, int _w, int _h,
int _tx, int _ty);
virtual void paint(QPainter *p, int _x, int _y, int _w, int _h,
int _tx, int _ty, int paintPhase);
virtual void close();
......@@ -106,9 +106,9 @@ public:
virtual RenderLayer* layer() const { return m_layer; }
protected:
virtual void printBoxDecorations(QPainter *p,int _x, int _y,
int _w, int _h, int _tx, int _ty);
void printBackground(QPainter *p, const QColor &c, CachedImage *bg, int clipy, int cliph, int _tx, int _ty, int w, int h);
virtual void paintBoxDecorations(QPainter *p,int _x, int _y,
int _w, int _h, int _tx, int _ty);
void paintBackground(QPainter *p, const QColor &c, CachedImage *bg, int clipy, int cliph, int _tx, int _ty, int w, int h);
void outlineBox(QPainter *p, int _tx, int _ty, const char *color = "red");
virtual int borderTopExtra() { return 0; }
......
......@@ -38,8 +38,8 @@ public:
virtual const char *renderName() const { return "RenderBR"; }
virtual void print( QPainter *, int, int, int, int, int, int) {}
virtual void printObject( QPainter *, int, int, int, int, int, int) {}
virtual void paint( QPainter *, int, int, int, int, int, int, int) {}
virtual void paintObject( QPainter *, int, int, int, int, int, int, int) {}
virtual void position(int, int, int, int, int, bool, bool, int) {}
virtual unsigned int width(unsigned int, unsigned int, const Font *) const { return 0; }
......
......@@ -104,8 +104,8 @@ RenderFlow::~RenderFlow()
delete specialObjects;
}
void RenderFlow::print(QPainter *p, int _x, int _y, int _w, int _h,
int _tx, int _ty)
void RenderFlow::paint(QPainter *p, int _x, int _y, int _w, int _h,
int _tx, int _ty, int paintPhase)
{
#ifdef DEBUG_LAYOUT
......@@ -130,35 +130,38 @@ void RenderFlow::print(QPainter *p, int _x, int _y, int _w, int _h,
}
}
printObject(p, _x, _y, _w, _h, _tx, _ty);
paintObject(p, _x, _y, _w, _h, _tx, _ty, paintPhase);
}
void RenderFlow::printObject(QPainter *p, int _x, int _y,
int _w, int _h, int _tx, int _ty)
void RenderFlow::paintObject(QPainter *p, int _x, int _y,
int _w, int _h, int _tx, int _ty, int paintPhase)
{
#ifdef DEBUG_LAYOUT
// kdDebug( 6040 ) << renderName() << "(RenderFlow) " << this << " ::printObject() w/h = (" << width() << "/" << height() << ")" << endl;
// kdDebug( 6040 ) << renderName() << "(RenderFlow) " << this << " ::paintObject() w/h = (" << width() << "/" << height() << ")" << endl;
#endif
// 1. print background, borders etc
if(hasSpecialObjects() && !isInline() && style()->visibility() == VISIBLE )
printBoxDecorations(p, _x, _y, _w, _h, _tx, _ty);
// 1. paint background, borders etc
if (paintPhase == BACKGROUND_PHASE &&
shouldPaintBackgroundOrBorder() && !isInline() && style()->visibility() == VISIBLE )
paintBoxDecorations(p, _x, _y, _w, _h, _tx, _ty);
// 2. print contents
// 2. paint contents
RenderObject *child = firstChild();
while(child != 0)
{
if(!child->layer() && !child->isFloating())
child->print(p, _x, _y, _w, _h, _tx, _ty);
child->paint(p, _x, _y, _w, _h, _tx, _ty, paintPhase);
child = child->nextSibling();
}
// 3. paint floats.
paintFloats(p, _x, _y, _w, _h, _tx, _ty);
if (paintPhase == FLOAT_PHASE)
paintFloats(p, _x, _y, _w, _h, _tx, _ty);
if(!isInline() && !childrenInline() && style()->outlineWidth())
printOutline(p, _tx, _ty, width(), height(), style());
if (paintPhase == BACKGROUND_PHASE &&
!isInline() && !childrenInline() && style()->outlineWidth())
paintOutline(p, _tx, _ty, width(), height(), style());
#ifdef BOX_DEBUG
if ( style() && style()->visibility() == VISIBLE ) {
......@@ -184,9 +187,18 @@ void RenderFlow::paintFloats(QPainter *p, int _x, int _y,
for ( ; (r = it.current()); ++it) {
// Only paint the object if our noPaint flag isn't set.
if (r->node->isFloating() && !r->noPaint) {
r->node->print(p, _x, _y, _w, _h,
r->node->paint(p, _x, _y, _w, _h,
_tx + r->left - r->node->xPos() + r->node->marginLeft(),
_ty + r->startY - r->node->yPos() + r->node->marginTop());
_ty + r->startY - r->node->yPos() + r->node->marginTop(),
BACKGROUND_PHASE);
r->node->paint(p, _x, _y, _w, _h,
_tx + r->left - r->node->xPos() + r->node->marginLeft(),
_ty + r->startY - r->node->yPos() + r->node->marginTop(),
FLOAT_PHASE);
r->node->paint(p, _x, _y, _w, _h,
_tx + r->left - r->node->xPos() + r->node->marginLeft(),
_ty + r->startY - r->node->yPos() + r->node->marginTop(),
FOREGROUND_PHASE);
}
}
}
......@@ -1770,7 +1782,7 @@ void RenderFlow::addChild(RenderObject *newChild, RenderObject *beforeChild)
}
}
// prevent non-layouted elements from getting printed by pushing them far above the top of the
// prevent non-layouted elements from getting painted by pushing them far above the top of the
// page
if (!newChild->isInline())
newChild->setPos(newChild->xPos(), -500000);
......
......@@ -60,10 +60,10 @@ public:
// overrides RenderObject
virtual void print( QPainter *, int x, int y, int w, int h,
int tx, int ty);
virtual void printObject( QPainter *, int x, int y, int w, int h,
int tx, int ty);
virtual void paint(QPainter *, int x, int y, int w, int h,
int tx, int ty, int paintPhase);
virtual void paintObject(QPainter *, int x, int y, int w, int h,
int tx, int ty, int paintPhase);
void paintFloats(QPainter *p, int _x, int _y,
int _w, int _h, int _tx, int _ty);
......
......@@ -43,22 +43,23 @@ RenderHtml::~RenderHtml()
void RenderHtml::setStyle(RenderStyle *style)
{
RenderFlow::setStyle(style);
setSpecialObjects(true);
setShouldPaintBackgroundOrBorder(true);
}
void RenderHtml::print(QPainter *p, int _x, int _y, int _w, int _h, int _tx, int _ty)
void RenderHtml::paint(QPainter *p, int _x, int _y, int _w, int _h, int _tx, int _ty,
int paintPhase)
{
_tx += m_x;
_ty += m_y;
//kdDebug(0) << "html:print " << _tx << "/" << _ty << endl;
printObject(p, _x, _y, _w, _h, _tx, _ty);
//kdDebug(0) << "html:paint " << _tx << "/" << _ty << endl;
paintObject(p, _x, _y, _w, _h, _tx, _ty, paintPhase);
}
void RenderHtml::printBoxDecorations(QPainter *p,int, int _y,
int, int _h, int _tx, int _ty)
void RenderHtml::paintBoxDecorations(QPainter *p,int, int _y,
int, int _h, int _tx, int _ty)
{
//kdDebug( 6040 ) << renderName() << "::printDecorations()" << _tx << "/" << _ty << endl;
//kdDebug( 6040 ) << renderName() << "::paintBoxDecorations()" << _tx << "/" << _ty << endl;
QColor c = style()->backgroundColor();
CachedImage *bg = style()->backgroundImage();
......@@ -94,14 +95,14 @@ void RenderHtml::printBoxDecorations(QPainter *p,int, int _y,
// CSS2 14.2:
// " The background of the box generated by the root element covers the entire canvas."
// hence, print the background even in the margin areas (unlike for every other element!)
// hence, paint the background even in the margin areas (unlike for every other element!)
// I just love these little inconsistencies .. :-( (Dirk)
int my = QMAX(by,_y);
printBackground(p, c, bg, my, _h, bx, by, bw, bh);
paintBackground(p, c, bg, my, _h, bx, by, bw, bh);
if(style()->hasBorder())
printBorder( p, _tx, _ty, w, h, style() );
paintBorder( p, _tx, _ty, w, h, style() );
}
void RenderHtml::repaint(bool immediate)
......
......@@ -43,12 +43,12 @@ namespace khtml {
virtual bool isHtml() const { return true; }
virtual void setStyle(RenderStyle *style);
virtual void print( QPainter *, int x, int y, int w, int h, int tx, int ty);
virtual void paint(QPainter *, int x, int y, int w, int h, int tx, int ty, int paintPhase);
virtual void repaint(bool immediate=false);
virtual void layout();
virtual short containingBlockWidth() const;
protected:
virtual void printBoxDecorations(QPainter *p,int _x, int _y,
virtual void paintBoxDecorations(QPainter *p,int _x, int _y,
int _w, int _h, int _tx, int _ty);
private:
QScrollView* m_view;
......
......@@ -70,7 +70,7 @@ void RenderImage::setStyle(RenderStyle* _style)
// init RenderObject attributes
setInline( !isPositioned() && style()->display()==INLINE );
setOverhangingContents(style()->height().isPercent());
setSpecialObjects(true);
setShouldPaintBackgroundOrBorder(true);
CachedObject* co = style()->contentObject();
if (co && image != co ) {
......@@ -179,8 +179,11 @@ void RenderImage::setPixmap( const QPixmap &p, const QRect& r, CachedImage *o)
}
}
void RenderImage::printObject(QPainter *p, int /*_x*/, int /*_y*/, int /*_w*/, int /*_h*/, int _tx, int _ty)
void RenderImage::paintObject(QPainter *p, int /*_x*/, int /*_y*/, int /*_w*/, int /*_h*/, int _tx, int _ty, int paintPhase)
{
if (paintPhase != FOREGROUND_PHASE)
return;
int cWidth = contentWidth();
int cHeight = contentHeight();
int leftBorder = borderLeft();
......@@ -294,7 +297,7 @@ void RenderImage::printObject(QPainter *p, int /*_x*/, int /*_y*/, int /*_w*/, i
}
}
if(style()->outlineWidth())
printOutline(p, _tx, _ty, width(), height(), style());
paintOutline(p, _tx, _ty, width(), height(), style());
}
void RenderImage::layout()
......
......@@ -46,7 +46,7 @@ public:
virtual bool isRendered() const { return true; }
virtual bool isImage() const { return false; }
virtual void printObject( QPainter *p, int /*x*/, int /*y*/, int /*w*/, int /*h*/, int tx, int ty);
virtual void paintObject( QPainter *p, int /*x*/, int /*y*/, int /*w*/, int /*h*/, int tx, int ty, int paintPhase);
virtual void layout();
......
......@@ -192,7 +192,7 @@ RenderLayer::paint(QPainter *p, int x, int y, int w, int h)
// Elements add in their own positions as a translation factor. This forces
// us to subtract that out, so that when it's added back in, we get the right
// bounds. This is really disgusting (that print only sets up the right paint
// bounds. This is really disgusting (that paint only sets up the right paint
// position after you call into it). -dwh
//printf("Painting layer at %d %d\n", elt->absBounds.x(), elt->absBounds.y());
......@@ -217,9 +217,19 @@ RenderLayer::paint(QPainter *p, int x, int y, int w, int h)
}
}
elt->layer->renderer()->print(p, x, y, w, h,
// Paint the layer.
elt->layer->renderer()->paint(p, x, y, w, h,
elt->absBounds.x() - elt->layer->renderer()->xPos(),
elt->absBounds.y() - elt->layer->renderer()->yPos());
elt->absBounds.y() - elt->layer->renderer()->yPos(),
BACKGROUND_PHASE);
elt->layer->renderer()->paint(p, x, y, w, h,
elt->absBounds.x() - elt->layer->renderer()->xPos(),
elt->absBounds.y() - elt->layer->renderer()->yPos(),
FLOAT_PHASE);
elt->layer->renderer()->paint(p, x, y, w, h,
elt->absBounds.x() - elt->layer->renderer()->xPos(),
elt->absBounds.y() - elt->layer->renderer()->yPos(),
FOREGROUND_PHASE);
}
if (currRect != paintRect)
......@@ -247,7 +257,7 @@ RenderLayer::nodeAtPoint(RenderObject::NodeInfo& info, int x, int y)
// Elements add in their own positions as a translation factor. This forces
// us to subtract that out, so that when it's added back in, we get the right
// bounds. This is really disgusting (that print only sets up the right paint
// bounds. This is really disgusting (that paint only sets up the right paint
// position after you call into it). -dwh
//printf("Painting layer at %d %d\n", elt->absBounds.x(), elt->absBounds.y());
......
......@@ -237,24 +237,24 @@ bool RenderListItem::checkChildren() const
return false;
}