Opened 5 years ago

Last modified 5 years ago

#11196 new enhancement

Tiled bitmap drawing

Reported by: pulkomandy Owned by: stippi
Priority: normal Milestone: R1
Component: Servers/app_server Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All


Currently the only way to draw a tiled bitmap is to use SetViewBitmap with the B_BITMAP_TILE option.

Some websites (eg 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 (1)

comment:1 by jscipione, 5 years ago

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.

Note: See TracTickets for help on using tickets.