All DEBUG builds after the following commit from our mozilla-central git repository:
7fe94a9 Sat May 26 12:38:17 2012 +0800 Kan-Ru Chen Bug 743182 - Use gfxPlatform::OptimalFormatForContent everywhere. r=joedrew
cause the following ABORT to occur in B2G:
###!!! ABORT: Bad! Did we create a buffer twice without painting?: '!mIsNewBuffer', file /home/work/B2G/gecko/gfx/layers/basic/BasicLayers.cpp, line 2531
Created attachment 628230 [details]
gdb backtrace from the ABORT
And oh yeah - the ABORT is only seen when OMTC is enabled.
This abort is a very serious logic error: it means our double-buffering code became discombobulated and probably would have not have synchronized front->back buffers correctly. If that happens we'll get horrendous rendering artifacts.
Very interested to know how we're getting into this state.
It would be instructive to try re-applying the patch from bug 743182, but with the gfx/layers hunks removed.
I also confirmed that a non-debug build of the same commit fixes bug 744238 (so no artifacts seen when sliding up the lock screen when OMTC is enabled).
Removing gfx/layers/basic/BasicLayers.cpp and gfx/layers/ipc/ShadowLayers.cpp from the patchset, and adding back in the gfxASurface::FormatFromContent function cause the ABORT to not occur (and the lock screen artifact still shows)
That is very very odd.
In the working code case, the image format that ShadowLayerForwarder::AllocBuffer creates is ImageFormatRGB16_565.
In the case that aborts, the image format that ShadowLayerForwarder::AllocBuffer creates is ImageFormatARGB32.
And if I go back to the version of the code that doesn't ABORT and modify OptimalFormatFor to return ImageFormatARGB32 then I also get the ABORT.
And all of this testing was being done on a Samsung Galaxy S II running the ICS variant of gonk.
dhylands, do you have a patch for the ImageFormat problem?
Actually, I think this bug only affects sgs2, so it's not a top priority. But if you already have a patch we should land it.
Created attachment 632115 [details] [diff] [review]
Use RGB24 for offscreen surfaces on android-esque platforms