Commit 7d5a4793 authored by hyatt's avatar hyatt

Add support for specifying whether repaint should be immediate or

	not.  Default to async for now to maintain current behavior.

	For clipped object repainting (e.g., livepage.apple.com and mrskin)
	switch to immediate repainting, since this makes the marquees
	faster, stops dropping updates, and keeps the hover effects and
	painting on the rest of the page fast (since the marquee rect doesn't
	get unioned with links or images that you roll over).

        * khtml/rendering/render_box.cpp:
        (RenderBox::repaint):
        (RenderBox::repaintRectangle):
        * khtml/rendering/render_box.h:
        * khtml/rendering/render_html.cpp:
        (RenderHtml::repaint):
        * khtml/rendering/render_html.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::setLayouted):
        (RenderObject::repaintRectangle):
        * khtml/rendering/render_object.h:
        * khtml/rendering/render_root.cpp:
        (RenderRoot::repaintRectangle):
        (RenderRoot::repaint):
        * khtml/rendering/render_root.h:
        * khtml/rendering/render_table.cpp:
        (RenderTableRow::repaint):
        (RenderTableCell::repaintRectangle):
        (RenderTableCell::repaint):
        * khtml/rendering/render_table.h:
        * khtml/rendering/render_text.cpp:
        (RenderText::repaint):
        * khtml/rendering/render_text.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2719 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent bb798fe2
2002-11-17 David Hyatt <hyatt@apple.com>
Add support for specifying whether repaint should be immediate or
not. Default to async for now to maintain current behavior.
For clipped object repainting (e.g., livepage.apple.com and mrskin)
switch to immediate repainting, since this makes the marquees
faster, stops dropping updates, and keeps the hover effects and
painting on the rest of the page fast (since the marquee rect doesn't
get unioned with links or images that you roll over).
* khtml/rendering/render_box.cpp:
(RenderBox::repaint):
(RenderBox::repaintRectangle):
* khtml/rendering/render_box.h:
* khtml/rendering/render_html.cpp:
(RenderHtml::repaint):
* khtml/rendering/render_html.h:
* khtml/rendering/render_object.cpp:
(RenderObject::setLayouted):
(RenderObject::repaintRectangle):
* khtml/rendering/render_object.h:
* khtml/rendering/render_root.cpp:
(RenderRoot::repaintRectangle):
(RenderRoot::repaint):
* khtml/rendering/render_root.h:
* khtml/rendering/render_table.cpp:
(RenderTableRow::repaint):
(RenderTableCell::repaintRectangle):
(RenderTableCell::repaint):
* khtml/rendering/render_table.h:
* khtml/rendering/render_text.cpp:
(RenderText::repaint):
* khtml/rendering/render_text.h:
2002-11-17 Maciej Stachowiak <mjs@apple.com>
- fixed 2949193 - implement onKeyDown, onKeyPress, and onKeyUp event handlers
......
2002-11-17 David Hyatt <hyatt@apple.com>
Add support for specifying whether repaint should be immediate or
not. Default to async for now to maintain current behavior.
For clipped object repainting (e.g., livepage.apple.com and mrskin)
switch to immediate repainting, since this makes the marquees
faster, stops dropping updates, and keeps the hover effects and
painting on the rest of the page fast (since the marquee rect doesn't
get unioned with links or images that you roll over).
* khtml/rendering/render_box.cpp:
(RenderBox::repaint):
(RenderBox::repaintRectangle):
* khtml/rendering/render_box.h:
* khtml/rendering/render_html.cpp:
(RenderHtml::repaint):
* khtml/rendering/render_html.h:
* khtml/rendering/render_object.cpp:
(RenderObject::setLayouted):
(RenderObject::repaintRectangle):
* khtml/rendering/render_object.h:
* khtml/rendering/render_root.cpp:
(RenderRoot::repaintRectangle):
(RenderRoot::repaint):
* khtml/rendering/render_root.h:
* khtml/rendering/render_table.cpp:
(RenderTableRow::repaint):
(RenderTableCell::repaintRectangle):
(RenderTableCell::repaint):
* khtml/rendering/render_table.h:
* khtml/rendering/render_text.cpp:
(RenderText::repaint):
* khtml/rendering/render_text.h:
2002-11-17 Maciej Stachowiak <mjs@apple.com>
- fixed 2949193 - implement onKeyDown, onKeyPress, and onKeyUp event handlers
......
2002-11-17 David Hyatt <hyatt@apple.com>
Add support for specifying whether repaint should be immediate or
not. Default to async for now to maintain current behavior.
For clipped object repainting (e.g., livepage.apple.com and mrskin)
switch to immediate repainting, since this makes the marquees
faster, stops dropping updates, and keeps the hover effects and
painting on the rest of the page fast (since the marquee rect doesn't
get unioned with links or images that you roll over).
* khtml/rendering/render_box.cpp:
(RenderBox::repaint):
(RenderBox::repaintRectangle):
* khtml/rendering/render_box.h:
* khtml/rendering/render_html.cpp:
(RenderHtml::repaint):
* khtml/rendering/render_html.h:
* khtml/rendering/render_object.cpp:
(RenderObject::setLayouted):
(RenderObject::repaintRectangle):
* khtml/rendering/render_object.h:
* khtml/rendering/render_root.cpp:
(RenderRoot::repaintRectangle):
(RenderRoot::repaint):
* khtml/rendering/render_root.h:
* khtml/rendering/render_table.cpp:
(RenderTableRow::repaint):
(RenderTableCell::repaintRectangle):
(RenderTableCell::repaint):
* khtml/rendering/render_table.h:
* khtml/rendering/render_text.cpp:
(RenderText::repaint):
* khtml/rendering/render_text.h:
2002-11-17 Maciej Stachowiak <mjs@apple.com>
- fixed 2949193 - implement onKeyDown, onKeyPress, and onKeyUp event handlers
......
......@@ -401,14 +401,14 @@ void RenderBox::position(int x, int y, int, int, int, bool, bool, int)
//m_width = width;
}
void RenderBox::repaint()
void RenderBox::repaint(bool immediate)
{
//kdDebug( 6040 ) << "repaint!" << endl;
int ow = style() ? style()->outlineWidth() : 0;
repaintRectangle(-ow, -ow, m_width+ow*2, m_height+ow*2);
repaintRectangle(-ow, -ow, m_width+ow*2, m_height+ow*2, immediate);
}
void RenderBox::repaintRectangle(int x, int y, int w, int h, bool f)
void RenderBox::repaintRectangle(int x, int y, int w, int h, bool immediate, bool f)
{
x += m_x;
y += m_y;
......@@ -417,7 +417,7 @@ void RenderBox::repaintRectangle(int x, int y, int w, int h, bool f)
// kdDebug( 6040 ) << "RenderBox(" << renderName() << ")::repaintRectangle (" << x << "/" << y << ") (" << w << "/" << h << ")" << endl;
RenderObject *o = container();
if( o ) o->repaintRectangle(x, y, w, h, f);
if( o ) o->repaintRectangle(x, y, w, h, immediate, f);
}
void RenderBox::relativePositionOffset(int &tx, int &ty)
......
......@@ -85,9 +85,9 @@ public:
virtual int lowestPosition() const;
virtual int rightmostPosition() const;
virtual void repaint();
virtual void repaint(bool immediate=false);
virtual void repaintRectangle(int x, int y, int w, int h, bool f=false);
virtual void repaintRectangle(int x, int y, int w, int h, bool immediate=false, bool f=false);
virtual void setPixmap(const QPixmap &, const QRect&, CachedImage *);
......
......@@ -104,11 +104,11 @@ void RenderHtml::printBoxDecorations(QPainter *p,int, int _y,
printBorder( p, _tx, _ty, w, h, style() );
}
void RenderHtml::repaint()
void RenderHtml::repaint(bool immediate)
{
RenderObject *cb = containingBlock();
if(cb != this)
cb->repaint();
cb->repaint(immediate);
}
void RenderHtml::layout()
......
......@@ -44,7 +44,7 @@ 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 repaint();
virtual void repaint(bool immediate=false);
virtual void layout();
virtual short containingBlockWidth() const;
protected:
......
......@@ -256,7 +256,8 @@ void RenderObject::setLayouted(bool b)
if (clippedObj) {
gClipObject = clippedObj;
root->layout();
clippedObj->repaintRectangle(0,0,clippedObj->contentWidth(),clippedObj->contentHeight());
clippedObj->repaintRectangle(0, 0, clippedObj->contentWidth(),
clippedObj->contentHeight(), true);
gClipObject = 0;
}
else
......@@ -627,9 +628,9 @@ void RenderObject::print( QPainter *p, int x, int y, int w, int h, int tx, int t
printObject(p, x, y, w, h, tx, ty);
}
void RenderObject::repaintRectangle(int x, int y, int w, int h, bool f)
void RenderObject::repaintRectangle(int x, int y, int w, int h, bool immediate, bool f)
{
if(parent()) parent()->repaintRectangle(x, y, w, h, f);
if(parent()) parent()->repaintRectangle(x, y, w, h, immediate, f);
}
#ifndef NDEBUG
......
......@@ -445,8 +445,8 @@ public:
virtual void setTable(RenderTable*) {};
// force a complete repaint
virtual void repaint() { if(m_parent) m_parent->repaint(); }
virtual void repaintRectangle(int x, int y, int w, int h, bool f=false);
virtual void repaint(bool immediate = false) { if(m_parent) m_parent->repaint(immediate); }
virtual void repaintRectangle(int x, int y, int w, int h, bool immediate = false, bool f=false);
virtual unsigned int length() const { return 1; }
......
......@@ -231,7 +231,7 @@ void RenderRoot::printObject(QPainter *p, int _x, int _y,
}
void RenderRoot::repaintRectangle(int x, int y, int w, int h, bool f)
void RenderRoot::repaintRectangle(int x, int y, int w, int h, bool immediate, bool f)
{
if (m_printingMode) return;
// kdDebug( 6040 ) << "updating views contents (" << x << "/" << y << ") (" << w << "/" << h << ")" << endl;
......@@ -244,17 +244,23 @@ void RenderRoot::repaintRectangle(int x, int y, int w, int h, bool f)
QRect vr = viewRect();
QRect ur(x, y, w, h);
if (ur.intersects(vr))
if (m_view)
//m_view->updateContents(ur);
if (m_view && ur.intersects(vr))
if (immediate)
m_view->updateContents(ur);
else
m_view->scheduleRepaint(x, y, w, h);
}
void RenderRoot::repaint()
void RenderRoot::repaint(bool immediate)
{
if (m_view && !m_printingMode)
m_view->scheduleRepaint(m_view->contentsX(), m_view->contentsY(),
m_view->visibleWidth(), m_view->visibleHeight());
if (m_view && !m_printingMode) {
if (immediate)
m_view->updateContents(m_view->contentsX(), m_view->contentsY(),
m_view->visibleWidth(), m_view->visibleHeight());
else
m_view->scheduleRepaint(m_view->contentsX(), m_view->contentsY(),
m_view->visibleWidth(), m_view->visibleHeight());
}
}
void RenderRoot::close()
......
......@@ -52,8 +52,8 @@ public:
KHTMLView *view() const { return m_view; }
virtual void repaint();
virtual void repaintRectangle(int x, int y, int w, int h, bool f=false);
virtual void repaint(bool immediate=false);
virtual void repaintRectangle(int x, int y, int w, int h, bool immediate = false, bool f=false);
virtual void print( QPainter *, int x, int y, int w, int h, int tx, int ty);
void printObject(QPainter *p, int _x, int _y,
int _w, int _h, int _tx, int _ty);
......
......@@ -2012,9 +2012,9 @@ void RenderTableRow::addChild(RenderObject *child, RenderObject *beforeChild)
}
void RenderTableRow::repaint()
void RenderTableRow::repaint(bool immediate)
{
if ( table ) table->repaint();
if ( table ) table->repaint(immediate);
}
#ifndef NDEBUG
......@@ -2167,10 +2167,10 @@ int RenderTableCell::paddingRight() const
return RenderFlow::paddingRight();
}
void RenderTableCell::repaintRectangle(int x, int y, int w, int h, bool f)
void RenderTableCell::repaintRectangle(int x, int y, int w, int h, bool immediate, bool f)
{
y += _topExtra;
RenderFlow::repaintRectangle(x, y, w, h, f);
RenderFlow::repaintRectangle(x, y, w, h, immediate, f);
}
bool RenderTableCell::absolutePosition(int &xPos, int &yPos, bool f)
......@@ -2275,9 +2275,9 @@ void RenderTableCell::printBoxDecorations(QPainter *p,int, int _y,
printBorder(p, _tx, _ty, w, h, style());
}
void RenderTableCell::repaint()
void RenderTableCell::repaint(bool immediate)
{
if ( m_table ) m_table->repaint();
if ( m_table ) m_table->repaint(immediate);
}
#ifndef NDEBUG
......
......@@ -325,7 +325,7 @@ public:
virtual void close();
virtual void repaint();
virtual void repaint(bool immediate=false);
virtual void layout();
......@@ -379,7 +379,7 @@ public:
virtual void calcWidth();
virtual void setWidth( int width );
virtual void setStyle( RenderStyle *style );
virtual void repaint();
virtual void repaint(bool immediate=false);
virtual int paddingTop() const;
virtual int paddingBottom() const;
......@@ -414,7 +414,7 @@ public:
// lie position to outside observers
virtual int yPos() const { return m_y + _topExtra; }
virtual void repaintRectangle(int x, int y, int w, int h, bool f=false);
virtual void repaintRectangle(int x, int y, int w, int h, bool immediate = false, bool f=false);
virtual bool absolutePosition(int &xPos, int &yPos, bool f = false);
virtual short baselinePosition( bool = false ) const;
......
......@@ -1104,11 +1104,11 @@ short RenderText::width() const
return w;
}
void RenderText::repaint()
void RenderText::repaint(bool immediate)
{
RenderObject *cb = containingBlock();
if(cb != this)
cb->repaint();
cb->repaint(immediate);
}
bool RenderText::isFixedWidthFont() const
......
......@@ -201,7 +201,7 @@ public:
virtual int rightmostPosition() const;
virtual void repaint();
virtual void repaint(bool immediate=false);
const QFontMetrics &metrics(bool firstLine) const;
const Font *htmlFont(bool firstLine) const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment