Skip to content

Commit

Permalink
Merge r269599 - [TextureMapper] backdrop-filter should use the identi…
Browse files Browse the repository at this point in the history
…ty transform to render the root layer

https://bugs.webkit.org/show_bug.cgi?id=218699

Reviewed by Don Olmstead.

Source/WebCore:

Even thouth CSS reflections mirror the content, backdrop-filter in
the reflection doesn't. It sees through the background.
css3/filters/backdrop/backdrop-filter-with-reflection.html is the
test case.

* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica):
(WebCore::TextureMapperLayer::paintIntoSurface):
(WebCore::TextureMapperLayer::paintWithIntermediateSurface):
Removed TextureMapperPaintOptions::isReplica.

LayoutTests:

* platform/glib/TestExpectations: Unmarked
css3/filters/backdrop/{backdrop-filter-with-reflection-add-backdrop.html,
backdrop-filter-with-reflection-value-change.html,backdrop-filter-with-reflection.html}
  • Loading branch information
fujii authored and carlosgcampos committed Nov 20, 2020
1 parent 866dfa8 commit 77a72d0
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 13 deletions.
11 changes: 11 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
2020-11-09 Fujii Hironori <Hironori.Fujii@sony.com>

[TextureMapper] backdrop-filter should use the identity transform to render the root layer
https://bugs.webkit.org/show_bug.cgi?id=218699

Reviewed by Don Olmstead.

* platform/glib/TestExpectations: Unmarked
css3/filters/backdrop/{backdrop-filter-with-reflection-add-backdrop.html,
backdrop-filter-with-reflection-value-change.html,backdrop-filter-with-reflection.html}

2020-11-09 Fujii Hironori <Hironori.Fujii@sony.com>

[TextureMapper] The top and left sides of drop-shadow are clipped
Expand Down
3 changes: 0 additions & 3 deletions LayoutTests/platform/glib/TestExpectations
Expand Up @@ -175,9 +175,6 @@ webkit.org/b/169988 css3/filters/backdrop/backdrop-filter-with-border-radius-and
webkit.org/b/169988 css3/filters/backdrop/backdrop-filter-with-border-radius-and-reflection.html [ ImageOnlyFailure ]
webkit.org/b/169988 css3/filters/backdrop/backdrop-filter-with-border-radius-value-change.html [ ImageOnlyFailure ]
webkit.org/b/169988 css3/filters/backdrop/backdrop-filter-with-border-radius.html [ ImageOnlyFailure ]
webkit.org/b/169988 css3/filters/backdrop/backdrop-filter-with-reflection-add-backdrop.html [ ImageOnlyFailure ]
webkit.org/b/169988 css3/filters/backdrop/backdrop-filter-with-reflection-value-change.html [ ImageOnlyFailure ]
webkit.org/b/169988 css3/filters/backdrop/backdrop-filter-with-reflection.html [ ImageOnlyFailure ]
webkit.org/b/169988 css3/filters/backdrop/effect-hw.html [ ImageOnlyFailure ]

webkit.org/b/214682 imported/w3c/web-platform-tests/css/cssom/stylesheet-same-origin.sub.html [ Pass Failure ]
Expand Down
18 changes: 18 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,21 @@
2020-11-09 Fujii Hironori <Hironori.Fujii@sony.com>

[TextureMapper] backdrop-filter should use the identity transform to render the root layer
https://bugs.webkit.org/show_bug.cgi?id=218699

Reviewed by Don Olmstead.

Even thouth CSS reflections mirror the content, backdrop-filter in
the reflection doesn't. It sees through the background.
css3/filters/backdrop/backdrop-filter-with-reflection.html is the
test case.

* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica):
(WebCore::TextureMapperLayer::paintIntoSurface):
(WebCore::TextureMapperLayer::paintWithIntermediateSurface):
Removed TextureMapperPaintOptions::isReplica.

2020-11-09 Fujii Hironori <Hironori.Fujii@sony.com>

[TextureMapper] The top and left sides of drop-shadow are clipped
Expand Down
12 changes: 2 additions & 10 deletions Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
Expand Up @@ -39,7 +39,6 @@ class TextureMapperPaintOptions {
float opacity { 1 };
IntSize offset;
TextureMapperLayer* backdropLayer { nullptr };
bool isReplica { false };
};

TextureMapperLayer::TextureMapperLayer() = default;
Expand Down Expand Up @@ -291,10 +290,7 @@ void TextureMapperLayer::paintSelfAndChildrenWithReplica(const TextureMapperPain
{
if (m_state.replicaLayer) {
TextureMapperPaintOptions replicaOptions(options);
replicaOptions.isReplica = true;
replicaOptions.transform
.multiply(m_state.replicaLayer->m_layerTransforms.combined)
.multiply(m_layerTransforms.combined.inverse().valueOr(TransformationMatrix()));
replicaOptions.transform.multiply(replicaTransform());
paintSelfAndChildren(replicaOptions);
}

Expand Down Expand Up @@ -429,6 +425,7 @@ void TextureMapperLayer::paintIntoSurface(TextureMapperPaintOptions& options)
options.textureMapper.bindSurface(options.surface.get());
if (m_isBackdrop) {
TextureMapperPaintOptions paintOptions(options);
paintOptions.transform = TransformationMatrix();
paintOptions.backdropLayer = this;
rootLayer().paintSelfAndChildren(paintOptions);
} else
Expand All @@ -454,18 +451,13 @@ void TextureMapperLayer::paintWithIntermediateSurface(const TextureMapperPaintOp
paintOptions.offset = -toIntSize(rect.location());
paintOptions.opacity = 1;
if (m_state.replicaLayer) {
paintOptions.isReplica = true;
paintOptions.transform.multiply(replicaTransform());
paintIntoSurface(paintOptions);
paintOptions.isReplica = false;
paintOptions.transform = options.transform;
if (m_state.replicaLayer->m_state.maskLayer)
m_state.replicaLayer->m_state.maskLayer->applyMask(paintOptions);
}

if (m_isBackdrop && m_effectTarget->m_state.replicaLayer && options.isReplica)
paintOptions.transform = m_effectTarget->replicaTransform();

paintIntoSurface(paintOptions);

commitSurface(options, *paintOptions.surface, rect, options.opacity);
Expand Down

0 comments on commit 77a72d0

Please sign in to comment.