another wasteful calls removed.

On Wed, Jan 14, 2015 at 10:36 PM, Tomaz Canabrava <[email protected]>
wrote:

> This patch remove some of uneeded animation calls.
>
>
> On Wed, Jan 14, 2015 at 10:26 PM, Tomaz Canabrava <[email protected]>
> wrote:
>
>> Well, another one here.
>> we were creating / removing the biggest tooltip string ( that can have up
>> to 16 lines sometimes ) by allocking / freeing it *every* pixel moved.
>> now we cache it and do not free.
>>
>> On Wed, Jan 14, 2015 at 6:23 PM, Lubomir I. Ivanov <[email protected]>
>> wrote:
>>
>>> On 14 January 2015 at 22:08, Lubomir I. Ivanov <[email protected]>
>>> wrote:
>>> > i suspect that if we rasterize the whole tooltip (i.e. use QPainter's
>>> > methods on a surface) and disable the animation, it will be times
>>> > faster.
>>> >
>>>
>>> and by that i mean override ::paint() and do all the calculations and
>>> drawing in there and possibly only re-draw if the input data changed
>>> etc...
>>> that's a much larger re-work, but i think that custom drawing might be
>>> the most optimal way for the tooltip to perform well.
>>>
>>> lubomir
>>> --
>>>
>>
>>
>
From 3d88961b4334fe8061dc9ce45b7a92f9a42ae75c Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava <[email protected]>
Date: Wed, 14 Jan 2015 22:36:00 -0200
Subject: [PATCH 7/7] Do not set the rectangle if it's the same.

Strangelly, this method was being fired even if the
rectangle was the same, so we deleted everything and
recreated everything again. tsc tsc.

some more improvement is needed but we are getting there.

Signed-off-by: Tomaz Canabrava <[email protected]>
---
 qt-ui/profile/divetooltipitem.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/qt-ui/profile/divetooltipitem.cpp b/qt-ui/profile/divetooltipitem.cpp
index fdbde1d..fc76e50 100644
--- a/qt-ui/profile/divetooltipitem.cpp
+++ b/qt-ui/profile/divetooltipitem.cpp
@@ -57,7 +57,9 @@ void ToolTipItem::clear()
 
 void ToolTipItem::setRect(const QRectF &r)
 {
-	// qDeleteAll(childItems());
+	if( r == rectangle ) {
+		return;
+	}
 	delete background;
 
 	rectangle = r;
-- 
2.2.2

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to