WebKit Bugzilla
Attachment 343315 Details for
Bug 186914
: [WPE][ThreadedRendering] WPE crashes rendering SVG content when using ThreadedRendering
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186914-20180622112222.patch (text/plain), 8.44 KB, created by
Miguel Gomez
on 2018-06-22 02:22:23 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Miguel Gomez
Created:
2018-06-22 02:22:23 PDT
Size:
8.44 KB
patch
obsolete
>Subversion Revision: 233072 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 56f26de3cb463a463c1327b6749b5edbc66b7c07..17b76025354d39fb72ff7874c17113f4b105a528 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,29 @@ >+2018-06-22 Miguel Gomez <magomez@igalia.com> >+ >+ [WPE][ThreadedRendering] WPE crashes rendering SVG content when using ThreadedRendering >+ https://bugs.webkit.org/show_bug.cgi?id=186914 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add GraphicsContextImpl::clipToImageBuffer() to the interface and the implementors. Forward >+ the call to GraphicsContext::clipToImageBuffer() to the implementation if possible in the >+ cairo case. >+ >+ Covered by existent tests. >+ >+ * platform/graphics/GraphicsContextImpl.h: >+ * platform/graphics/cairo/GraphicsContextCairo.cpp: >+ (WebCore::GraphicsContext::clipToImageBuffer): >+ * platform/graphics/cairo/GraphicsContextImplCairo.cpp: >+ (WebCore::GraphicsContextImplCairo::clipToImageBuffer): >+ * platform/graphics/cairo/GraphicsContextImplCairo.h: >+ * platform/graphics/displaylists/DisplayListRecorder.cpp: >+ (WebCore::DisplayList::Recorder::clipToImageBuffer): >+ * platform/graphics/displaylists/DisplayListRecorder.h: >+ * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp: >+ (Nicosia::CairoOperationRecorder::clipToImageBuffer): >+ * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h: >+ > 2018-06-15 Jer Noble <jer.noble@apple.com> > > Address fullscreen api CSS env feedback >diff --git a/Source/WebCore/platform/graphics/GraphicsContextImpl.h b/Source/WebCore/platform/graphics/GraphicsContextImpl.h >index 37b7a3b95ca5067f66dcb87d48fa230c9582c934..8686d2b860d5d037a61d32e99443fccc93a43eec 100644 >--- a/Source/WebCore/platform/graphics/GraphicsContextImpl.h >+++ b/Source/WebCore/platform/graphics/GraphicsContextImpl.h >@@ -104,6 +104,7 @@ public: > virtual void clipOut(const Path&) = 0; > virtual void clipPath(const Path&, WindRule) = 0; > virtual IntRect clipBounds() = 0; >+ virtual void clipToImageBuffer(ImageBuffer&, const FloatRect&) = 0; > > virtual void applyDeviceScaleFactor(float) = 0; > >diff --git a/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp b/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp >index 6cdea187578eeb9655d11bcb3e5f331aa659e2cc..8cfb1e92257e43252706aea545b426394fe99fd6 100644 >--- a/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp >+++ b/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp >@@ -261,6 +261,11 @@ void GraphicsContext::clipToImageBuffer(ImageBuffer& buffer, const FloatRect& de > if (paintingDisabled()) > return; > >+ if (m_impl) { >+ m_impl->clipToImageBuffer(buffer, destRect); >+ return; >+ } >+ > RefPtr<Image> image = buffer.copyImage(DontCopyBackingStore); > if (!image) > return; >diff --git a/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.cpp b/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.cpp >index 5f9e459412c81ff6a3400ae01224c9d02a0ad0c6..c3d14c95b550d2763c78f564e0574a9b998244f1 100644 >--- a/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.cpp >+++ b/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.cpp >@@ -403,6 +403,16 @@ IntRect GraphicsContextImplCairo::clipBounds() > return Cairo::State::getClipBounds(m_platformContext); > } > >+void GraphicsContextImplCairo::clipToImageBuffer(ImageBuffer& buffer, const FloatRect& destRect) >+{ >+ RefPtr<Image> image = buffer.copyImage(DontCopyBackingStore); >+ if (!image) >+ return; >+ >+ if (auto surface = image->nativeImageForCurrentFrame()) >+ Cairo::clipToImageBuffer(m_platformContext, surface.get(), destRect); >+} >+ > void GraphicsContextImplCairo::applyDeviceScaleFactor(float) > { > } >diff --git a/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.h b/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.h >index 295408ccf4104c83c12b14fb5483557d3f4a5d54..79ca12dd69b997995b07302f61e3417cc8cde1ed 100644 >--- a/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.h >+++ b/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.h >@@ -105,6 +105,7 @@ public: > void clipOut(const Path&) override; > void clipPath(const Path&, WindRule) override; > IntRect clipBounds() override; >+ void clipToImageBuffer(ImageBuffer&, const FloatRect&) override; > > void applyDeviceScaleFactor(float) override; > >diff --git a/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp b/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp >index 85d0416cf38abf28e9d2ba8cb14525e0fbcc0c0d..a17c59156d91c220fb91fcdf6f589073eb195668 100644 >--- a/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp >+++ b/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp >@@ -378,6 +378,11 @@ IntRect Recorder::clipBounds() > return IntRect(-2048, -2048, 4096, 4096); > } > >+void Recorder::clipToImageBuffer(ImageBuffer&, const FloatRect&) >+{ >+ WTFLogAlways("GraphicsContext::clipToImageBuffer is not compatible with DisplayList::Recorder."); >+} >+ > void Recorder::applyDeviceScaleFactor(float deviceScaleFactor) > { > // FIXME: this changes the baseCTM, which will invalidate all of our cached extents. >diff --git a/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h b/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h >index 057bbf161bd41f4c55201dd061c8610438c02ac7..7de7d464c1be488c395257bc3ff3d9170efb5a74 100644 >--- a/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h >+++ b/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h >@@ -123,6 +123,7 @@ private: > void clipOut(const Path&) override; > void clipPath(const Path&, WindRule) override; > IntRect clipBounds() override; >+ void clipToImageBuffer(ImageBuffer&, const FloatRect&) override; > > void applyDeviceScaleFactor(float) override; > >diff --git a/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp b/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp >index ac1addfbbdd26c0072eec84c38346e5fc7e511ee..e4793ec6eeee6873e7daba858c1d181cba03ea02 100644 >--- a/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp >+++ b/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp >@@ -31,6 +31,7 @@ > > #include "CairoOperations.h" > #include "FloatRoundedRect.h" >+#include "ImageBuffer.h" > #include "NicosiaPaintingOperationReplayCairo.h" > #include <type_traits> > #include <wtf/text/TextStream.h> >@@ -1052,6 +1053,30 @@ IntRect CairoOperationRecorder::clipBounds() > return enclosingIntRect(state.ctmInverse.mapRect(state.clipBounds)); > } > >+void CairoOperationRecorder::clipToImageBuffer(ImageBuffer& buffer, const FloatRect& destRect) >+{ >+ struct ClipToImageBuffer final: PaintingOperation, OperationData<RefPtr<cairo_surface_t>, FloatRect> { >+ virtual ~ClipToImageBuffer() = default; >+ >+ void execute(PaintingOperationReplay& replayer) override >+ { >+ Cairo::clipToImageBuffer(contextForReplay(replayer), arg<0>().get(), arg<1>()); >+ } >+ >+ void dump(TextStream& ts) override >+ { >+ ts << indent << "ClipToImageBuffer<>\n"; >+ } >+ }; >+ >+ RefPtr<Image> image = buffer.copyImage(DontCopyBackingStore); >+ if (!image) >+ return; >+ >+ if (auto surface = image->nativeImageForCurrentFrame()) >+ append(createCommand<ClipToImageBuffer>(RefPtr<cairo_surface_t>(surface.get()), destRect)); >+} >+ > void CairoOperationRecorder::applyDeviceScaleFactor(float) > { > } >diff --git a/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h b/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h >index cbb9af9dd2145ac8644f0ddd907e096c3e154060..36ce637e498d47698141a50b925e0f582dcffa82 100644 >--- a/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h >+++ b/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h >@@ -98,6 +98,7 @@ private: > void clipOut(const WebCore::Path&) override; > void clipPath(const WebCore::Path&, WebCore::WindRule) override; > WebCore::IntRect clipBounds() override; >+ void clipToImageBuffer(WebCore::ImageBuffer&, const WebCore::FloatRect&) override; > > void applyDeviceScaleFactor(float) override; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186914
:
343315
|
343317
|
343318
|
343323