Element with blur backdrop-filter shows edge duplication and dark edges
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Jun 2015 22:06:45 +0000 (22:06 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Jun 2015 22:06:45 +0000 (22:06 +0000)
commitb600770e8db55152c904466842647f356b5fba6f
tree8703f3f18d7700d14663cf6c5cd6d0681c5ad9bc
parent2eee69dd46833a4c3a935654420bde3e23b3d20c
Element with blur backdrop-filter shows edge duplication and dark edges
https://bugs.webkit.org/show_bug.cgi?id=146215
<rdar://problem/20367695>

Reviewed by Tim Horton.

Source/WebCore:

The input images to backdrop filters should duplicate their edge pixels
outwards, rather than using transparent pixels. This is a flag we
set on the Gaussian blur, but means we have to remember if the
FilterOperations list came from a regular filter or a backdrop filter.

Test: css3/filters/backdrop/blur-input-bounds.html

* css/CSSPropertyNames.in: New custom convertor for backdrop-filter.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertBackdropFilterOperations): New convertor
that sets the backdrop flag, but is otherwise the same as a normal filter
convertor.
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFilterOperations): Inherit the backdrop flag if either of our
inputs has it.
* platform/graphics/ca/mac/PlatformCAFiltersMac.mm: Set the inputNormalizeEdges
key on the CAFilter if necessary.
* platform/graphics/filters/FilterOperations.cpp: Add a new flag indicating if
these operations are intended for backdrops.
(WebCore::FilterOperations::operator=):
(WebCore::FilterOperations::operator==):
* platform/graphics/filters/FilterOperations.h:
(WebCore::FilterOperations::isUsedForBackdropFilters):
(WebCore::FilterOperations::setUsedForBackdropFilters):

LayoutTests:

Add a pixel test to show that the input images to backdrop filters should duplicate their
edge pixels. Unfortunately this is not reproducible with normal filters, so it
can't be a reference test.

* css3/filters/backdrop/blur-input-bounds.html: Added.
* platform/mac/css3/filters/backdrop/blur-input-bounds-expected.png: Added.
* platform/mac/css3/filters/backdrop/blur-input-bounds-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185846 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/css3/filters/backdrop/blur-input-bounds.html [new file with mode: 0644]
LayoutTests/platform/mac/css3/filters/backdrop/blur-input-bounds-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/css3/filters/backdrop/blur-input-bounds-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSPropertyNames.in
Source/WebCore/css/StyleBuilderConverter.h
Source/WebCore/page/animation/CSSPropertyAnimation.cpp
Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm
Source/WebCore/platform/graphics/filters/FilterOperations.cpp
Source/WebCore/platform/graphics/filters/FilterOperations.h