[Webkit-unassigned] [Bug 34683] [Haiku] Implement Path, Gradient and flesh out GraphicsContextHaiku

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 23 02:10:04 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=34683





--- Comment #12 from Stephan Aßmus <superstippi at gmx.de>  2010-02-23 02:10:04 PST ---
I just realized I should perhaps explain the "locking" thing. Usually, a BView
is attached to a BWindow. In fact, it can only be attached to a BWindow. A
BWindow usually runs it's own thread for dispatching events. To help coders not
make the mistake to invoke BView methods without having the BWindow looper
thread properly locked, the BView methods all check the locking status of their
parent BWindow and drop the program into the debugger if there is anything
wrong. When invoking methods from within the BWindow thread, no locking needs
to be done, since it always happens from within the event dispatching code
which already has the BWindow locked. It's just important when invoking from
other threads, like BApplication.

Then Be thought that it would be nice to be able to attach BViews also to
BBitmaps. For this, they created a special private constructor for BWindow
which only BBitmap has access to. A BBitmap which is created with the flag to
allow attaching BViews creates such a dummy BWindow for holding the child
BViews. It also makes sure that there is an app_server thread running which
performs the actual drawing commands for the BView. But this BWindow is special
in that the event looper thread never runs. Still, the BView methods check for
the locked status of the parent BWindow. So the locking here happens more to
prevent the invokation of the debugger, than to actually synchronize critical
sections. If WebCore was to run documents, layouting and painting in multiple
threads, then it could actually become useful to use the BBitmap lock for
synchronization. For now it would just add unnecessary overhead.

I hope this makes it clear why Lock() and Unlock() in HitTestBitmap don't
implement the stack object based auto-locking that you were thinking of. Such
technique is otherwise well known in Haiku coding, but it doesn't apply here.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list