Closed Bug 230632 Opened 21 years ago Closed 21 years ago

[BEOS] nsImage::DrawTile() to be rewritten


(Core Graveyard :: GFX: BeOS, defect)

Not set


(Not tracked)



(Reporter: sergei_d, Assigned: sergei_d)





(1 file, 3 obsolete files)

Currently DrawTile uses two-dimesnional loop which is calling
BView::DrawBitmapSaync() to render tiled background.

On such sites as http::// it causes calling DrawBitmap up to about
MILLION (1 000 000)  times, depending on window size.
As DrawBitmap*() involves app_server even called on BView, attached to
off-screen BBitmap, it causes absolutely untolerable speed drop. Especially
if/when some scaling/cropping appears

Such code must be replaced. Idea is:
1)create temporary bitmap with size of repaint area.
2)render tile image on that tmpbitmap using memcpy() operations
3)use DrawBitmap once - to render prepared image of repaint-area to drawing surface.

Notice for those who are unfamiliar with Mozilla drawing. We cannot use memcpy
to render tiles on drawin surface itself, without tmpbitmap.
Because that surfce is abstractions over several type of canvas and there may be
as BBitmap behind it, but also BWindow. We don't know it, and we shoudln't rely
on such assumptions.

Draft patch for testers will be submittted soon.
Attached patch Patch draft (diff -uwp) (obsolete) — Splinter Review
rewrite of DrawTile. Adds huge performance boost on some sites. Needs testing
proper rendering in sense of +/- 1 bounds' size of tiled images - there is bigg
mess between inclusive and exclusive rects in Mozilla API and BeOS API.

NB. There is something weird with CVS here, so i got fii like patch for bug
230457 wasn't checked in. So you should look at your sources, if that pattch
don't apply cleanly.
Additionally to mentioned above changes:
Get rid of BView::DrawBitmapAsync everywhere - no need for it if we immediately
foloowed it with BView::Sync().
Replaced with DrawBitmap(). All BView::Sync() calls removed

No more need for DrawNoLock() method - removed

Removed unpaired BView::LockLooper() occurence

And, bacuse half of code was in
foo {
and half with 
i restyled it with preffered by me and BeIDE
Attachment #138806 - Attachment is obsolete: true
Assignee: arougthopher → sergei_d
Comment on attachment 138819 [details] [diff] [review]
Attempt of final patch (diff -uwp)

review request.
Attachment #138819 - Flags: review?(timeless)
Comment on attachment 138819 [details] [diff] [review]
Attempt of final patch (diff -uwp)

>Index: nsImageBeOS.cpp
>RCS file: /cvsroot/mozilla/gfx/src/beos/nsImageBeOS.cpp,v
>retrieving revision 1.24
>diff -u -w -p -r1.24 nsImageBeOS.cpp
>--- nsImageBeOS.cpp	10 Jan 2004 14:37:08 -0000	1.24
>+++ nsImageBeOS.cpp	11 Jan 2004 21:31:38 -0000
>@@ -183,7 +201,8 @@ NS_IMETHODIMP nsImageBeOS::Draw(nsIRende
> // Draw the bitmap, this draw just has destination coordinates
> NS_IMETHODIMP nsImageBeOS::Draw(nsIRenderingContext &aContext, nsDrawingSurface aSurface,
>-	PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight) {
>+	PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight) 
>+	{
Shouldn't this { not be indented?
> 	// XXX kipp: this is temporary code until we eliminate the
> 	// width/height arguments from the draw method.
Summary: [BEOS] nsImage::DrawTile() to be rewitten → [BEOS] nsImage::DrawTile() to be rewritten
Attached patch Patch (diff -uwp_ (obsolete) — Splinter Review
Ident corrected.

Timeless, can you checkin that immediately?
I need to do cvs co update, in order to test renewed patch for nsWindow, and
don wish to mess with restring my gfx folder after checkout
Attachment #138819 - Attachment is obsolete: true
Attachment #138819 - Flags: review?(timeless)
Comment on attachment 138879 [details] [diff] [review]
Patch (diff -uwp_

i can't commit -w patches
Attachment #138879 - Flags: review+
Exactly as previous. Diff flags changed
Attachment #138879 - Attachment is obsolete: true
It seems timeless checked it in already.
So, marking FIXED
Closed: 21 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.