Opened 10 years ago

Closed 4 years ago

Last modified 4 years ago

#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 jscipione, 10 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.

comment:2 by KapiX, 4 years ago

Owner: changed from stippi to KapiX
Status: newin-progress

I have a working implementation of this that I need to cleanup before submission.

comment:3 by KapiX, 4 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:4 by waddlesplash, 4 years ago

Is this now fixed, or is there more work to be done?

comment:5 by pulkomandy, 4 years ago

Resolution: fixed
Status: in-progressclosed

comment:6 by pulkomandy, 4 years ago

Milestone: R1R1/beta3

Move closed tickets into beta3 milestone

Note: See TracTickets for help on using tickets.