* Make test-app_server work again in a launch_daemon environment
* test_registrar gets a separate signature and port name again so the
host system can distinguish it from the system registrar
* AppServer is normally a BServer now, however, there can't be two
BApplications in one team. A class TestServerLoopAdapter is added,
which becomes the base class of AppServer instead of BServer when
compiling for libbe_test. It's an adapter class which looks towards
AppServer as it if was a BServer, but internally it is derived from
MessageLooper (like the old AppServer before the transition to
BServer).
This way, AppServer can stay a BServer in normal builds and it also
avoids having to use too many #ifdefs to distinguish the two
versions.
* Same concept as the previously exisiting drawing mode
implementations for e.g. pixel alpha overlay mode: when pattern
is solid, provide a separate mode implementation which does no
unnecessary pattern pixel lookups. This provides a considerable
speedup in composite mode when no stipple pattern is used.
* Add support for pixel alpha overlay mode in the optimized bilinear-
scaled bitmap drawing code of BitmapPainter.
For now, only BilinearDefault supports this. DrawBitmapBilinear
gets the colour type and draw mode as template parameters to
minimize code duplication and allow simple extension with further
pixel formats and modes.
Avoids, for this mode, fallback to the slower generic
AGG-pipeline-based version.
* Add another mode to DrawBitmapNoScale for drawing bitmaps using
B_OP_COPY with alpha masks. It behaves like the definition for
ClipToPicture from the BeBook: pixels with alpha = 0 are ignored,
pixels with any alpha > 0 are copied.
Before, this fell back to the slower generic AGG-pipeline-based
version.
* Some light refactoring
* To use alpha masks in optimized drawing code outside of the AGG
renderer pipeline, we need to allow access to the alpha mask's
underlying buffer:
- AlphaMask gets another method which returns its
clipped_alpha_mask
- clipped_alpha_mask gets a get_hspan() method which returns a span
of alpha values without combining it with anything
- Painter/PainterAggInterface store a pointer to the
clipped_alpha_mask (in addition to the AlphaMask's scanline
container)
* Extract bitmap drawing from Painter into separate class
Painter::BitmapPainter. This will allow to add new optimized
drawing modes without making Painter larger.
* BitmapPainter itself is further decomposed into separate
(method object) structs per drawing mode (currently, those are:
generic, no scale, nearest neighbor, bilinear). New optimized
implementations can be added by writing additional method objects
and calling them from BitmapPainter.
* DrawBitmapNoScale and DrawBitmapBilinear are implemented using
CRTP. This removes the function pointer in the 'no scale' version,
which was previously used to select the row copy type. In the
bilinear version it untangles the three variants (default,
low filter ratio, SIMD) into separate methods.
* While BitmapPainter is a nested class in Painter, the specialized
method objects are not. Instead, the AGG-specific data fields from
Painter are moved into a new struct PainterAggInterface. This
struct is passed to the method objects and allows them to access
the Painter's AGG renderer/rasterizer/scanline containers/etc.
Alternatives would be to make all the involved structs friends
of Painter, or nesting them all, or exposing all of Painter's
internals via getter methods -- all of these would be quite messy.
The details of the bitmap painting implementations are
intentionally hidden from Painter: there is no need for it to
know about their internals -- it does not even know their type
names. (Nesting or making them friend would expose their type
names to Painter.)
Furthermore, there is another level of information hiding between
BitmapPainter and the DrawBitmap[...] method objects.
BitmapPainter itself only needs to decide that it uses e.g. the
bilinear version. It has no knowledge that DrawBitmapBilinear is
internally made out of several structs implementing specially
optimized versions.
* Refactoring only, no functional change intended. Performance
should be unaffected.
fts.c:
- Our fts functions were imported from FreeBSD and consequently did not
use the same weak alias methodology that most of our glibc-derived
POSIX functions do. These subsequently wound up clashing with the
implementation of said functions in current versions of coreutils,
resulting in assertion failures when e.g. running a program through
stdbuf, since the BSD-derived functions had different flag constraints
than their GNU peers. Consequently, this change adjusts the fts_*
family of functions to similarly be exported as weak symbols so they
can be preempted.
If the view fails to lock because it is actually gone, we obviously
can't use it to return the container, so delete it directly in that
case.
Fixes#12072 and probably #11982 which would then be a duplicate.
Most of the changes inspired from the "fr-latin9" map from Linux, but I
went with a different mapping because we also want some symbols later
introduced in Unicode, and also because we already had a different (and
I think better) mapping for some of the extra symbols in latin-9.
The keymap now features:
* Uppercase accented vowels, cedilla, spanish n with tilde
* Mathematical symbols for multiplication/division
* Spanish reverse exclamation and interrogation points, and interrobang
* Various other symbols from the latin-9 character set
- Rather than depending just on mount_server's launch, instead use
a condition that waits for the volumes mounted event. Had missed
the existence of this one previously.
- Adjust launch configuration such that media_server requires mount_server.
Otherwise, if the user has specified sound files for any events that are
on non-boot disks, these won't be found/loaded properly during the boot
process.
* Killing the thread leaks resources, and it will terminate cleanly and
safely when the destructor exits anyway.
* Fixes#12293. Thanks to ttcoder, jackburton and bonefish for investigating!
* Does not fix#12286. Going to bissect now...
UiUtils:
- Fix incorrect check to see if we had hit the bounds of the current memory
block that would cause us to overflow the block's data buffer if incorrect
length values were passed in.
* The code is just reversed to be better organized.
* Since the first event will be handled after a port write, at thread
spawn we just wait with infinite timeout for new messages.
* Remove goto which then become a continue.
* This permitted to remove the double waitUntil assignment which
was in different braces.
* lateness var become tempLateness, so it become more obvious than
before that it's a cached value and we are doing this to avoid
double calculus.
This reverts commit c2e9a9227e. I
misunderstood what Diver meant -- apparently whe he said "revert",
he meant the whole changeset, not this specific commit. So the culprit
is probably BTextView then.
* For better performance, we allow doing drawing mode changes
(and thus, B_OP_COPY) again when inside an opaque layer which
has only other opaque layers below it in the layer stack.
As soon as the first non-opaque layer turns up in the stack, the
drawing mode will be locked to alpha composite mode, until this
layer stack is ended entirely.
This allows using B_OP_COPY in many cases as used by WebKit.
* In the long term it would be nice to get rid of the drawing-mode
lock altogether, however that would need some larger refactoring
work in Painter (i.e. remove the offsetting from renderer_region
again and instead implement an "exit-level transform" (support
for offsets is enough) in Painter which is applied after all other
transforms).
* Opaque layers (opacity = 255) don't need to use an intermediate
bitmap (and everything that comes with it) for drawing at all,
they can just directly draw onto the underlying canvas or layer.
(WebKit likes to use plenty of opaque layers)
* Invisible layers (opacity = 0) can simply be ignored.
This reverts commit fd3e3e7bfb.
Apparently this code wasn't duplicated, as it caused all sorts of
problems in applications (e.g. Debugger was blank).
Fixes#12269.
* The first problem was the O(n^2) complexity of the algorithm, it's
now linear and try to act in a circular way by dispatching
events and reading the port in a balanced way. This exclude
a certain degree of possible deadlocks.
* Add detection and escape when the system try to kill the
thread. This solve some blocking issues on exit et similia
that i had with libjackcompat.
* The algorithm choose soon which event to focus on.
* Lateness is calculated just before the event is dispatched
as it is the more appropriate place, otherwise we would be
calculating something imprecise/guessed.
* Remove timed_event_queue::queued_time. It's more precise to
just use the RealTime() before to Dispatch the event.
* It should solve the BSoundPlayer lateness problems.
* With those improvements the media_kit is not going to lock
completely under stress conditions, instead it try to work
in a best effort shape.
* There's still room for improvements, for example i'm considering some
strategies in lateness situations such as update scheduling latency,
try to decrease waiting time and detect when we are too early on
the other hand to recover when the load go down.
* Thanks to Julian Harnath for sharing his WIP patch which helped
with some controls such as avoiding negative lateness.
* Comments are welcome!
This reverts commit 5934b30b95.
* It got the way of an heisenbug and it seems this change
fixed the problems, but after 2 days the media_server returned
to block. Sorry about that! Will investigate further.
TCPEndpoint::Free() uses _EnterTimeWait() to start the time-wait timer
for later cleanup. The latter did call _CancelConnectionTimers()
unconditionally however, also cancelling a retransmit timer that was
possibly still needed for the retransmission of the FIN packet. If the
FIN packet got lost, the connection would be left open on the other end.
The APICall trace entry just records the function name but this is
enough to deduce where some of the state changes come from.
Also move the TRACE macros past the MutexLockers to ensure that their
output happens at the time when the methods actually run.