Bug 103969 - [BlackBerry] On taking over a backingstore, reset the previous page's tiles
Summary: [BlackBerry] On taking over a backingstore, reset the previous page's tiles
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit BlackBerry (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jakob Petsovits
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-03 21:03 PST by Jakob Petsovits
Modified: 2012-12-05 14:13 PST (History)
8 users (show)

See Also:


Attachments
Patch (2.70 KB, patch)
2012-12-03 21:10 PST, Jakob Petsovits
no flags Details | Formatted Diff | Diff
Patch (5.82 KB, patch)
2012-12-05 13:23 PST, Jakob Petsovits
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jakob Petsovits 2012-12-03 21:03:40 PST
With buffers being explicitly reclaimed from backingstore geometries, we have to make sure that the previously active backingstore releases its front buffers for use in the newly active one.

Previously, this clearing of backingstore tiles occurred after the dormant backingstore is reactivated, the backingstore active in the meantime would just use the back buffer anyway and leave the dormant one with dangling pointers that would just not be shown. Now that we have a counted list of back buffers, we need to be explicit about this thing upfront.

The patch below fixes a crash that would occur after switching ownership of the backingstore to a different WebPage.
Comment 1 Jakob Petsovits 2012-12-03 21:10:40 PST
Created attachment 177410 [details]
Patch
Comment 2 WebKit Review Bot 2012-12-04 00:09:11 PST
Comment on attachment 177410 [details]
Patch

Clearing flags on attachment: 177410

Committed r136483: <http://trac.webkit.org/changeset/136483>
Comment 3 WebKit Review Bot 2012-12-04 00:09:15 PST
All reviewed patches have been landed.  Closing bug.
Comment 4 Jakob Petsovits 2012-12-05 13:15:27 PST
The above patch didn't cover all the cases; in particular, it did not take into account that resetTiles() would sometimes return early without having swapped the tiles and thus reclaiming them. This would cause a crash when switching back from a tab that had already been made invisible.

The follow-up patch below removes the early returns, because it's safe to swap in an empty geometry at any time and we should always take the chance when we get it.

Also the code that calls resetTiles() on an owner switch should be put right into setCurrentBackingStoreOwner(), so that it will also release the buffers when the BackingStore is destroyed (the function is then called with 0).
Comment 5 Jakob Petsovits 2012-12-05 13:23:44 PST
Created attachment 177817 [details]
Patch
Comment 6 Adam Treat 2012-12-05 13:25:17 PST
Comment on attachment 177817 [details]
Patch

Good stuff!
Comment 7 WebKit Review Bot 2012-12-05 14:13:51 PST
Comment on attachment 177817 [details]
Patch

Clearing flags on attachment: 177817

Committed r136761: <http://trac.webkit.org/changeset/136761>
Comment 8 WebKit Review Bot 2012-12-05 14:13:54 PST
All reviewed patches have been landed.  Closing bug.