Title: [268281] trunk
Revision
268281
Author
[email protected]
Date
2020-10-09 12:55:34 -0700 (Fri, 09 Oct 2020)

Log Message

[WinCairo][GraphicsLayerTextureMapper] backdrop-filter support
https://bugs.webkit.org/show_bug.cgi?id=217081

Reviewed by Don Olmstead.

.:

* Source/cmake/OptionsWin.cmake: Turn ENABLE_FILTERS_LEVEL_2 on for WinCairo.

Source/WebCore:

r264968 added TextureMapper backdrop-filter support for
Coordinated Graphics. This change enables it for
GraphicsLayerTextureMapper.

Existing backdrop-filter tests cover this change, but WinCairo DRT
and WTR don't support pixel dump in AC mode yet (Bug 215041).

* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
(WebCore::GraphicsLayerTextureMapper::flushCompositingState):
(WebCore::GraphicsLayerTextureMapper::setBackdropFilters):
(WebCore::GraphicsLayerTextureMapper::setBackdropFiltersRect):
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:

Modified Paths

Diff

Modified: trunk/ChangeLog (268280 => 268281)


--- trunk/ChangeLog	2020-10-09 19:51:11 UTC (rev 268280)
+++ trunk/ChangeLog	2020-10-09 19:55:34 UTC (rev 268281)
@@ -1,3 +1,12 @@
+2020-10-09  Fujii Hironori  <[email protected]>
+
+        [WinCairo][GraphicsLayerTextureMapper] backdrop-filter support
+        https://bugs.webkit.org/show_bug.cgi?id=217081
+
+        Reviewed by Don Olmstead.
+
+        * Source/cmake/OptionsWin.cmake: Turn ENABLE_FILTERS_LEVEL_2 on for WinCairo.
+
 2020-10-08  Keith Rollin  <[email protected]>
 
         Remove copy-webkitlibraries-to-product-directory

Modified: trunk/Source/WebCore/ChangeLog (268280 => 268281)


--- trunk/Source/WebCore/ChangeLog	2020-10-09 19:51:11 UTC (rev 268280)
+++ trunk/Source/WebCore/ChangeLog	2020-10-09 19:55:34 UTC (rev 268281)
@@ -1,5 +1,26 @@
 2020-10-09  Fujii Hironori  <[email protected]>
 
+        [WinCairo][GraphicsLayerTextureMapper] backdrop-filter support
+        https://bugs.webkit.org/show_bug.cgi?id=217081
+
+        Reviewed by Don Olmstead.
+
+        r264968 added TextureMapper backdrop-filter support for
+        Coordinated Graphics. This change enables it for
+        GraphicsLayerTextureMapper.
+
+        Existing backdrop-filter tests cover this change, but WinCairo DRT
+        and WTR don't support pixel dump in AC mode yet (Bug 215041).
+
+        * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
+        (WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
+        (WebCore::GraphicsLayerTextureMapper::flushCompositingState):
+        (WebCore::GraphicsLayerTextureMapper::setBackdropFilters):
+        (WebCore::GraphicsLayerTextureMapper::setBackdropFiltersRect):
+        * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
+
+2020-10-09  Fujii Hironori  <[email protected]>
+
         [WinCairo][GraphicsLayerTextureMapper] Image layers are entirely clipped since r260174
         https://bugs.webkit.org/show_bug.cgi?id=217507
 

Modified: trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp (268280 => 268281)


--- trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp	2020-10-09 19:51:11 UTC (rev 268280)
+++ trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp	2020-10-09 19:55:34 UTC (rev 268281)
@@ -416,6 +416,23 @@
     if (m_changeMask & ReplicaLayerChange)
         m_layer.setReplicaLayer(&downcast<GraphicsLayerTextureMapper>(replicaLayer())->layer());
 
+    if (m_changeMask & BackdropLayerChange) {
+        if (needsBackdrop()) {
+            if (!m_backdropLayer) {
+                m_backdropLayer = makeUnique<TextureMapperLayer>();
+                m_backdropLayer->setAnchorPoint(FloatPoint3D());
+                m_backdropLayer->setContentsVisible(true);
+                m_backdropLayer->setMasksToBounds(true);
+            }
+            m_backdropLayer->setFilters(m_backdropFilters);
+            m_backdropLayer->setSize(m_backdropFiltersRect.rect().size());
+            m_backdropLayer->setPosition(m_backdropFiltersRect.rect().location());
+        } else
+            m_backdropLayer = nullptr;
+
+        m_layer.setBackdropLayer(m_backdropLayer.get());
+    }
+
     if (m_changeMask & PositionChange)
         m_layer.setPosition(position());
 
@@ -491,10 +508,16 @@
 
     flushCompositingStateForThisLayerOnly();
 
+    auto now = MonotonicTime::now();
+
     if (maskLayer())
         maskLayer()->flushCompositingState(rect);
-    if (replicaLayer())
+    if (replicaLayer()) {
         replicaLayer()->flushCompositingState(rect);
+        downcast<GraphicsLayerTextureMapper>(replicaLayer())->layer().applyAnimationsRecursively(now);
+    }
+    if (m_backdropLayer)
+        m_backdropLayer->applyAnimationsRecursively(now);
     for (auto& child : children())
         child->flushCompositingState(rect);
 }
@@ -625,5 +648,30 @@
     return canCompositeFilters;
 }
 
+bool GraphicsLayerTextureMapper::setBackdropFilters(const FilterOperations& filters)
+{
+    bool canCompositeFilters = filtersCanBeComposited(filters);
+    if (m_backdropFilters == filters)
+        return canCompositeFilters;
+
+    if (canCompositeFilters)
+        GraphicsLayer::setBackdropFilters(filters);
+    else
+        clearBackdropFilters();
+
+    notifyChange(BackdropLayerChange);
+
+    return canCompositeFilters;
 }
+
+void GraphicsLayerTextureMapper::setBackdropFiltersRect(const FloatRoundedRect& backdropFiltersRect)
+{
+    if (m_backdropFiltersRect == backdropFiltersRect)
+        return;
+
+    GraphicsLayer::setBackdropFiltersRect(backdropFiltersRect);
+    notifyChange(BackdropLayerChange);
+}
+
+}
 #endif

Modified: trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h (268280 => 268281)


--- trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h	2020-10-09 19:51:11 UTC (rev 268280)
+++ trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h	2020-10-09 19:55:34 UTC (rev 268281)
@@ -61,6 +61,8 @@
     void setBackfaceVisibility(bool) override;
     void setOpacity(float) override;
     bool setFilters(const FilterOperations&) override;
+    bool setBackdropFilters(const FilterOperations&) override;
+    void setBackdropFiltersRect(const FloatRoundedRect&) override;
 
     void setNeedsDisplay() override;
     void setNeedsDisplayInRect(const FloatRect&, ShouldClipToLayer = ClipToLayer) override;
@@ -146,10 +148,12 @@
         RepaintCountChange =        (1L << 25),
 
         AnimationStarted =          (1L << 26),
+        BackdropLayerChange =       (1L << 27),
     };
     void notifyChange(ChangeMask);
 
     TextureMapperLayer m_layer;
+    std::unique_ptr<TextureMapperLayer> m_backdropLayer;
     RefPtr<TextureMapperTiledBackingStore> m_compositedImage;
     NativeImagePtr m_compositedNativeImagePtr;
     RefPtr<TextureMapperTiledBackingStore> m_backingStore;

Modified: trunk/Source/cmake/OptionsWin.cmake (268280 => 268281)


--- trunk/Source/cmake/OptionsWin.cmake	2020-10-09 19:51:11 UTC (rev 268280)
+++ trunk/Source/cmake/OptionsWin.cmake	2020-10-09 19:55:34 UTC (rev 268281)
@@ -69,6 +69,7 @@
     WEBKIT_OPTION_DEFINE(ENABLE_TLS_DEBUG "Enable TLS key log support" PRIVATE OFF)
 
     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_CONIC_GRADIENTS PRIVATE ON)
+    WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_FILTERS_LEVEL_2 PRIVATE ON)
     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_LEGACY_ENCRYPTED_MEDIA PUBLIC OFF)
     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_PUBLIC_SUFFIX_LIST PRIVATE ON)
     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_USER_MESSAGE_HANDLERS PRIVATE ON)
@@ -78,7 +79,6 @@
     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_APPLICATION_MANIFEST PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_PAINTING_API PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_TYPED_OM PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
-    WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_FILTERS_LEVEL_2 PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_LAYOUT_FORMATTING_CONTEXT PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_REMOTE_INSPECTOR PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_RESOURCE_LOAD_STATISTICS PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to