diff options
author | Jorge Arellano Cid <jcid@dillo.org> | 2014-05-14 20:21:27 -0400 |
---|---|---|
committer | Jorge Arellano Cid <jcid@dillo.org> | 2014-05-14 20:21:27 -0400 |
commit | b93b25640a83b6826795dd55e98d785d6c0b6bfd (patch) | |
tree | 45e87de2c1dedfcee307f9d513e94f8bf994a5a7 /dw | |
parent | 7dd06039905c62abe9b84ae9fb571072da0e7781 (diff) |
Avoid removing imgbuf and decoding the whole image again for reloads.
Using the same testing files as the previous patch,
the results are:
.---------------------------------------------.
|imgbufs | No patch | Patch #1 | Patch #2 |
|----------------------------------------------
|1imgA.html | 2/1 | 1/1 | 1/0 |
|2imgSA.html | 3/2 | 1/2 | 1/0 |
|3imgSA.html | 4/3 | 1/3 | 1/0 |
|----------------------------------------------
|2imgA.html | 4/2 | 2/2 | 2/0 |
|3imgA.html | 6/3 | 3/3 | 3/0 |
'---------------------------------------------'
n1/n2 means:
n1 imgbufs were created for first load (empty cache)
n2 imgbufs were created for reload (cached image)
Notes:
* Rendering is much faster. Easy to notice with Back operation.
* Between four to five times on www.welt.de.
* Corner cases can be more than ten times. Usually, it *feels* faster.
Diffstat (limited to 'dw')
-rw-r--r-- | dw/image.cc | 4 | ||||
-rw-r--r-- | dw/widget.cc | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/dw/image.cc b/dw/image.cc index 5df6b93e..e71c8f2f 100644 --- a/dw/image.cc +++ b/dw/image.cc @@ -425,9 +425,6 @@ void Image::setBuffer (core::Imgbuf *buffer, bool resize) { core::Imgbuf *oldBuf = this->buffer; - if (resize) - queueResize (0, true); - if (wasAllocated () && needsResize () && getContentWidth () > 0 && getContentHeight () > 0) { // Don't create a new buffer for the transition from alt text to img, @@ -438,6 +435,7 @@ void Image::setBuffer (core::Imgbuf *buffer, bool resize) this->buffer = buffer; buffer->ref (); } + queueResize (0, true); DBG_OBJ_ASSOC_CHILD (this->buffer); diff --git a/dw/widget.cc b/dw/widget.cc index 385bdb97..7e9591ff 100644 --- a/dw/widget.cc +++ b/dw/widget.cc @@ -159,7 +159,10 @@ void Widget::queueDrawArea (int x, int y, int width, int height) { /** \todo Maybe only the intersection? */ layout->queueDraw (x + allocation.x, y + allocation.y, width, height); - _MSG("Widget::queueDrawArea x=%d y=%d w=%d h=%d\n", x, y, width, height); + _MSG("Widget::queueDrawArea alloc(%d %d %d %d) wid(%d %d %d %d)\n", + allocation.x, allocation.y, + allocation.width, allocation.ascent + allocation.descent, + x, y, width, height); } /** |