The current implementation calls the virtual method ImageBufferBackend::drawConsuming(). But this is wrong if GPU Process rendering is enabled because the following assertion will fire: SHOULD NEVER BE REACHED /Volumes/Data/WebKit/OpenSource/Source/WebKit/WebProcess/GPU/graphics/cocoa/ImageBufferRemoteIOSurfaceBackend.cpp(103) : virtual void WebKit::ImageBufferRemoteIOSurfaceBackend::draw(WebCore::GraphicsContext &, const WebCore::FloatRect &, const WebCore::FloatRect &, const WebCore::ImagePaintingOptions &) 1 0x3393baad9 WTFCrash 2 0x31d12db8b WTFCrashWithInfo(int, char const*, char const*, int) 3 0x31f1aae9f WebKit::ImageBufferRemoteIOSurfaceBackend::draw(WebCore::GraphicsContext&, WebCore::FloatRect const&, WebCore::FloatRect const&, WebCore::ImagePaintingOptions const&) 4 0x361738c46 WebCore::ImageBufferBackend::drawConsuming(WebCore::GraphicsContext&, WebCore::FloatRect const&, WebCore::FloatRect const&, WebCore::ImagePaintingOptions const&) 5 0x31f198b58 WebCore::ConcreteImageBuffer<WebKit::ImageBufferRemoteIOSurfaceBackend>::drawConsuming(WebCore::GraphicsContext&, WebCore::FloatRect const&, WebCore::FloatRect const&, WebCore::ImagePaintingOptions const&) 6 0x361738929 WebCore::ImageBuffer::drawConsuming(WTF::RefPtr<WebCore::ImageBuffer, WTF::RawPtrTraits<WebCore::ImageBuffer>, WTF::DefaultRefDerefTraits<WebCore::ImageBuffer> >, WebCore::GraphicsContext&, WebCore::FloatRect const&, WebCore::FloatRect const&, WebCore::ImagePaintingOptions const&) 7 0x36170cf3d WebCore::GraphicsContext::drawConsumingImageBuffer(WTF::RefPtr<WebCore::ImageBuffer, WTF::RawPtrTraits<WebCore::ImageBuffer>, WTF::DefaultRefDerefTraits<WebCore::ImageBuffer> >, WebCore::FloatRect const&, WebCore::FloatRect const&, WebCore::ImagePaintingOptions const&) 8 0x36170ce98 WebCore::GraphicsContext::drawConsumingImageBuffer(WTF::RefPtr<WebCore::ImageBuffer, WTF::RawPtrTraits<WebCore::ImageBuffer>, WTF::DefaultRefDerefTraits<WebCore::ImageBuffer> >, WebCore::FloatRect const&, WebCore::ImagePaintingOptions const&) 9 0x361c6dcea WebCore::RenderBoxModelObject::paintFillLayerExtended(WebCore::PaintInfo const&, WebCore::Color const&, WebCore::FillLayer const&, WebCore::LayoutRect const&, WebCore::BackgroundBleedAvoidance, WebCore::InlineIterator::InlineBoxIterator const&, WebCore::LayoutRect const&, WebCore::CompositeOperator, WebCore::RenderElement*, WebCore::BaseBackgroundColorUsage) 10 0x361c6bdfd WebCore::RenderBox::paintFillLayer(WebCore::PaintInfo const&, WebCore::Color const&, WebCore::FillLayer const&, WebCore::LayoutRect const&, WebCore::BackgroundBleedAvoidance, WebCore::CompositeOperator, WebCore::RenderElement*, WebCore::BaseBackgroundColorUsage) 11 0x361c653f1 WebCore::RenderBox::paintFillLayers(WebCore::PaintInfo const&, WebCore::Color const&, WebCore::FillLayer const&, WebCore::LayoutRect const&, WebCore::BackgroundBleedAvoidance, WebCore::CompositeOperator, WebCore::RenderElement*) 12 0x361c686d5 WebCore::RenderBox::paintBackground(WebCore::PaintInfo const&, WebCore::LayoutRect const&, WebCore::BackgroundBleedAvoidance) 13 0x361c65e2f WebCore::RenderBox::paintBoxDecorations(WebCore::PaintInfo&, WebCore::LayoutPoint const&) 14 0x361c33c74 WebCore::RenderBlock::paintObject(WebCore::PaintInfo&, WebCore::LayoutPoint const&) 15 0x361c32983 WebCore::RenderBlock::paint(WebCore::PaintInfo&, WebCore::LayoutPoint const&) 16 0x361d60a54 WebCore::RenderLayer::paintBackgroundForFragments(WTF::Vector<WebCore::LayerFragment, 1ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc> const&, WebCore::GraphicsContext&, WebCore::GraphicsContext&, WebCore::LayoutRect const&, bool, WebCore::RenderLayer::LayerPaintingInfo const&, WTF::OptionSet<WebCore::PaintBehavior>, WebCore::RenderObject*) 17 0x361d5c997 WebCore::RenderLayer::paintLayerContents(WebCore::GraphicsContext&, WebCore::RenderLayer::LayerPaintingInfo const&, WTF::OptionSet<WebCore::RenderLayer::PaintLayerFlag>) 18 0x361d80b12 WebCore::RenderLayerBacking::paintIntoLayer(WebCore::GraphicsLayer const*, WebCore::GraphicsContext&, WebCore::IntRect const&, WTF::OptionSet<WebCore::PaintBehavior>, WebCore::EventRegionContext*)::$_25::operator()(WebCore::RenderLayer&, WTF::OptionSet<WebCore::RenderLayer::PaintLayerFlag>) const 19 0x361d80433 WebCore::RenderLayerBacking::paintIntoLayer(WebCore::GraphicsLayer const*, WebCore::GraphicsContext&, WebCore::IntRect const&, WTF::OptionSet<WebCore::PaintBehavior>, WebCore::EventRegionContext*) 20 0x361d820a6 WebCore::RenderLayerBacking::paintContents(WebCore::GraphicsLayer const*, WebCore::GraphicsContext&, WebCore::FloatRect const&, unsigned int) 21 0x36171f76f WebCore::GraphicsLayer::paintGraphicsLayerContents(WebCore::GraphicsContext&, WebCore::FloatRect const&, unsigned int) 22 0x3617d9cef WebCore::GraphicsLayerCA::platformCALayerPaintContents(WebCore::PlatformCALayer*, WebCore::GraphicsContext&, WebCore::FloatRect const&, unsigned int) 23 0x35f3a7c9c WebCore::PlatformCALayer::drawLayerContents(WebCore::GraphicsContext&, WebCore::PlatformCALayer*, WTF::Vector<WebCore::FloatRect, 5ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&, unsigned int) 24 0x31df3025c WebKit::RemoteLayerBackingStore::drawInContext(WebCore::GraphicsContext&) 25 0x31df2f6dd WebKit::RemoteLayerBackingStore::display() 26 0x31f5762fc WebKit::PlatformCALayerRemote::recursiveBuildTransaction(WebKit::RemoteLayerTreeContext&, WebKit::RemoteLayerTreeTransaction&) 27 0x31f57658b WebKit::PlatformCALayerRemote::recursiveBuildTransaction(WebKit::RemoteLayerTreeContext&, WebKit::RemoteLayerTreeTransaction&) 28 0x31f57658b WebKit::PlatformCALayerRemote::recursiveBuildTransaction(WebKit::RemoteLayerTreeContext&, WebKit::RemoteLayerTreeTransaction&) 29 0x31f57658b WebKit::PlatformCALayerRemote::recursiveBuildTransaction(WebKit::RemoteLayerTreeContext&, WebKit::RemoteLayerTreeTransaction&) 30 0x31f57658b WebKit::PlatformCALayerRemote::recursiveBuildTransaction(WebKit::RemoteLayerTreeContext&, WebKit::RemoteLayerTreeTransaction&) 31 0x31eaad5a1 WebKit::RemoteLayerTreeContext::buildTransaction(WebKit::RemoteLayerTreeTransaction&, WebCore::PlatformCALayer&) Also GraphicsContext::drawConsumingImageBuffer() is a virtual method but it is only overriden by NullGraphicsContext. We need DisplayList::Recorder to override it so we can record the drawing command. DisplayList::RecorderImpl and RemoteDisplayListRecorderProxy need to implement the helper method recordDrawConsumingImageBuffer().
Created attachment 452144 [details] Patch
<rdar://problem/89007426>
Created attachment 453270 [details] Patch
Comment on attachment 453270 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=453270&action=review > Source/WebKit/ChangeLog:22 > + drawConsuming() in this case because the backend is till owned by "till owned"
Created attachment 453281 [details] Patch
Committed r290542 (247820@main): <https://commits.webkit.org/247820@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 453281 [details].
This fixed a few crashes on the GPU Process bot, which need to be gardened
Gardening: <https://commits.webkit.org/r290707>
Gardening: <https://commits.webkit.org/r290711>