haikuwebkit/LayoutTests/fast/hidpi/filters-hue-rotate-expected...

22 lines
646 B
HTML
Raw Permalink Normal View History

-webkit-filter prevents rendering at retina scale https://bugs.webkit.org/show_bug.cgi?id=93471 Reviewed by Dirk Schulze. Source/WebCore: Implement 2x support for filters that go through the -webkit-filter property. This includes all shorthand filters, and any referenced SVG-style filters (as long as they use only the supported subset of operations - basically the same as is exposed for the shorthands). Tests: fast/hidpi/filters-blur.html fast/hidpi/filters-hue-rotate.html fast/hidpi/filters-invert.html fast/hidpi/filters-multiple.html fast/hidpi/filters-reference.html fast/hidpi/filters-shadow.html * platform/graphics/cg/ImageBufferCG.cpp: (WebCore::ImageBuffer::getUnmultipliedImageData): Scale the source rectangle if the method was called using LogicalCoordinates. (WebCore::ImageBuffer::getPremultipliedImageData): Ditto. (WebCore::ImageBuffer::putByteArray): Ditto. * platform/graphics/filters/FEDropShadow.cpp: (WebCore::FEDropShadow::platformApplySoftware): Make sure to scale the blur radius by the filter resolution, and call the byte-array methods with the native coordinate system. * platform/graphics/filters/FEGaussianBlur.cpp: (WebCore::FEGaussianBlur::calculateUnscaledKernelSize): Fix typo. (WebCore::FEGaussianBlur::platformApplySoftware): Scale the kernel and paint rectangles by the filter scale. * platform/graphics/filters/Filter.h: (WebCore::Filter::Filter): Initialise the filter scale. (WebCore::Filter::filterScale): New property which reflects the mapping between logical pixels and device pixels. (WebCore::Filter::setFilterScale): * platform/graphics/filters/FilterEffect.cpp: (WebCore::FilterEffect::asImageBuffer): Make sure buffer creation takes scale into account. (WebCore::FilterEffect::asUnmultipliedImage): Ditto. (WebCore::FilterEffect::asPremultipliedImage): Ditto. (WebCore::FilterEffect::copyImageBytes): Scale any incoming regions if they are talking about device pixels rather than logical pixels. (WebCore::FilterEffect::copyUnmultipliedImage): Ditto. (WebCore::FilterEffect::copyPremultipliedImage): Ditto. (WebCore::FilterEffect::createImageBufferResult): Take scale into account when creating byte array. (WebCore::FilterEffect::createUnmultipliedImageResult): Ditto. (WebCore::FilterEffect::createPremultipliedImageResult): Ditto. * rendering/FilterEffectRenderer.cpp: (WebCore::FilterEffectRenderer::allocateBackingStoreIfNeeded): Pass filter scale into buffer creation. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateOrRemoveFilterEffectRenderer): Make sure to set the filter scale to the device scale factor, and notice if we ever change scales. LayoutTests: New tests for filters at high resolutions. The image used has a crosshatch at the pixel level, so any scale changes are visible (such as going from 2x to 1x). All the actual filters are no-ops so they can be compared to an element without a filter in the -expected version. * fast/hidpi/filters-blur-expected.html: Added. * fast/hidpi/filters-blur.html: Added. * fast/hidpi/filters-hue-rotate-expected.html: Added. * fast/hidpi/filters-hue-rotate.html: Added. * fast/hidpi/filters-invert-expected.html: Added. * fast/hidpi/filters-invert.html: Added. * fast/hidpi/filters-multiple-expected.html: Added. * fast/hidpi/filters-multiple.html: Added. * fast/hidpi/filters-reference-expected.html: Added. * fast/hidpi/filters-reference.html: Added. * fast/hidpi/filters-shadow-expected.html: Added. * fast/hidpi/filters-shadow.html: Added. * fast/hidpi/resources/color-grid.png: Added. * fast/hidpi/resources/ensure-hidpi.js: Added. (runTest): (scaleFactorIsSet): * platform/mac-wk2/TestExpectations: Skip some of these on WK2 Mac. See webkit.org/b/132766. Canonical link: https://commits.webkit.org/150822@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168577 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-10 09:30:02 +00:00
<script src="resources/ensure-hidpi.js"></script>
<style>
img {
width: 200px;
height: 200px;
}
p {
width: 200px;
height: 100px;
display: inline-block;
font: 20px/1 Ahem;
}
</style>
<div>This is testing HiDPI output from filters. The actual effects are no-ops.</div>
<img src="data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><rect fill='green' width='100%' height='100%'/></svg>">
<img src="data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><rect fill='green' width='100%' height='100%'/></svg>">
<div>
<p>Text</p>
<p>Text</p>
</div>