Title: [293971] trunk/Source/WebCore
Revision
293971
Author
[email protected]
Date
2022-05-09 03:54:10 -0700 (Mon, 09 May 2022)

Log Message

[Nicosia] Canvas animations don't work with threaded rendering
https://bugs.webkit.org/show_bug.cgi?id=227760
<rdar://problem/80588913>

Reviewed by Adrian Perez de Castro.

Implement Nicosia::CairoOperationRecorder::draImageBuffer(), which is required in order to paint
canvas contents into a GraphicsContext.

* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
(Nicosia::CairoOperationRecorder::drawImageBuffer):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (293970 => 293971)


--- trunk/Source/WebCore/ChangeLog	2022-05-09 10:47:12 UTC (rev 293970)
+++ trunk/Source/WebCore/ChangeLog	2022-05-09 10:54:10 UTC (rev 293971)
@@ -1,3 +1,17 @@
+2022-05-09  Miguel Gomez  <[email protected]>
+
+        [Nicosia] Canvas animations don't work with threaded rendering
+        https://bugs.webkit.org/show_bug.cgi?id=227760
+        <rdar://problem/80588913>
+
+        Reviewed by Adrian Perez de Castro.
+
+        Implement Nicosia::CairoOperationRecorder::draImageBuffer(), which is required in order to paint
+        canvas contents into a GraphicsContext.
+
+        * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
+        (Nicosia::CairoOperationRecorder::drawImageBuffer):
+
 2022-05-09  Manuel Rego Casasnovas  <[email protected]>
 
         [WinCairo][WK1] accessibility/aria-combobox-control-owns-elements.html is crashing after 250325@main

Modified: trunk/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp (293970 => 293971)


--- trunk/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp	2022-05-09 10:47:12 UTC (rev 293970)
+++ trunk/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp	2022-05-09 10:54:10 UTC (rev 293971)
@@ -540,9 +540,32 @@
         state.strokeThickness(), state.dropShadow().offset, state.dropShadow().color, fontSmoothing));
 }
 
-void CairoOperationRecorder::drawImageBuffer(ImageBuffer&, const FloatRect&, const FloatRect&, const ImagePaintingOptions&)
+void CairoOperationRecorder::drawImageBuffer(ImageBuffer& buffer, const FloatRect& destRect, const FloatRect& srcRect, const ImagePaintingOptions& options)
 {
-    // FIXME: Not implemented.
+    struct DrawImageBuffer final : PaintingOperation, OperationData<RefPtr<cairo_surface_t>, FloatRect, FloatRect, ImagePaintingOptions, float, Cairo::ShadowState> {
+        virtual ~DrawImageBuffer() = default;
+
+        void execute(PaintingOperationReplay& replayer) override
+        {
+            Cairo::drawPlatformImage(contextForReplay(replayer), arg<0>().get(), arg<1>(), arg<2>(), arg<3>(), arg<4>(), arg<5>());
+        }
+
+        void dump(TextStream& ts) override
+        {
+            ts << indent << "DrawImageBuffer<>\n";
+        }
+    };
+
+    RefPtr<Image> image = buffer.copyImage(DontCopyBackingStore);
+    if (!image)
+        return;
+
+    auto nativeImage = image->nativeImageForCurrentFrame();
+    if (!nativeImage)
+        return;
+
+    auto& state = this->state();
+    append(createCommand<DrawImageBuffer>(nativeImage->platformImage(), destRect, srcRect, ImagePaintingOptions(options, state.imageInterpolationQuality()), state.alpha(), Cairo::ShadowState(state)));
 }
 
 void CairoOperationRecorder::drawFilteredImageBuffer(ImageBuffer* srcImage, const FloatRect& srcRect, Filter& filter, FilterResults& results)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to