Closed Bug 230758 Opened 21 years ago Closed 19 years ago

[BEOS]Improving Asynchronous drawing in BeOS-widget

Categories

(Core Graveyard :: GFX: BeOS, defect)

x86
BeOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: sergei_d, Assigned: sergei_d)

References

Details

(Keywords: perf)

Attachments

(1 file, 4 obsolete files)

There is special function 
ConsumeRedundantMouseMoveEvent(MethodInfo *pNewEventMInfo)
in beos/nsAppShell, which reduces load of sequential mouse move messages.

Same can be done with synchronous drawing, because nsViewBeOS::Draw collects all
update rects, and then flushes it in single NS_PAINT event.

It will reduce message load and improve visual appearance.

This bug slightly depends on bug 230382, because patch for that bug separates
synchronous events from BeAPI Invalidate()/Draw() and uses both last methods
only for asynchronous painting.
Attached patch Patch (diff -uwp) (obsolete) — Splinter Review
implements
void nsAppShell::ConsumeRedundantDrawingEvent(MethodInfo *pNewEventMInfo)
method:
This method detects sequential ONPAINT event generated by nsViewBeOS::Draw()
and deletes older one, for the purpose of performance. 

It is safe because nsViewBeOS::Draw()  collects update rects.
So, if we are discarding ONPAINT events here, paintregion still keeps those
rects until isolated (last) event happens, and is passed to CallMethod in
nsWidget where OnPaint() is called.
Attached patch Patch (diff -up) (obsolete) — Splinter Review
Same as previous, but different diff flags used.
Attachment #138916 - Attachment is obsolete: true
Comment on attachment 138938 [details] [diff] [review]
Patch (diff -up)

Biesi, are you brave enough to review it?

(Let's timeless to sleep a bit)
Attachment #138938 - Flags: review?(cbiesinger)
Comment on attachment 138938 [details] [diff] [review]
Patch (diff -up)

found typo there. fixed version is coming
Attachment #138938 - Attachment is obsolete: true
Attachment #138938 - Flags: review?(cbiesinger)
Assignee: beos → sergei_d
Attached patch patch for estimation (obsolete) — Splinter Review
OK, people, i think it is time to test that patch more widely.
It implements following methods
    void ConsumeRedundantDrawingEvent(MethodInfo *pNewEventMInfo);
    void ConsumeRedundantMoveEvent(MethodInfo *pNewEventMInfo);
    void ConsumeRedundantActivateEvent(MethodInfo *pNewEventMInfo);
    void ConsumeRedundantResizeEvent(MethodInfo *pNewEventMInfo);
    void ConsumeRedundantGotFocusEvent(MethodInfo *pNewEventMInfo);
    void ConsumeRedundantLostFocusEvent(MethodInfo *pNewEventMInfo);
It's intention is to reduce message load through bottleneck of proxy betweeen
several BeOS native events from different threads and single-threaded
mozilla-beos-port message dispatcher.

It improves live-resize, makes drawing visual appearance even faster, removes
confusing extra-events for activation and focus changes.

Currently there are printfs() in code to show in Terminal if some redundant
event was consumed/dropped. Drawing events from debug output excluded -
outcommentd, because printf there reduces performace a lot, but if you enable
it, you will see that there is zillion redundant drawing events passed from
invalidation engine, which really weren't required for proper drawing.

To estimate full performacnce boost - outcomment all printfs. Sure, it can be
done with environment options, like debug, but not at that stage.
Attached patch Patch (diff -r HEAD -up7) (obsolete) — Splinter Review
Final patch.
All redundancy-decreasing methods joined into one with switch.
Common event structure moved in *.h
Priority list enym is now typedef-ed for use in method parameter.

Ugly mix of styles unified.
Attachment #139612 - Attachment is obsolete: true
Comment on attachment 139764 [details] [diff] [review]
Patch (diff -r HEAD -up7)

review request
Attachment #139764 - Flags: review?(thesuckiestemail)
Apart from a missing break after case nsWindow::ONACTIVATE :

it looks good.
same as previous but break; in switch added
Attachment #139764 - Attachment is obsolete: true
Comment on attachment 139764 [details] [diff] [review]
Patch (diff -r HEAD -up7)

obsolete
Attachment #139764 - Flags: review?(thesuckiestemail)
Comment on attachment 139831 [details] [diff] [review]
Patch (-r HEAD -up5)

r=?
Attachment #139831 - Attachment description: Patch (-r HEAD -up7) → Patch (-r HEAD -up5)
Attachment #139831 - Flags: review?(thesuckiestemail)
Comment on attachment 139831 [details] [diff] [review]
Patch (-r HEAD -up5)

r=thesuckiestemail@yahoo.se
Attachment #139831 - Flags: review?(thesuckiestemail) → review+
it seems there will be lot of changes soon in widget code, so this patch needs
revision.
Only things that will remain here for sure are ONPAINT, ONMOUSE and, in
consideration - ONRESIZE
is this patch still relevant?  Or have subsequent changes made it obsolete? 
Idea about reducing event number, going through the ports and CallMethod(Async)
bottleneck is still actual, but really, in light of made and planned changes in
AppShell and Toolkit this one may be irrelevant anymore.

I have feeling that actually we need to process (and generate, btw) only events
from top-view, attached to window first, as Mozilla IMHO handles all remaining
by self - keeping accounting of children coordinates and visibility(Z-order).
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → WONTFIX
That is the conclusion I've come to as well. We are allowed one event thread per
top level window and it's BView (maybe same as the first childview for Mozilla)
should probably handle most of keyboard, mouse, resizing and drawing events. 
Unfortunatly such a redesign requires some free time to do it.

I think this patch may not make much difference at that point and might only
confuse those trying to understand the code.
given these sentiments, the "resolved / won't fix" makes sense.  Thanks for the
review, folks.  I've slowly been trying to go through the various patches and
understand the ones not yet committed to CVS.
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: