Commit Graph

149 Commits

Author SHA1 Message Date
Michael Lotz 3f319b3346 Some cleanup, some removed typos, some unification, some fixes and some added todos. Most of it related to client-server communication. Apps that rely on BFont stuff should work now (StyledEdit, Fonts, Keymap, Menu, ...). Or should not hang/quit at startup at least.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13625 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-10 21:16:43 +00:00
Stephan Aßmus 359c905c57 offscreen bitmaps work, tested on Haiku as well, supports all colorspaces that BBitmap::ImportBits() supports. It uses a fallback for non-B_RGB(A)32 bitmaps. Added support for B_SUB_PIXEL_PRECISION view flags, though it is a bit hacky, since I had to add it to LayerData, even though it is not a true part of stack data. Added Layer::SetFlags() to enforce code path and update fLayerData. Cleaned up DisplayDriverPainter and DisplayDriver API (changed some const BRect& rect to simply BRect rect in order to be able to reuse it in the code), moved Painter.h, the test environment only draws the changed part of the frame buffer again - this causes a lot less CPU overhead, Painter special cases stroke width of 1.0 to use square caps, which is similar to R5 implementation and removes a lot of problems with non-straight line drawing, ServerWindow uses the DisplayDriver from it's WinBorder instead of the one from the Desktop (needed for offscreen windows, which have their own DisplayDriverPainter), it also checks for GetRootLayer() == NULL, because offscreen layers are not attached to a RootLayer, there was a fix for scrolling which worked at least in the test environment, it is now defunced, because Adi moved _CopyBits to Layer... I need to reenable it later, LayerData has no more fEscapementDelta, also fixed fFontAliasing (which was thought to overriding the font flags, and now works as such again), Desktop initialises the menu_info and scroll_bar_info stuff, which makes ScrollBars work actually... hope I didn't forget something.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13448 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-05 16:17:16 +00:00
Axel Dörfler 0ec4af2233 Improved AreaPool to have an initial size as well as well as a name that is
used for new area.
MemPool::AddToPool() now gracefully deals with NULL pointers (or a size of 0).
BitmapManager was deleting the area it transferred to AreaPool before - it
no longer needs an extra area, though.
Minor other cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13260 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-24 04:01:16 +00:00
Axel Dörfler b5436616a3 Fixed some style related functions and other oddities in FontServer.
Also applied our style guide on that class.
Renamed some public globals to match our style guide.
Made BitmapManager inherit from BLocker instead of duplicating its
functionality (incorrectly, did not check for B_INTERRUPTED) locally.
Some more cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13259 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-24 03:31:41 +00:00
Stephan Aßmus 3dcb3b079a Added some root layer locking in ServerWindow.cpp when accessing the layer tree. Moved HWInterface management out of DisplayDriverPainter and into Desktop. Removed all the directly hardware related functions from DisplayDriver API. They just called the same HWInterface functions. Now DisplayDriver is much cleaner and ready for being attached to a yet to be written BitmapHWInterface. Clean up of the display mode stuff in Screen and the View-/AccelerantHWInterface. Frequency is now regarded on Haiku. AccelerantHWInterface::GetModeList now works before SetMode has been called. Added MultiLocker from the sample code. HWInterface uses it now in preparation to being used from multiple instances of DisplayDriver.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13252 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-23 23:46:17 +00:00
Stephan Aßmus c69d4b2719 clean up, bug fixes and more robustness
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13249 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-23 23:14:40 +00:00
Stephan Aßmus 2734243aca Preparation of more correct support for state stack.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13201 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-17 13:20:45 +00:00
Stephan Aßmus c818183b7e _started_ implementing Tab sliding
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13182 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-16 16:44:58 +00:00
DarkWyrm e67e7dd995 Some cleanups to ColorSet in anticipation of future cleanups for Appearance app
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13156 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-15 17:20:17 +00:00
Axel Dörfler dd10337fd0 Renamed BAppServerLink to AppServerLink, BPortLink to PortLink, LinkMsgReader
to LinkReceiver, LinkMsgSender to LinkSender, and put everything into the
BPrivate namespace.
Made AppServerLink a cheap object - it will use the applications receiver/sender
and not create its own buffers.
Fixed broken communication stuff here and there (mostly Font.cpp).
Put the newly introduced set|get_system_colors() into the BPrivate namespace -
please don't introduce private functions into the public namespace!!!
Also fixed their broken communication use, as Darkwyrm obviously forgot about
it again: the sequence Flush(); GetNextMessage() without error checking is
purely wrong and can make the app hang and/or crash! :-)
Other minor cleanup.
The input_server used some test mode with the haiku build target which is
probably wrong.
Hopefully I did not forget anything this time.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13128 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-14 21:28:56 +00:00
Stephan Aßmus 9851ab5c1e The Haiku Logo is displayed on the Desktop. :-) Of course this will be removed as soon as Tracker runs. If you don't want it, you can disable it in RootLayer.h. Fixed a clipping bug with text rendering.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13057 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-11 13:00:17 +00:00
Adi Oanca 9080b4b47c viewColor, background and overlay bitmaps are not part of a view graphics state anymore
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13050 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-10 16:05:34 +00:00
Stefano Ceccherini 7475dcdf3a Added an app server command to retrieve the color map. Made some adjustments to SystemPalette.cpp, implemented support for it in BPrivateScreen. Moved get_scs() a bit down to avoid a deadlock. Note that getting the colormap doesn't work due to port capacity limit (?)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12996 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-07 21:32:24 +00:00
Stephan Aßmus 59345e264f huge cleanup, support for SetSizeLimits, support for truncating strings, numerous decorator bug fixes, Layer does not draw when view color is B_TRANSPARENT_COLOR, cleaner dispatching of mouse events to the WinBorder in RootLayer, commented the char map selection in the font server, as it seems glyph lookup by unicode index works much better with the default map
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12945 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-03 19:50:30 +00:00
Stephan Aßmus 7aca21e6bf added const to some operators
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12943 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-03 19:31:26 +00:00
Stephan Aßmus 11f97ed147 large cleanup, should have fixed some memory leaks too
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12942 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-03 19:30:32 +00:00
Axel Dörfler e5b4782b4e Made some necessary enhancements to class Screen; the app_server also
has to care about refresh rates. Also changed Screen::GetMode() (formerly
Resolution()) to return all interesting values, so that hopefully no one
will call it anymore like RootLayer::SetScreens() did.
Greatly improved the horrible RootLayer::SetScreens().
The app_server is now able to deal with failing HWInterface::SetMode() calls;
in this case, it will fall back to the hardware's current mode. This now
also works correctly in combination with the vesa driver, so that you don't
have to compile the app_server with the same resolution you boot in anymore.
SetMode() now always returns if it succeeded or not.
Renamed RootLayer::fScreenXYResolution to fScreenWidth/Height respectively.
Removed the useless DisplayDriver::DisplayMode() method.
Added B_GET_DISPLAY_MODE to the required accelerant hooks.
Some minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12831 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-26 09:21:51 +00:00
Stephan Aßmus 74994d1307 added license headers
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12817 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-25 23:47:05 +00:00
Stephan Aßmus 55d6f1b792 Many efficiency improvements to text rendering. Moved stuff from Painter into AGGTextRenderer which didn't belong in Painter. AGGTextRenderer now has an embedded transformation, which expresses the font rotation and (in future) shear settings. Removed direct support for BBitmaps from Painter (supposed to draw ServerBitmaps). Tested drawing of bitmaps other than B_RGB32. (only B_CMAP8 and B_GRAY8 so far, but they work). Right now, these colorspaces are supported by on the fly conversion. So every colorspace supported by BBitmap::ImportBits() should work, which are a lot more than the R5 app_server can display.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12815 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-25 18:20:45 +00:00
Stephan Aßmus 7220b138f2 fixed confusion of byteCount and charCount in ServerFont::StringWidth(), just in case anyone really uses it later. Added UTF8CountChars() to moreUTF8.h, but then I didn't need it...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12750 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-20 23:51:33 +00:00
Stephan Aßmus 3f513bbafe Font rendering code should be cleaner, maybe a little more efficient and better documented. Rotated text is supported again.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12748 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-20 23:26:15 +00:00
Stephan Aßmus 2762b0cecd Work in progress... improvements on font stuff, reverted to using Painter to get the string width. Since it actually uses glyph caching, it is about 20 times faster than the implementation in ServerFont (and a about twice the time as R5). I added a StringWidth method to Painter and AGGTextRenderer which works as correct as ServerFont::StringWidth, which btw was broken, because I mixed up glyph count and byte count...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12745 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-20 19:52:38 +00:00
Stephan Aßmus 38c5a7b7fa Implemented StringWidth in ServerFont, updated ServerApp to use it, and removed a -1 from TextView in the char location calculation, which I didn't understand and without which the cursor location and related stuff now finally work.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12744 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-20 17:36:55 +00:00
Stephan Aßmus 9962b67e5f DisplayDriver::DrawBitmap() takes no more region, the clipping is expected to be already set, as with all other drawing functions. Moved bitmap drawing message dispatching in the drawing messages area, where the correct clipping is set too. Moved cases for messages that don't need clipping applied, ie which don't draw anything, into the normal dispatch function. This means SetHighColor() and so on will no longer rebuild the clipping in Painter. Would be interesting to know how much performance this had cost...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12741 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-20 00:09:59 +00:00
Stephan Aßmus 9bdb0522c1 Implemented BFont::GetEscapments() float version. It is pretty rough yet, but appears to handle UTF8 correctly. The optional escapement_delta is currently ignored. I didn't touch other functionality too much, until I know more about it.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12645 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-12 15:09:30 +00:00
Stephan Aßmus fbf48e6437 Enabled HW acceleration for CopyRegion(). Tested on Haiku and it works. I also implemented FillRegion and InvertRegion. But using different acceleration hooks after one another freezes Haiku, app_server, the accelerant or whatever. I have no clue about accelerants, so if a knowledgable someone would have a look at AccelerantHWInterface.cpp, that'd be great. The software cursor stuff has a cosmetical bug with regards to CopyRegion() too, I don't understand it yet. I also tried to improve StringWidth() and DrawString() preformance. I confirmed that the glyph cache is actually used, but AGGTextRenderer::RenderString() is a dog.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12573 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-04 23:48:19 +00:00
DarkWyrm 4a03616356 Added a StringWidth method variant
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12569 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-04 09:40:32 +00:00
Stephan Aßmus dd3b1653a0 rearranged some functions, removed unused ones
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12562 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-03 21:50:14 +00:00
Stephan Aßmus 924b7ab22c the clipping BRegion is now always allocated, added shortcut for determining if there is a valid clipping
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12555 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-03 21:39:03 +00:00
Stephan Aßmus db7226db9d work in progress to get scrolling working, so Adi can have a look, no changes to existing functionality, cleanup in Layer.cpp
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12481 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-27 17:26:57 +00:00
Stephan Aßmus 93a2cfd43c Correct implementation of BView::CopyBits() in ServerWindow, implementation of CopyRegion in DisplayDriverPainter that sorts the rects topologically depending on direction and does the copy in place, obtaining a speedup of about 250%. TODO: extract the sorting algorithm so that it can be reused for the hardware accelerated version later.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12468 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-26 13:50:34 +00:00
Stephan Aßmus ded5874ea2 Implemented changes necessary for single buffered mode, it is turned off for now, because the soft cursor is currently not being taken care of. We will still use double buffering if the screen color space is not 32 bits, too.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12449 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-20 09:27:15 +00:00
Stephan Aßmus e742e3e106 refactoring and cleanup in LayerData and friends, it shows what I mean by "forced code paths" for example in coupled font size and view scale, added a couple TODOs, disabled decoupled frame buffer transfers, it is buggy and deadlocks for some reason...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12441 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-19 00:42:42 +00:00
Stephan Aßmus 387242437d moved more old stuff which isn't used anymore
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12439 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-18 19:16:11 +00:00
Stephan Aßmus 3dea4bb659 cleanup the defines, move old DisplayDriver implementations out because they are currently unused and won't build
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12438 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-18 18:48:19 +00:00
Stephan Aßmus 8877eb5444 sorry
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12419 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-15 15:32:21 +00:00
Stephan Aßmus 1e1b1675de really implement BitsLength() inline, I have no idea why it compiled for me...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12418 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-15 15:31:57 +00:00
Stephan Aßmus 00802b496b even more convenience functions
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12413 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-15 12:26:10 +00:00
Stephan Aßmus 0c926a191f reuse DrawingMode instances
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12412 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-15 12:25:25 +00:00
Stephan Aßmus 18f3859aed cosmetical change
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12411 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-15 11:53:22 +00:00
Stephan Aßmus 4da1508aa9 added convenience functions to PatternHandler and refactored the setting of the DrawingMode in Painter
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12408 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-15 10:20:53 +00:00
Stephan Aßmus 3d16cf4bce Painter drawing functions now return the BRect enclosing all pixels that have changed, use this for invalidating the correct area in the backbuffer
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12407 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-15 09:55:15 +00:00
Stephan Aßmus 5e33f6e551 pattern is not passed to the drawing functions anymore, it is expected to be set in SetDrawData
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12403 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-15 08:53:28 +00:00
Stephan Aßmus 026470a78c no more fOrigin and fScale in Painter, everything is now expected in absolute (screen) coordinates
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12402 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-15 08:37:52 +00:00
Stephan Aßmus 17360617d2 fixed a really lame bug in the StrokeLine call that caused all these problems with line drawing and or invalidation afterwards, avoid transforming the clipping region into another format used by AGG by using a special BRegion based renderer
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12400 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-15 08:15:04 +00:00
Stephan Aßmus a52667ee9c added a comment about how it would be nice if ServerFont could be guaranteed to be valid (ie it doesn't crash if you call one of it's functions from outside code, I like it when a C++ class is an encapsulated object, maintaining a valid internal state, and whatever client code does, it should just never crash)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12390 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-14 00:22:01 +00:00
Stephan Aßmus ec668ad701 Cosmetical changes and quite a few bug fixes along the way - B_RGB24 is definitely not supposed to be 32 bits per pixel. For example. Added another constructor to take on bitmap data from somewhere else
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12384 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-14 00:06:01 +00:00
Stephan Aßmus 9afc50fd98 cosmetical changes and some bug fixes along the way, added another constructor to take on bitmap data from somewhere else
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12383 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-14 00:04:26 +00:00
Stephan Aßmus 1f9c8f7df0 I must compile before I commit. I must compile before I commit. I must compile before I commit...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12376 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-13 19:38:25 +00:00
Stephan Aßmus 4c90b41029 If you don't declare the destructor virtual in the base class, you will leak memory and the destructor of an inherited class might not be called at all. Removed unnecessary comments. Enhanced readability, because I felt like it...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12375 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-13 19:31:24 +00:00