History log of /haiku/src/servers/app/drawing/BitmapHWInterface.cpp
Revision Date Author Comments
# b419a79f 21-Oct-2021 Augustin Cavalier <waddlesplash@gmail.com>

app_server: Remove IsDoubleBuffered() default implementation from HWInterface.

It just causes confusion and is wrong in the case where double buffering
status changed during the object lifetime.

Change-Id: Ia1a9ae3f5a1b1b7d521b79c7d1c7be92cef60a06
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4633
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 779ab335 09-Dec-2020 X512 <danger_mail@list.ru>

use .IsSet() instead if .Get() != NULL

Change-Id: Ia2b7a719fd398e78cc3b11d4f7b02cb81179f65f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3488
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>


# d99d8dbd 27-Aug-2020 X512 <danger_mail@list.ru>

app_server memory management: use ObjectDeleter to mark ownership

Make object ownership explicit by use of ObjectDeleter where possible.

Change-Id: I499a00aa3390d1510ae284419e73faffa5166430
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2695
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>


# 3a2b67b5 21-Nov-2017 Adrien Destugues <pulkomandy@pulkomandy.tk>

Support for configuring screen backlight

Accelerant interface:
Introduce new hooks B_SET_BRIGHTNESS and B_GET_BRIGHTNESS. Brightness is
a float in the 0..1 range.

App_server:
Forward brightness things between BScreen and the accelerant.

intel_extreme:
Implement the hooks. Note that this only works for laptop panels, but
the driver will pretend to support it in other cases as well.

Screen preferences:
If the accelerant supports the B_GET_BRIGHTNESS hook, allow to set
brightness with a slider. Otherwise, the slidere is hidden and these
changes aren't visible.


# 73df8e25 02-Jul-2015 Augustin Cavalier <waddlesplash@gmail.com>

servers/app/drawing: BitmapHWInterface: Return -1.

-1 is the same as B_ERROR, but all of the other implementations of
this function "return -1", so do that to be consistent.


# 7b8b23e9 01-Sep-2009 Axel Dörfler <axeld@pinc-software.de>

* Cleanup, no functional change.

+alphabranch


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32881 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2469a6f4 23-Oct-2008 Stephan Aßmus <superstippi@gmx.de>

* Rewrote the UpdateQueue class. It actually works now and would perform screen
updates during the vertical refresh, but it causes flickering again since
there is no guarantee that screen regions will stay clean from the time that
they were scheduled with the UpdateQueue until the UpdateQueue thread
transfers them. Therefor it is still disabled.
* Refactored a bit the distinction between Invalidate() and CopyToFront().
Invalidate() used to be virtual, but now CopyToFront() is. This was mainly
needed for the app_server test environment, because the host window needs
to call Invalidate() when the front buffer bitmap is clean. When the
UpdateQueue is used, this needs to be CopyToFront(). Now the separation is
cleaner in combination with the UpdateQueue.
* Fixed a problem in HWInterface::CopyToFront(): When separating the region
outside the cursor and the region with the cursor during a transfer, it
needs to hold the fFloatingOverlay lock to make sure the cursor is not
moved in the meantime. This fixes graphics glitches with remnants of the
cursor staying on screen. These could very rarely be observed, but much more
often with the accelerated double-buffer mode.
* Enabled the accelerated double buffered mode, since it works now very well.
I was able to test it with the nVidea driver on an nVideo 7300. It works by
allocating a frame buffer twice the height of the configured screen mode.
Then all drawing goes into the offscreen portion, including accelerated
driver functions. AccelerantHWInterface::_CopyToFront() then uses acceleration
to blit the clean regions in the offscreen portion of the frame buffer into
the visible part. Please tell me if there are problems, for example when
if there is too few video memory, or if a driver does not handle it correctly.
To disable it, see src/servers/app/drawing/AccelerantHWInterface.cpp line 511.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28301 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b66d7537 14-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* Prepared the BScreen and BPrivateScreen class to be used with multiple monitors.
* BPrivateScreen now buffers its frame for 0.1 seconds (so that calling it several
times in a row is both consistent and cheap).
* Added GetFrameBufferConfig() call to the HW interface (and implemented it).
* Added server commands AS_VALID_SCREEN_ID, AS_GET_NEXT_SCREEN_ID, and
AS_GET_FRAME_BUFFER_CONFIG.
* BPrivateScreen::BaseAddress() and BPrivateScreen::BytesPerRow() are now working.
* minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14915 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 758b1d0e 12-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixes that make Haiku build with gcc 4. Mainly out of the following
categories:
* Missing includes (like <stdlib.h> and <string.h>).
* Linking against $(TARGET_LIBSTDC++) instead of libstdc++.r4.so.
* Local variables shadowing parameters.
* Default parameters in function definitions (as opposed to function
declarations).
* All C++ stuff (nothrow, map, set, vector, min, max,...) must be imported
explicitly from the std:: namespace now.
* "new (sometype)[...]" must read "new sometype[...]", even if sometype is
something like "const char *".
* __FUNCTION__ is no longer a string literal (but a string expression), i.e.
'printf(__FUNCTION__ ": ...\n")' is invalid code.
* A type cast results in a non-lvalue. E.g. "(char *)buffer += bytes"
is an invalid expression.
* "friend class SomeClass" only works when SomeClass is known before.
Otherwise the an inner class with that name is considered as friend.
gcc 4 is much pickier about scopes.
* gcc 4 is generally stricter with respect to type conversions in C.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14878 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 22137825 17-Jul-2005 Michael Lotz <mmlr@mlotz.ch>

All cursor related changes:

* Moved setting the default cursor from ServerScreen to Desktop
* Getting the default cursor is now done using the CursorManager
* Removed outdated setcursor from SysCursor.cpp (we have a new implementation by now)
* Renamed SysCursor.cpp to CursorSet.cpp as that's what it is
* Moved headers/private/app/SysCursor.h to headers/private/servers/app/CursorSet.h
* Removed some unneeded header includes along the way

There remains {set|get}_syscursor now in CursorSet.cpp. Serverside for these are not implemented
and they are obvious hacks. Do we need to keep them?
Also this commit _would_ break Appearance, but 1) all the related code is currently commented out
with the comment "cursor set management belongs in another app" and 2) it is already broken
because of ColorSet.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13726 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 359c905c 05-Jul-2005 Stephan Aßmus <superstippi@gmx.de>

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


# 73df8e25af7ec4c81c1c037be65f61b8648699cd 02-Jul-2015 Augustin Cavalier <waddlesplash@gmail.com>

servers/app/drawing: BitmapHWInterface: Return -1.

-1 is the same as B_ERROR, but all of the other implementations of
this function "return -1", so do that to be consistent.


# 7b8b23e9a4505c568342233ed23c2d31de397683 01-Sep-2009 Axel Dörfler <axeld@pinc-software.de>

* Cleanup, no functional change.

+alphabranch


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32881 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2469a6f4272b43fb04e11290808216f6a7610599 23-Oct-2008 Stephan Aßmus <superstippi@gmx.de>

* Rewrote the UpdateQueue class. It actually works now and would perform screen
updates during the vertical refresh, but it causes flickering again since
there is no guarantee that screen regions will stay clean from the time that
they were scheduled with the UpdateQueue until the UpdateQueue thread
transfers them. Therefor it is still disabled.
* Refactored a bit the distinction between Invalidate() and CopyToFront().
Invalidate() used to be virtual, but now CopyToFront() is. This was mainly
needed for the app_server test environment, because the host window needs
to call Invalidate() when the front buffer bitmap is clean. When the
UpdateQueue is used, this needs to be CopyToFront(). Now the separation is
cleaner in combination with the UpdateQueue.
* Fixed a problem in HWInterface::CopyToFront(): When separating the region
outside the cursor and the region with the cursor during a transfer, it
needs to hold the fFloatingOverlay lock to make sure the cursor is not
moved in the meantime. This fixes graphics glitches with remnants of the
cursor staying on screen. These could very rarely be observed, but much more
often with the accelerated double-buffer mode.
* Enabled the accelerated double buffered mode, since it works now very well.
I was able to test it with the nVidea driver on an nVideo 7300. It works by
allocating a frame buffer twice the height of the configured screen mode.
Then all drawing goes into the offscreen portion, including accelerated
driver functions. AccelerantHWInterface::_CopyToFront() then uses acceleration
to blit the clean regions in the offscreen portion of the frame buffer into
the visible part. Please tell me if there are problems, for example when
if there is too few video memory, or if a driver does not handle it correctly.
To disable it, see src/servers/app/drawing/AccelerantHWInterface.cpp line 511.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28301 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b66d7537121d617485e5f5c47d4deb7f79f20880 14-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* Prepared the BScreen and BPrivateScreen class to be used with multiple monitors.
* BPrivateScreen now buffers its frame for 0.1 seconds (so that calling it several
times in a row is both consistent and cheap).
* Added GetFrameBufferConfig() call to the HW interface (and implemented it).
* Added server commands AS_VALID_SCREEN_ID, AS_GET_NEXT_SCREEN_ID, and
AS_GET_FRAME_BUFFER_CONFIG.
* BPrivateScreen::BaseAddress() and BPrivateScreen::BytesPerRow() are now working.
* minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14915 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 758b1d0e05fe1042cce6e00d194a147802d4f9be 12-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixes that make Haiku build with gcc 4. Mainly out of the following
categories:
* Missing includes (like <stdlib.h> and <string.h>).
* Linking against $(TARGET_LIBSTDC++) instead of libstdc++.r4.so.
* Local variables shadowing parameters.
* Default parameters in function definitions (as opposed to function
declarations).
* All C++ stuff (nothrow, map, set, vector, min, max,...) must be imported
explicitly from the std:: namespace now.
* "new (sometype)[...]" must read "new sometype[...]", even if sometype is
something like "const char *".
* __FUNCTION__ is no longer a string literal (but a string expression), i.e.
'printf(__FUNCTION__ ": ...\n")' is invalid code.
* A type cast results in a non-lvalue. E.g. "(char *)buffer += bytes"
is an invalid expression.
* "friend class SomeClass" only works when SomeClass is known before.
Otherwise the an inner class with that name is considered as friend.
gcc 4 is much pickier about scopes.
* gcc 4 is generally stricter with respect to type conversions in C.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14878 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2213782534a8b17fdea5d7fc603360f4c9ac317e 17-Jul-2005 Michael Lotz <mmlr@mlotz.ch>

All cursor related changes:

* Moved setting the default cursor from ServerScreen to Desktop
* Getting the default cursor is now done using the CursorManager
* Removed outdated setcursor from SysCursor.cpp (we have a new implementation by now)
* Renamed SysCursor.cpp to CursorSet.cpp as that's what it is
* Moved headers/private/app/SysCursor.h to headers/private/servers/app/CursorSet.h
* Removed some unneeded header includes along the way

There remains {set|get}_syscursor now in CursorSet.cpp. Serverside for these are not implemented
and they are obvious hacks. Do we need to keep them?
Also this commit _would_ break Appearance, but 1) all the related code is currently commented out
with the comment "cursor set management belongs in another app" and 2) it is already broken
because of ColorSet.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13726 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 359c905c57c9d43ce84badcaef859fa94322897c 05-Jul-2005 Stephan Aßmus <superstippi@gmx.de>

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