Skip to content
Permalink
Browse files
Special case bitmap renderers in Document::getCSSCanvasContext
https://bugs.webkit.org/show_bug.cgi?id=241505

Patch by Rob Buis <rbuis@igalia.com> on 2022-06-10
Reviewed by Alex Christensen.

Special case bitmap renderers in Document::getCSSCanvasContext.

* Source/WebCore/dom/Document.cpp:
(WebCore::Document::getCSSCanvasContext):

Canonical link: https://commits.webkit.org/251463@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295457 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
rwlbuis authored and webkit-commit-queue committed Jun 10, 2022
1 parent c1c720c commit bf8eff37bbe5cc762627b7f9f1cb6a7cb8cacf33
Showing 1 changed file with 3 additions and 0 deletions.
@@ -6580,6 +6580,9 @@ std::optional<RenderingContext> Document::getCSSCanvasContext(const String& type
return RenderingContext { RefPtr<WebGL2RenderingContext> { &downcast<WebGL2RenderingContext>(*context) } };
#endif

if (is<ImageBitmapRenderingContext>(*context))
return RenderingContext { RefPtr<ImageBitmapRenderingContext> { &downcast<ImageBitmapRenderingContext>(*context) } };

return RenderingContext { RefPtr<CanvasRenderingContext2D> { &downcast<CanvasRenderingContext2D>(*context) } };
}

0 comments on commit bf8eff3

Please sign in to comment.