WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-242097-20220629130124.patch (text/plain), 18.14 KB, created by
Fujii Hironori
on 2022-06-28 21:01:25 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Fujii Hironori
Created:
2022-06-28 21:01:25 PDT
Size:
18.14 KB
patch
obsolete
>From a16ad5fede5671d30c5938970a9e15496e8ffdff Mon Sep 17 00:00:00 2001 >From: Fujii Hironori <Hironori.Fujii@sony.com> >Date: Wed, 29 Jun 2022 12:44:56 +0900 >Subject: [PATCH] Add setContentsRectClipsDescendants support to TextureMapper, > GraphicsLayerTextureMapper, GraphicsLayerWC and CoordinatedGraphicsLayer > https://bugs.webkit.org/show_bug.cgi?id=242097 > >Reviewed by NOBODY (OOPS!). > ><https://commits.webkit.org/224136@main> added >GraphicsLayer::setContentsRectClipsDescendants to support rounded >clipping descendant layers. <https://commits.webkit.org/230829@main> >added rounded corner clipping support to TextureMapperGL. > >This change added setContentsRectClipsDescendants support to >TextureMapper, GraphicsLayerTextureMapper, GraphicsLayerWC and >CoordinatedGraphicsLayer. > >The following test cases cover this change: > compositing/iframes/border-radius-composited-frame.html > compositing/iframes/border-uneven-radius-composited-frame.html > >* LayoutTests/platform/gtk/TestExpectations: >* Source/WebCore/platform/graphics/GraphicsLayer.cpp: >(WebCore::GraphicsLayer::supportsRoundedClip): >* Source/WebCore/platform/graphics/nicosia/NicosiaPlatformLayer.h: >* Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: >(WebCore::GraphicsLayerTextureMapper::setContentsRectClipsDescendants): >(WebCore::GraphicsLayerTextureMapper::commitLayerChanges): >* Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h: >* Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp: >(WebCore::TextureMapperLayer::paintSelfAndChildren): >(WebCore::TextureMapperLayer::setContentsRectClipsDescendants): >* Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h: >* Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: >(WebCore::CoordinatedGraphicsLayer::setContentsRectClipsDescendants): >(WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly): >* Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h: >* Source/WebKit/GPUProcess/graphics/wc/WCScene.cpp: >(WebKit::WCScene::update): >* Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: >(WebKit::CoordinatedGraphicsScene::updateSceneState): >* Source/WebKit/WebProcess/WebPage/wc/GraphicsLayerWC.cpp: >(WebKit::GraphicsLayerWC::setContentsRectClipsDescendants): >(WebKit::GraphicsLayerWC::flushCompositingStateForThisLayerOnly): >* Source/WebKit/WebProcess/WebPage/wc/GraphicsLayerWC.h: >* Source/WebKit/WebProcess/WebPage/wc/WCUpateInfo.h: >(WebKit::WCLayerUpateInfo::encode const): >(WebKit::WCLayerUpateInfo::decode): >--- > .../WebCore/platform/graphics/GraphicsLayer.cpp | 2 +- > .../graphics/nicosia/NicosiaPlatformLayer.h | 1 + > .../texmap/GraphicsLayerTextureMapper.cpp | 10 ++++++++++ > .../graphics/texmap/GraphicsLayerTextureMapper.h | 1 + > .../graphics/texmap/TextureMapperLayer.cpp | 15 ++++++++++++--- > .../platform/graphics/texmap/TextureMapperLayer.h | 2 ++ > .../coordinated/CoordinatedGraphicsLayer.cpp | 11 +++++++++++ > .../texmap/coordinated/CoordinatedGraphicsLayer.h | 1 + > Source/WebKit/GPUProcess/graphics/wc/WCScene.cpp | 4 +++- > .../CoordinatedGraphicsScene.cpp | 1 + > .../WebProcess/WebPage/wc/GraphicsLayerWC.cpp | 13 ++++++++++++- > .../WebProcess/WebPage/wc/GraphicsLayerWC.h | 1 + > Source/WebKit/WebProcess/WebPage/wc/WCUpateInfo.h | 7 ++++++- > LayoutTests/platform/gtk/TestExpectations | 3 --- > 14 files changed, 62 insertions(+), 10 deletions(-) > >diff --git a/Source/WebCore/platform/graphics/GraphicsLayer.cpp b/Source/WebCore/platform/graphics/GraphicsLayer.cpp >index 9d7d266e8804..1867bda8554a 100644 >--- a/Source/WebCore/platform/graphics/GraphicsLayer.cpp >+++ b/Source/WebCore/platform/graphics/GraphicsLayer.cpp >@@ -90,7 +90,7 @@ bool GraphicsLayer::supportsLayerType(Type type) > > bool GraphicsLayer::supportsRoundedClip() > { >- return false; >+ return true; > } > > bool GraphicsLayer::supportsBackgroundColorContent() >diff --git a/Source/WebCore/platform/graphics/nicosia/NicosiaPlatformLayer.h b/Source/WebCore/platform/graphics/nicosia/NicosiaPlatformLayer.h >index 9008c15c46d0..c261a9fc2dfb 100644 >--- a/Source/WebCore/platform/graphics/nicosia/NicosiaPlatformLayer.h >+++ b/Source/WebCore/platform/graphics/nicosia/NicosiaPlatformLayer.h >@@ -154,6 +154,7 @@ public: > bool contentsVisible : 1; > bool backfaceVisible : 1; > bool masksToBounds : 1; >+ bool contentsRectClipsDescendants : 1; > bool preserves3D : 1; > }; > uint32_t value { 0 }; >diff --git a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp b/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp >index 465a57e1c558..1dc3c37716d0 100644 >--- a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp >+++ b/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp >@@ -289,6 +289,15 @@ void GraphicsLayerTextureMapper::setContentsClippingRect(const FloatRoundedRect& > notifyChange(ContentsRectChange); > } > >+void GraphicsLayerTextureMapper::setContentsRectClipsDescendants(bool contentsRectClipsDescendants) >+{ >+ if (contentsRectClipsDescendants == m_contentsRectClipsDescendants) >+ return; >+ >+ GraphicsLayer::setContentsRectClipsDescendants(contentsRectClipsDescendants); >+ notifyChange(ContentsRectChange); >+} >+ > void GraphicsLayerTextureMapper::setContentsToSolidColor(const Color& color) > { > if (color == m_solidColor) >@@ -473,6 +482,7 @@ void GraphicsLayerTextureMapper::commitLayerChanges() > if (m_changeMask & ContentsRectChange) { > m_layer.setContentsRect(contentsRect()); > m_layer.setContentsClippingRect(contentsClippingRect()); >+ m_layer.setContentsRectClipsDescendants(contentsRectClipsDescendants()); > } > > if (m_changeMask & MasksToBoundsChange) >diff --git a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h b/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h >index 0c89ba3a5948..378a1d8d8547 100644 >--- a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h >+++ b/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h >@@ -71,6 +71,7 @@ public: > void setContentsNeedsDisplay() override; > void setContentsRect(const FloatRect&) override; > void setContentsClippingRect(const FloatRoundedRect&) override; >+ void setContentsRectClipsDescendants(bool) override; > > bool addAnimation(const KeyframeValueList&, const FloatSize&, const Animation*, const String&, double) override; > void pauseAnimation(const String&, double) override; >diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp >index 98a25da58f80..669910832fbd 100644 >--- a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp >+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp >@@ -256,14 +256,18 @@ void TextureMapperLayer::paintSelfAndChildren(TextureMapperPaintOptions& options > if (m_children.isEmpty()) > return; > >- bool shouldClip = m_state.masksToBounds && !m_state.preserves3D; >+ bool shouldClip = (m_state.masksToBounds || m_state.contentsRectClipsDescendants) && !m_state.preserves3D; > if (shouldClip) { > TransformationMatrix clipTransform; > clipTransform.translate(options.offset.width(), options.offset.height()); > clipTransform.multiply(options.transform); > clipTransform.multiply(m_layerTransforms.combined); >- clipTransform.translate(m_state.boundsOrigin.x(), m_state.boundsOrigin.y()); >- options.textureMapper.beginClip(clipTransform, FloatRoundedRect(layerRect())); >+ if (m_state.contentsRectClipsDescendants) >+ options.textureMapper.beginClip(clipTransform, m_state.contentsClippingRect); >+ else { >+ clipTransform.translate(m_state.boundsOrigin.x(), m_state.boundsOrigin.y()); >+ options.textureMapper.beginClip(clipTransform, FloatRoundedRect(layerRect())); >+ } > > // If as a result of beginClip(), the clipping area is empty, it means that the intersection of the previous > // clipping area and the current one don't have any pixels in common. In this case we can skip painting the >@@ -696,6 +700,11 @@ void TextureMapperLayer::setContentsClippingRect(const FloatRoundedRect& content > m_state.contentsClippingRect = contentsClippingRect; > } > >+void TextureMapperLayer::setContentsRectClipsDescendants(bool clips) >+{ >+ m_state.contentsRectClipsDescendants = clips; >+} >+ > void TextureMapperLayer::setMasksToBounds(bool masksToBounds) > { > m_state.masksToBounds = masksToBounds; >diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h b/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h >index 0f4e3697b302..fd6cad5ec29f 100644 >--- a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h >+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h >@@ -77,6 +77,7 @@ public: > void setContentsTileSize(const FloatSize&); > void setContentsTilePhase(const FloatSize&); > void setContentsClippingRect(const FloatRoundedRect&); >+ void setContentsRectClipsDescendants(bool); > void setFilters(const FilterOperations&); > > bool hasFilters() const >@@ -189,6 +190,7 @@ private: > bool drawsContent : 1; > bool contentsVisible : 1; > bool contentsOpaque : 1; >+ bool contentsRectClipsDescendants : 1; > bool backfaceVisibility : 1; > bool visible : 1; > bool showDebugBorders : 1; >diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp >index 7669a11dba27..63711438a86f 100644 >--- a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp >+++ b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp >@@ -469,6 +469,16 @@ void CoordinatedGraphicsLayer::setContentsClippingRect(const FloatRoundedRect& r > notifyFlushRequired(); > } > >+void CoordinatedGraphicsLayer::setContentsRectClipsDescendants(bool clips) >+{ >+ if (contentsRectClipsDescendants() == clips) >+ return; >+ >+ GraphicsLayer::setContentsRectClipsDescendants(clips); >+ m_nicosia.delta.flagsChanged = true; >+ notifyFlushRequired(); >+} >+ > bool GraphicsLayer::supportsContentsTiling() > { > return true; >@@ -1011,6 +1021,7 @@ void CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly() > state.flags.contentsVisible = contentsAreVisible(); > state.flags.backfaceVisible = backfaceVisibility(); > state.flags.masksToBounds = masksToBounds(); >+ state.flags.contentsRectClipsDescendants = contentsRectClipsDescendants(); > state.flags.preserves3D = preserves3D(); > } > >diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h >index 97dec59bf179..3f5abf92e68a 100644 >--- a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h >+++ b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h >@@ -91,6 +91,7 @@ public: > void setContentsTilePhase(const FloatSize&) override; > void setContentsTileSize(const FloatSize&) override; > void setContentsClippingRect(const FloatRoundedRect&) override; >+ void setContentsRectClipsDescendants(bool) override; > void setContentsToImage(Image*) override; > void setContentsToSolidColor(const Color&) override; > void setShowDebugBorder(bool) override; >diff --git a/Source/WebKit/GPUProcess/graphics/wc/WCScene.cpp b/Source/WebKit/GPUProcess/graphics/wc/WCScene.cpp >index 7a1667f7a123..decfccce315e 100644 >--- a/Source/WebKit/GPUProcess/graphics/wc/WCScene.cpp >+++ b/Source/WebKit/GPUProcess/graphics/wc/WCScene.cpp >@@ -123,8 +123,10 @@ std::optional<UpdateInfo> WCScene::update(WCUpateInfo&& update) > layer->texmapLayer.setPreserves3D(layerUpdate.preserves3D); > if (layerUpdate.changes & WCLayerChange::ContentsRect) > layer->texmapLayer.setContentsRect(layerUpdate.contentsRect); >- if (layerUpdate.changes & WCLayerChange::ContentsClippingRect) >+ if (layerUpdate.changes & WCLayerChange::ContentsClippingRect) { > layer->texmapLayer.setContentsClippingRect(layerUpdate.contentsClippingRect); >+ layer->texmapLayer.setContentsRectClipsDescendants(layerUpdate.contentsRectClipsDescendants); >+ } > if (layerUpdate.changes & WCLayerChange::ContentsVisible) > layer->texmapLayer.setContentsVisible(layerUpdate.contentsVisible); > if (layerUpdate.changes & WCLayerChange::BackfaceVisibility) >diff --git a/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp b/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp >index f71fb695e239..fce0664942eb 100644 >--- a/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp >+++ b/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp >@@ -339,6 +339,7 @@ void CoordinatedGraphicsScene::updateSceneState() > layer.setContentsVisible(layerState.flags.contentsVisible); > layer.setBackfaceVisibility(layerState.flags.backfaceVisible); > layer.setMasksToBounds(layerState.flags.masksToBounds); >+ layer.setContentsRectClipsDescendants(layerState.flags.contentsRectClipsDescendants); > layer.setPreserves3D(layerState.flags.preserves3D); > } > >diff --git a/Source/WebKit/WebProcess/WebPage/wc/GraphicsLayerWC.cpp b/Source/WebKit/WebProcess/WebPage/wc/GraphicsLayerWC.cpp >index a57522ff08c3..30805896643e 100644 >--- a/Source/WebKit/WebProcess/WebPage/wc/GraphicsLayerWC.cpp >+++ b/Source/WebKit/WebProcess/WebPage/wc/GraphicsLayerWC.cpp >@@ -356,6 +356,15 @@ void GraphicsLayerWC::setContentsClippingRect(const FloatRoundedRect& value) > noteLayerPropertyChanged(WCLayerChange::ContentsClippingRect); > } > >+void GraphicsLayerWC::setContentsRectClipsDescendants(bool contentsRectClipsDescendants) >+{ >+ if (contentsRectClipsDescendants == m_contentsRectClipsDescendants) >+ return; >+ >+ GraphicsLayer::setContentsRectClipsDescendants(contentsRectClipsDescendants); >+ noteLayerPropertyChanged(WCLayerChange::ContentsClippingRect); >+} >+ > void GraphicsLayerWC::setDrawsContent(bool value) > { > if (value == drawsContent()) >@@ -536,8 +545,10 @@ void GraphicsLayerWC::flushCompositingStateForThisLayerOnly() > update.preserves3D = preserves3D(); > if (update.changes & WCLayerChange::ContentsRect) > update.contentsRect = contentsRect(); >- if (update.changes & WCLayerChange::ContentsClippingRect) >+ if (update.changes & WCLayerChange::ContentsClippingRect) { > update.contentsClippingRect = contentsClippingRect(); >+ update.contentsRectClipsDescendants = contentsRectClipsDescendants(); >+ } > if (update.changes & WCLayerChange::ContentsVisible) > update.contentsVisible = contentsAreVisible(); > if (update.changes & WCLayerChange::BackfaceVisibility) >diff --git a/Source/WebKit/WebProcess/WebPage/wc/GraphicsLayerWC.h b/Source/WebKit/WebProcess/WebPage/wc/GraphicsLayerWC.h >index 35438867fe01..290509796bde 100644 >--- a/Source/WebKit/WebProcess/WebPage/wc/GraphicsLayerWC.h >+++ b/Source/WebKit/WebProcess/WebPage/wc/GraphicsLayerWC.h >@@ -77,6 +77,7 @@ public: > void setOpacity(float) override; > void setContentsRect(const WebCore::FloatRect&) override; > void setContentsClippingRect(const WebCore::FloatRoundedRect&) override; >+ void setContentsRectClipsDescendants(bool) override; > void setDrawsContent(bool) override; > void setContentsVisible(bool) override; > void setBackfaceVisibility(bool) override; >diff --git a/Source/WebKit/WebProcess/WebPage/wc/WCUpateInfo.h b/Source/WebKit/WebProcess/WebPage/wc/WCUpateInfo.h >index 95e6375ee307..ec51e80b01d2 100644 >--- a/Source/WebKit/WebProcess/WebPage/wc/WCUpateInfo.h >+++ b/Source/WebKit/WebProcess/WebPage/wc/WCUpateInfo.h >@@ -102,6 +102,7 @@ struct WCLayerUpateInfo { > WebCore::FloatSize size; > WebCore::FloatPoint boundsOrigin; > bool masksToBounds; >+ bool contentsRectClipsDescendants; > bool showDebugBorder; > bool showRepaintCounter; > bool contentsVisible; >@@ -154,8 +155,10 @@ struct WCLayerUpateInfo { > encoder << showRepaintCounter << repaintCount; > if (changes & WCLayerChange::ContentsRect) > encoder << contentsRect; >- if (changes & WCLayerChange::ContentsClippingRect) >+ if (changes & WCLayerChange::ContentsClippingRect) { > encoder << contentsClippingRect; >+ encoder << contentsRectClipsDescendants; >+ } > if (changes & WCLayerChange::Opacity) > encoder << opacity; > if (changes & WCLayerChange::Background) >@@ -242,6 +245,8 @@ struct WCLayerUpateInfo { > if (result.changes & WCLayerChange::ContentsClippingRect) { > if (!decoder.decode(result.contentsClippingRect)) > return false; >+ if (!decoder.decode(result.contentsRectClipsDescendants)) >+ return false; > } > if (result.changes & WCLayerChange::Opacity) { > if (!decoder.decode(result.opacity)) >diff --git a/LayoutTests/platform/gtk/TestExpectations b/LayoutTests/platform/gtk/TestExpectations >index ee137c9e4a21..f2d9b1082c91 100644 >--- a/LayoutTests/platform/gtk/TestExpectations >+++ b/LayoutTests/platform/gtk/TestExpectations >@@ -853,9 +853,6 @@ webkit.org/b/210850 compositing/tiling/coverage-adjustment-secondary-quad-mappin > > webkit.org/b/210239 fast/canvas/webgl/index-validation-with-subsequent-draws.html [ Failure ] > >-webkit.org/b/211501 compositing/iframes/border-radius-composited-frame.html [ ImageOnlyFailure ] >-webkit.org/b/211501 compositing/iframes/border-uneven-radius-composited-frame.html [ ImageOnlyFailure ] >- > # The first one is also crashing for both GTK and WPE debug > webkit.org/b/211887 [ Release ] fast/canvas/webgl/tex-sub-image-2d-bad-args.html [ Failure ] > webkit.org/b/211887 webgl/1.0.3/conformance/more/functions/texSubImage2DHTMLBadArgs.html [ Failure ]
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 242097
:
460528
|
460529
|
460555