| Summary: | Crash in RemoteLayerBackingStore::encode when m_frontBuffer is nullptr. | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Jeremy Jones <jeremyj-wk> | ||||||||
| Component: | New Bugs | Assignee: | Jeremy Jones <jeremyj-wk> | ||||||||
| Status: | RESOLVED FIXED | ||||||||||
| Severity: | Normal | CC: | commit-queue, eric.carlson, simon.fraser, thorton | ||||||||
| Priority: | P2 | ||||||||||
| Version: | 528+ (Nightly build) | ||||||||||
| Hardware: | Unspecified | ||||||||||
| OS: | Unspecified | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Jeremy Jones
2014-01-27 19:45:54 PST
Created attachment 222399 [details]
Patch
Comment on attachment 222399 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=222399&action=review At the least, this seems likely to be an incomplete fix, because whatever is causing this seems like it would also cause a failure in the m_acceleratesDrawing branch. Do you know why it is that we are encoding a backing store that has never been painted? Is this a custom layer or something? > Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm:97 > + { These go on the previous line. Comment on attachment 222399 [details]
Patch
did not mean to r+
Comment on attachment 222399 [details]
Patch
We need to know why this happens.
This happens because, in the following code, previouslyDrewContents is true.
RemoteLayerBackingStore::display()
...
// If we previously were drawsContent=YES, and now are not, we need
// to note that our backing store has been cleared.
if (!m_layer->owner() || !m_layer->owner()->platformCALayerDrawsContent()) {
bool previouslyDrewContents = hasFrontBuffer();
m_frontBuffer = nullptr;
#if USE(IOSURFACE)
m_frontSurface = nullptr;
#endif
return previouslyDrewContents;
}
This page has a <video> tag.
m_layer->owner()->platformCALayerDrawsContent() is false because...
void RenderLayerBacking::updateDrawsContent(bool isSimpleContainer)
bool RenderLayerBacking::containsPaintedContent(bool isSimpleContainer) const
...
#if ENABLE(VIDEO)
if (renderer().isVideo() && toRenderVideo(renderer()).shouldDisplayVideo())
return m_owningLayer.hasBoxDecorationsOrBackground();
#endif
To repro this problem:
DebugUseWebKit2 = 1;
WebKitAVFoundationEnabled = 1;
WebKitVideoPluginProxyEnabled = 0;
Visit a page with a <video> tag.
Comment on attachment 222399 [details]
Patch
OK, so it is a custom layer. We should totally avoid encoding the RemoteLayerBackingStore in this case; can you move this bool out to RemoteLayerTreeTransaction's encoder, and avoid encoding the backing store completely?
Created attachment 222523 [details]
Patch
Comment on attachment 222523 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=222523&action=review > Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm:312 > + bool hasFrontBuffer{false}; please "bool hasFontBuffer = false;" Much better! Thanks for fixing. Created attachment 222607 [details]
Patch
Comment on attachment 222607 [details] Patch Clearing flags on attachment: 222607 Committed r163103: <http://trac.webkit.org/changeset/163103> All reviewed patches have been landed. Closing bug. |