[Webkit-unassigned] [Bug 237260] New: [GPU Process] Canvas compositing buffer should be created through its GraphicsContext

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Feb 27 15:52:36 PST 2022


https://bugs.webkit.org/show_bug.cgi?id=237260

            Bug ID: 237260
           Summary: [GPU Process] Canvas compositing buffer should be
                    created through its GraphicsContext
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Layout and Rendering
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: sabouhallawa at apple.com
                CC: bfulgham at webkit.org, simon.fraser at apple.com,
                    zalan at apple.com

This will guarantee the newly created ImageBuffer will inherit all the canvas drawing settings: colorSpace, renderingMode and renderingMethod. So if the backend of the underlying ImageBuffer of the canvas is remote the compositing ImageBuffer will also be remote. This will transfer the whole compositing operation to GPUProcess.

This bug causes the layout test fast/canvas/canvas-composite-canvas.html to crash with the following call stack:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.WebKit                    0x0000000105ed3ef8 WTFCrashWithInfo(int, char const*, char const*, int) + 20 (Assertions.h:741)
1   com.apple.WebKit                    0x00000001065412f8 WebKit::ImageBufferRemoteIOSurfaceBackend::draw(WebCore::GraphicsContext&, WebCore::FloatRect const&, WebCore::FloatRect const&, WebCore::ImagePaintingOptions const&) + 36 (ImageBufferRemoteIOSurfaceBackend.cpp:113)
2   com.apple.WebCore                   0x000000011c110440 drawImageToContext + 28 (CanvasRenderingContext2DBase.cpp:1818) [inlined]
3   com.apple.WebCore                   0x000000011c110440 void WebCore::CanvasRenderingContext2DBase::fullCanvasCompositedDrawImage<WebCore::ImageBuffer>(WebCore::ImageBuffer&, WebCore::FloatRect const&, WebCore::FloatRect const&, WebCore::CompositeOperator) + 660 (CanvasRenderingContext2DBase.cpp:1847)
4   com.apple.WebCore                   0x000000011c10fe80 WebCore::CanvasRenderingContext2DBase::drawImage(WebCore::CanvasBase&, WebCore::FloatRect const&, WebCore::FloatRect const&) + 524 (CanvasRenderingContext2DBase.cpp:1610)
5   com.apple.WebCore                   0x000000011c1150ac operator()<WTF::RefPtr<WebCore::HTMLCanvasElement> > + 76 (CanvasRenderingContext2DBase.cpp:1431) [inlined]
6   com.apple.WebCore                   0x000000011c1150ac __invoke_constexpr<WTF::Visitor<(lambda at ./html/canvas/CanvasRenderingContext2DBase.cpp:1424:9), (lambda at ./html/canvas/CanvasRenderingContext2DBase.cpp:1429:9)>, WTF::RefPtr<WebCore::HTMLCanvasElement> &> + 76 (type_traits:3700) [inlined]
7   com.apple.WebCore                   0x000000011c1150ac operator()<std::__variant_detail::__alt<1, WTF::RefPtr<WebCore::HTMLCanvasElement> > &> + 76 (variant:615) [inlined]
8   com.apple.WebCore                   0x000000011c1150ac __invoke_constexpr<std::__variant_detail::__visitation::__variant::__value_visitor<WTF::Visitor<(lambda at ./html/canvas/CanvasRenderingContext2DBase.cpp:1424:9), (lambda at ./html/canvas/CanvasRenderingContext2DBase.cpp:1429:9)> >, std::__variant_detail::__alt<1, WTF::RefPtr<WebCore::HTMLCanvasElement> > &> + 76 (type_traits:3700) [inlined]
9   com.apple.WebCore                   0x000000011c1150ac decltype(auto) std::__1::__variant_detail::__visitation::__base::__dispatcher<1ul>::__dispatch<std::__1::__variant_detail::__visitation::__variant::__value_visitor<WTF::Visitor<WebCore::CanvasRenderingContext2DBase::drawImage(std::__1::variant<WTF::RefPtr<WebCore::HTMLImageElement, WTF::RawPtrTraits<WebCore::HTMLImageElement>, WTF::DefaultRefDerefTraits<WebCore::HTMLImageElement> >, WTF::RefPtr<WebCore::HTMLCanvasElement, WTF::RawPtrTraits<WebCore::HTMLCanvasElement>, WTF::DefaultRefDerefTraits<WebCore::HTMLCanvasElement> >, WTF::RefPtr<WebCore::ImageBitmap, WTF::RawPtrTraits<WebCore::ImageBitmap>, WTF::DefaultRefDerefTraits<WebCore::ImageBitmap> >, WTF::RefPtr<WebCore::CSSStyleImageValue, WTF::RawPtrTraits<WebCore::CSSStyleImageValue>, WTF::DefaultRefDerefTraits<WebCore::CSSStyleImageValue> >, WTF::RefPtr<WebCore::HTMLVideoElement, WTF::RawPtrTraits<WebCore::HTMLVideoElement>, WTF::DefaultRefDerefTraits<WebCore::HTMLVideoElement> > >&&, float, float)::$_0, WebCore::CanvasRenderingContext2DBase::drawImage(std::__1::variant<WTF::RefPtr<WebCore::HTMLImageElement, WTF::RawPtrTraits<WebCore::HTMLImageElement>, WTF::DefaultRefDerefTraits<WebCore::HTMLImageElement> >, WTF::RefPtr<WebCore::HTMLCanvasElement, WTF::RawPtrTraits<WebCore::HTMLCanvasElement>, WTF::DefaultRefDerefTraits<WebCore::HTMLCanvasElement> >, WTF::RefPtr<WebCore::ImageBitmap, WTF::RawPtrTraits<WebCore::ImageBitmap>, WTF::DefaultRefDerefTraits<WebCore::ImageBitmap> >, WTF::RefPtr<WebCore::CSSStyleImageValue, WTF::RawPtrTraits<WebCore::CSSStyleImageValue>, WTF::DefaultRefDerefTraits<WebCore::CSSStyleImageValue> >, WTF::RefPtr<WebCore::HTMLVideoElement, WTF::RawPtrTraits<WebCore::HTMLVideoElement>, WTF::DefaultRefDerefTraits<WebCore::HTMLVideoElement> > >&&, float, float)::$_1> >&&, std::__1::__variant_detail::__base<(std::__1::__variant_detail::_Trait)1, WTF::RefPtr<WebCore::HTMLImageElement, WTF::RawPtrTraits<WebCore::HTMLImageElement>, WTF::DefaultRefDerefTraits<WebCore::HTMLImageElement> >, WTF::RefPtr<WebCore::HTMLCanvasElement, WTF::RawPtrTraits<WebCore::HTMLCanvasElement>, WTF::DefaultRefDerefTraits<WebCore::HTMLCanvasElement> >, WTF::RefPtr<WebCore::ImageBitmap, WTF::RawPtrTraits<WebCore::ImageBitmap>, WTF::DefaultRefDerefTraits<WebCore::ImageBitmap> >, WTF::RefPtr<WebCore::CSSStyleImageValue, WTF::RawPtrTraits<WebCore::CSSStyleImageValue>, WTF::DefaultRefDerefTraits<WebCore::CSSStyleImageValue> >, WTF::RefPtr<WebCore::HTMLVideoElement, WTF::RawPtrTraits<WebCore::HTMLVideoElement>, WTF::DefaultRefDerefTraits<WebCore::HTMLVideoElement> > >&>(std::__1::__variant_detail::__visitation::__variant::__value_visitor<WTF::Visitor<WebCore::CanvasRenderingContext2DBase::drawImage(std::__1::variant<WTF::RefPtr<WebCore::HTMLImageElement, WTF::RawPtrTraits<WebCore::HTMLImageElement>, WTF::DefaultRefDerefTraits<WebCore::HTMLImageElement> >, WTF::RefPtr<WebCore::HTMLCanvasElement, WTF::RawPtrTraits<WebCore::HTMLCanvasElement>, WTF::DefaultRefDerefTraits<WebCore::HTMLCanvasElement> >, WTF::RefPtr<WebCore::ImageBitmap, WTF::RawPtrTraits<WebCore::ImageBitmap>, WTF::DefaultRefDerefTraits<WebCore::ImageBitmap> >, WTF::RefPtr<WebCore::CSSStyleImageValue, WTF::RawPtrTraits<WebCore::CSSStyleImageValue>, WTF::DefaultRefDerefTraits<WebCore::CSSStyleImageValue> >, WTF::RefPtr<WebCore::HTMLVideoElement, WTF::RawPtrTraits<WebCore::HTMLVideoElement>, WTF::DefaultRefDerefTraits<WebCore::HTMLVideoElement> > >&&, float, float)::$_0, WebCore::CanvasRenderingContext2DBase::drawImage(std::__1::variant<WTF::RefPtr<WebCore::HTMLImageElement, WTF::RawPtrTraits<WebCore::HTMLImageElement>, WTF::DefaultRefDerefTraits<WebCore::HTMLImageElement> >, WTF::RefPtr<WebCore::HTMLCanvasElement, WTF::RawPtrTraits<WebCore::HTMLCanvasElement>, WTF::DefaultRefDerefTraits<WebCore::HTMLCanvasElement> >, WTF::RefPtr<WebCore::ImageBitmap, WTF::RawPtrTraits<WebCore::ImageBitmap>, WTF::DefaultRefDerefTraits<WebCore::ImageBitmap> >, WTF::RefPtr<WebCore::CSSStyleImageValue, WTF::RawPtrTraits<WebCore::CSSStyleImageValue>, WTF::DefaultRefDerefTraits<WebCore::CSSStyleImageValue> >, WTF::RefPtr<WebCore::HTMLVideoElement, WTF::RawPtrTraits<WebCore::HTMLVideoElement>, WTF::DefaultRefDerefTraits<WebCore::HTMLVideoElement> > >&&, float, float)::$_1> >&&, std::__1::__variant_detail::__base<(std::__1::__variant_detail::_Trait)1, WTF::RefPtr<WebCore::HTMLImageElement, WTF::RawPtrTraits<WebCore::HTMLImageElement>, WTF::DefaultRefDerefTraits<WebCore::HTMLImageElement> >, WTF::RefPtr<WebCore::HTMLCanvasElement, WTF::RawPtrTraits<WebCore::HTMLCanvasElement>, WTF::DefaultRefDerefTraits<WebCore::HTMLCanvasElement> >, WTF::RefPtr<WebCore::ImageBitmap, WTF::RawPtrTraits<WebCore::ImageBitmap>, WTF::DefaultRefDerefTraits<WebCore::ImageBitmap> >, WTF::RefPtr<WebCore::CSSStyleImageValue, WTF::RawPtrTraits<WebCore::CSSStyleImageValue>, WTF::DefaultRefDerefTraits<WebCore::CSSStyleImageValue> >, WTF::RefPtr<WebCore::HTMLVideoElement, WTF::RawPtrTraits<WebCore::HTMLVideoElement>, WTF::DefaultRefDerefTraits<WebCore::HTMLVideoElement> > >&) + 112 (variant:497)
10  com.apple.WebCore                   0x000000011c10eda0 __visit_alt<std::__variant_detail::__visitation::__variant::__value_visitor<WTF::Visitor<(lambda at ./html/canvas/CanvasRenderingContext2DBase.cpp:1424:9), (lambda at ./html/canvas/CanvasRenderingContext2DBase.cpp:1429:9)> >, std::__variant_detail::__impl<WTF::RefPtr<WebCore::HTMLImageElement>, WTF::RefPtr<WebCore::HTMLCanvasElement>, WTF::RefPtr<WebCore::ImageBitmap>, WTF::RefPtr<WebCore::CSSStyleImageValue>, WTF::RefPtr<WebCore::HTMLVideoElement> > &> + 20 (variant:460) [inlined]
11  com.apple.WebCore                   0x000000011c10eda0 __visit_alt<std::__variant_detail::__visitation::__variant::__value_visitor<WTF::Visitor<(lambda at ./html/canvas/CanvasRenderingContext2DBase.cpp:1424:9), (lambda at ./html/canvas/CanvasRenderingContext2DBase.cpp:1429:9)> >, std::variant<WTF::RefPtr<WebCore::HTMLImageElement>, WTF::RefPtr<WebCore::HTMLCanvasElement>, WTF::RefPtr<WebCore::ImageBitmap>, WTF::RefPtr<WebCore::CSSStyleImageValue>, WTF::RefPtr<WebCore::HTMLVideoElement> > &> + 20 (variant:567) [inlined]
12  com.apple.WebCore                   0x000000011c10eda0 __visit_value<WTF::Visitor<(lambda at ./html/canvas/CanvasRenderingContext2DBase.cpp:1424:9), (lambda at ./html/canvas/CanvasRenderingContext2DBase.cpp:1429:9)>, std::variant<WTF::RefPtr<WebCore::HTMLImageElement>, WTF::RefPtr<WebCore::HTMLCanvasElement>, WTF::RefPtr<WebCore::ImageBitmap>, WTF::RefPtr<WebCore::CSSStyleImageValue>, WTF::RefPtr<WebCore::HTMLVideoElement> > &> + 24 (variant:585) [inlined]
13  com.apple.WebCore                   0x000000011c10eda0 visit<WTF::Visitor<(lambda at ./html/canvas/CanvasRenderingContext2DBase.cpp:1424:9), (lambda at ./html/canvas/CanvasRenderingContext2DBase.cpp:1429:9)>, std::variant<WTF::RefPtr<WebCore::HTMLImageElement>, WTF::RefPtr<WebCore::HTMLCanvasElement>, WTF::RefPtr<WebCore::ImageBitmap>, WTF::RefPtr<WebCore::CSSStyleImageValue>, WTF::RefPtr<WebCore::HTMLVideoElement> > &> + 40 (variant:1654) [inlined]
14  com.apple.WebCore                   0x000000011c10eda0 switchOn<std::variant<WTF::RefPtr<WebCore::HTMLImageElement>, WTF::RefPtr<WebCore::HTMLCanvasElement>, WTF::RefPtr<WebCore::ImageBitmap>, WTF::RefPtr<WebCore::CSSStyleImageValue>, WTF::RefPtr<WebCore::HTMLVideoElement> > &, (lambda at ./html/canvas/CanvasRenderingContext2DBase.cpp:1424:9), (lambda at ./html/canvas/CanvasRenderingContext2DBase.cpp:1429:9)> + 56 (StdLibExtras.h:392) [inlined]
15  com.apple.WebCore                   0x000000011c10eda0 WebCore::CanvasRenderingContext2DBase::drawImage(std::__1::variant<WTF::RefPtr<WebCore::HTMLImageElement, WTF::RawPtrTraits<WebCore::HTMLImageElement>, WTF::DefaultRefDerefTraits<WebCore::HTMLImageElement> >, WTF::RefPtr<WebCore::HTMLCanvasElement, WTF::RawPtrTraits<WebCore::HTMLCanvasElement>, WTF::DefaultRefDerefTraits<WebCore::HTMLCanvasElement> >, WTF::RefPtr<WebCore::ImageBitmap, WTF::RawPtrTraits<WebCore::ImageBitmap>, WTF::DefaultRefDerefTraits<WebCore::ImageBitmap> >, WTF::RefPtr<WebCore::CSSStyleImageValue, WTF::RawPtrTraits<WebCore::CSSStyleImageValue>, WTF::DefaultRefDerefTraits<WebCore::CSSStyleImageValue> >, WTF::RefPtr<WebCore::HTMLVideoElement, WTF::RawPtrTraits<WebCore::HTMLVideoElement>, WTF::DefaultRefDerefTraits<WebCore::HTMLVideoElement> > >&&, float, float) + 76 (CanvasRenderingContext2DBase.cpp:1423)
16  com.apple.WebCore                   0x000000011b0292b8 operator() + 24 (JSCanvasRenderingContext2D.cpp:1826) [inlined]
17  com.apple.WebCore                   0x000000011b0292b8 toJS<WebCore::IDLUndefined, (lambda at /Volumes/Data/worker/ios-simulator-15-release/build/WebKitBuild/Release-iphonesimulator/DerivedSources/WebCore/JSCanvasRenderingContext2D.cpp:1826:5)> + 24 (JSDOMConvertBase.h:168) [inlined]
18  com.apple.WebCore                   0x000000011b0292b8 jsCanvasRenderingContext2DPrototypeFunction_drawImage1Body + 72 (JSCanvasRenderingContext2D.cpp:1826) [inlined]
19  com.apple.WebCore                   0x000000011b0292b8 jsCanvasRenderingContext2DPrototypeFunction_drawImageOverloadDispatcher + 624 (JSCanvasRenderingContext2D.cpp:1903) [inlined]
20  com.apple.WebCore                   0x000000011b0292b8 call<&WebCore::jsCanvasRenderingContext2DPrototypeFunction_drawImageOverloadDispatcher, WebCore::CastedThisErrorBehavior::Throw> + 624 (JSDOMOperation.h:63) [inlined]
21  com.apple.WebCore                   0x000000011b0292b8 WebCore::jsCanvasRenderingContext2DPrototypeFunction_drawImage(JSC::JSGlobalObject*, JSC::CallFrame*) + 1036 (JSCanvasRenderingContext2D.cpp:1916)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220227/5c1c8055/attachment-0001.htm>


More information about the webkit-unassigned mailing list