#11196 closed enhancement (fixed)
Tiled bitmap drawing
Reported by: | pulkomandy | Owned by: | KapiX |
---|---|---|---|
Priority: | normal | Milestone: | R1/beta3 |
Component: | Servers/app_server | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
Currently the only way to draw a tiled bitmap is to use SetViewBitmap with the B_BITMAP_TILE option.
Some websites (eg http://amigaimpact.org) use 1x2 pixel bitmaps to draw line patterns in most of the webpage. Currently WebKit implements this using a loop calling DrawBitmapAsync(), but this is much slower than it needs to be.
We already have a DrawBitmap call taking an "options" parameter. Currently it's only used to set bilinear filtering. We could add support for B_TILED_BITMAP as a new option bit there.
WebKit also supports a "phase" (so the top-left of the source rect may not be drawn at the same position as the top-left of the destination rect), and an affine transform of the source before drawing (which needs special care to make the end result easily tileable). These two would probably need an extension of our API.
Change History (6)
comment:1 by , 10 years ago
comment:2 by , 5 years ago
Owner: | changed from | to
---|---|
Status: | new → in-progress |
I have a working implementation of this that I need to cleanup before submission.
comment:3 by , 5 years ago
Tiled bitmap drawing implemented as new API calls, with optional phase parameter: https://review.haiku-os.org/c/haiku/+/1962
Affine Transform support requires bigger code changes in app server.
comment:5 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | in-progress → closed |
While working on Tracker I also needed to scale bitmaps with different options and also ran into the limitation that the BView::DrawBitmap() doesn't take the B_BITMAP_TILE option. I got around it by attaching a BView to a BBitmap but it would have been more straightforward if I could have used BView::DrawBitmap() instead.