Diff
Modified: trunk/LayoutTests/ChangeLog (287910 => 287911)
--- trunk/LayoutTests/ChangeLog 2022-01-12 07:17:33 UTC (rev 287910)
+++ trunk/LayoutTests/ChangeLog 2022-01-12 07:49:25 UTC (rev 287911)
@@ -1,3 +1,13 @@
+2022-01-11 Said Abou-Hallawa <[email protected]>
+
+ [GPU Process] Make SVG resources create remote ImageBuffers for their drawing
+ https://bugs.webkit.org/show_bug.cgi?id=235073
+ rdar://87402419
+
+ Reviewed by Darin Adler.
+
+ * gpu-process/TestExpectations:
+
2022-01-11 Diego Pino Garcia <[email protected]>
[GLIB] Unreviewed test gardening, emit baseline for WPT test websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-getting.html
Modified: trunk/LayoutTests/gpu-process/TestExpectations (287910 => 287911)
--- trunk/LayoutTests/gpu-process/TestExpectations 2022-01-12 07:17:33 UTC (rev 287910)
+++ trunk/LayoutTests/gpu-process/TestExpectations 2022-01-12 07:49:25 UTC (rev 287911)
@@ -120,7 +120,6 @@
imported/blink/svg/as-image/svg-as-image-object-fit-contain.html
imported/blink/svg/as-image/svg-as-image-object-fit-cover.html
imported/blink/svg/as-image/svgview-references.html
-imported/blink/svg/custom/fill-fallback-currentcolor-1.svg
imported/blink/svg/text/obb-paintserver.html
imported/mozilla/svg/as-image/background-resize-3.html
imported/mozilla/svg/as-image/background-resize-4.html
@@ -128,25 +127,9 @@
imported/mozilla/svg/as-image/img-simple-3.html
imported/mozilla/svg/as-image/img-simple-5.html
imported/mozilla/svg/as-image/img-simple-7.html
-imported/mozilla/svg/blend-color-burn.svg
-imported/mozilla/svg/blend-saturation.svg
-imported/mozilla/svg/filters/feComposite-2.svg
-imported/mozilla/svg/filters/feFlood-1.svg
-imported/mozilla/svg/filters/feFlood-2.svg
-imported/mozilla/svg/filters/feImage-1.svg
imported/mozilla/svg/linearGradient-basic-03.svg
-imported/mozilla/svg/mask-basic-02.svg
-imported/mozilla/svg/mask-basic-03.svg
-imported/mozilla/svg/mask-type-01.svg
-imported/mozilla/svg/objectBoundingBox-and-mask.svg
-imported/mozilla/svg/opacity-and-gradient-02.svg
-imported/mozilla/svg/path-02.svg
-imported/mozilla/svg/svg-integration/clipPath-html-03.xhtml
+imported/mozilla/svg/pattern-transformed-01.svg
imported/mozilla/svg/text-gradient-01.svg
-imported/mozilla/svg/text/clipPath-content.svg
-imported/mozilla/svg/text/mask-applied.svg
-imported/mozilla/svg/text/mask-content-2.svg
-imported/mozilla/svg/text/mask-content.svg
imported/w3c/web-platform-tests/compat/webkit-background-origin-text.html
imported/w3c/web-platform-tests/compat/webkit-linear-gradient-line-bottom.html
imported/w3c/web-platform-tests/compat/webkit-linear-gradient-line-left.html
@@ -516,72 +499,14 @@
imported/w3c/web-platform-tests/svg/extensibility/foreignObject/masked.html
mathml/presentation/mroot-pref-width.html
media/track/track-css-visible-stroke.html
-svg/animations/animated-string-href.svg
svg/as-image/svg-as-image-with-relative-size.html
svg/as-image/svg-cached-draw-canvas.html
svg/as-image/svg-image-viewbox.html
+svg/as-image/svg-image-with-data-uri-use-data-uri.svg
svg/as-image/svg-no-intrinsic-size-switching.html
-svg/clip-path/clip-path-clip-nested-twice.svg
-svg/clip-path/clip-path-clip-rule-003.svg
-svg/clip-path/clip-path-clip-rule-004.svg
-svg/clip-path/clip-path-clip-rule-005.svg
-svg/clip-path/clip-path-clip-rule-006.svg
-svg/clip-path/clip-path-clip-rule-007.svg
-svg/clip-path/clip-path-clip-rule-008.svg
-svg/clip-path/clip-path-clip-rule-010.svg
-svg/clip-path/clip-path-clip.svg
-svg/clip-path/clip-path-content-clip-001.svg
-svg/clip-path/clip-path-content-clip-002.svg
-svg/clip-path/clip-path-content-clip-003.svg
-svg/clip-path/clip-path-content-syling.svg
-svg/clip-path/clip-path-content-use-002.svg
-svg/clip-path/clip-path-content-use-003.svg
-svg/clip-path/clip-path-content-use-005.svg
-svg/clip-path/clip-path-content-use-006.svg
-svg/clip-path/clip-path-css-transform-002.svg
-svg/clip-path/clip-path-css-transform-004.svg
-svg/clip-path/clip-path-no-content-003.svg
-svg/clip-path/clip-path-objectboundingbox-004.svg
-svg/clip-path/clip-path-on-overflowing.html
-svg/clip-path/clip-path-precision-001.svg
-svg/clip-path/clip-path-recursion-001.svg
-svg/clip-path/clip-path-recursion-002.svg
-svg/clip-path/clip-path-text-001.svg
-svg/clip-path/clip-path-text-002.svg
-svg/clip-path/clip-path-text-003.svg
-svg/clip-path/clip-path-text-004.svg
-svg/clip-path/clip-path-text-005.svg
-svg/clip-path/clip-path-userspaceonuse-001.svg
-svg/clip-path/mask-nested-clip-path-001.svg
-svg/clip-path/mask-nested-clip-path-002.svg
-svg/clip-path/mask-nested-clip-path-003.svg
-svg/clip-path/mask-nested-clip-path-004.svg
-svg/clip-path/mask-nested-clip-path-005.svg
-svg/clip-path/mask-nested-clip-path-006.svg
-svg/clip-path/mask-nested-clip-path-007.svg
-svg/clip-path/mask-nested-clip-path-008.svg
-svg/clip-path/mask-nested-clip-path-009.svg
-svg/clip-path/mask-nested-clip-path-010.svg
-svg/clip-path/mask-nested-clip-path-panning-001.svg
-svg/clip-path/mask-nested-clip-path-panning-002.svg
-svg/clip-path/opacity-assertion.svg
-svg/clip-path/svg-in-html.html
svg/clip-path/webkit-clip-path-after.svg
svg/clip-path/webkit-clip-path-before.svg
-svg/css/invalid-color-cascade.svg
-svg/custom/composited-svg-with-opacity.html
-svg/custom/hidpi-masking-clipping.svg
-svg/custom/href-svg-namespace-static.svg
-svg/custom/href-xlink-href-gradient-element.svg
-svg/custom/local-url-reference-fill.html
-svg/custom/local-url-reference-mask.html
-svg/custom/local-url-reference-radial-gradient.html
-svg/custom/local-url-reference-srcdoc.html
-svg/custom/local-url-reference-stroke.html
svg/custom/svg-fonts-skip-ink.html
-svg/dynamic-updates/SVGLinearGradientElement-svgdom-href-prop.html
-svg/dynamic-updates/SVGRadialGradientElement-svgdom-href-prop.html
-svg/filters/feImage-element-primitive-subregion.svg
svg/gradients/gradient-flipped-start-end-points.svg
svg/gradients/spreadMethod.svg
svg/gradients/spreadMethodAlpha.svg
@@ -593,12 +518,6 @@
svg/gradients/spreadMethodDuplicateStop.svg
svg/gradients/spreadMethodReversed.svg
svg/gradients/stopAlpha.svg
-svg/masking/mask-negative-scale.svg
-svg/masking/mask-transformed-text-missing.svg
-svg/masking/mask-type-alpha.svg
-svg/masking/mask-type-luminance.svg
-svg/masking/mask-type-not-set.svg
-svg/repaint/buffered-rendering-static-image.html
svg/transforms/transformed-text-fill-gradient.html
svg/transforms/transformed-text-fill-pattern.html
system-preview/badge.html
Modified: trunk/Source/WebCore/ChangeLog (287910 => 287911)
--- trunk/Source/WebCore/ChangeLog 2022-01-12 07:17:33 UTC (rev 287910)
+++ trunk/Source/WebCore/ChangeLog 2022-01-12 07:49:25 UTC (rev 287911)
@@ -1,3 +1,30 @@
+2022-01-11 Said Abou-Hallawa <[email protected]>
+
+ [GPU Process] Make SVG resources create remote ImageBuffers for their drawing
+ https://bugs.webkit.org/show_bug.cgi?id=235073
+ rdar://87402419
+
+ Reviewed by Darin Adler.
+
+ Pass a hostWindow when calling SVGRenderingContext::createImageBuffer().
+
+ * rendering/svg/RenderSVGResourceClipper.cpp:
+ (WebCore::RenderSVGResourceClipper::applyClippingToContext):
+ * rendering/svg/RenderSVGResourceGradient.cpp:
+ (WebCore::createMaskAndSwapContextForTextGradient):
+ (WebCore::clipToTextMask):
+ (WebCore::RenderSVGResourceGradient::applyResource):
+ (WebCore::RenderSVGResourceGradient::postApplyResource):
+ * rendering/svg/RenderSVGResourceMasker.cpp:
+ (WebCore::RenderSVGResourceMasker::applyResource):
+ * rendering/svg/RenderSVGResourcePattern.cpp:
+ (WebCore::RenderSVGResourcePattern::createTileImage const):
+ * rendering/svg/SVGRenderingContext.cpp:
+ (WebCore::SVGRenderingContext::createImageBuffer):
+ * rendering/svg/SVGRenderingContext.h:
+ * svg/SVGFEImageElement.cpp:
+ (WebCore::SVGFEImageElement::imageBufferForEffect const):
+
2021-11-29 Simon Fraser <[email protected]>
Serialize CSS <number> values with rounding, limited decimal precision, and no exponents per-spec
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp (287910 => 287911)
--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp 2022-01-12 07:17:33 UTC (rev 287910)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp 2022-01-12 07:49:25 UTC (rev 287911)
@@ -154,7 +154,7 @@
AffineTransform absoluteTransform = SVGRenderingContext::calculateTransformationToOutermostCoordinateSystem(renderer);
if (!clipperData.isValidForGeometry(objectBoundingBox, clippedContentBounds, absoluteTransform)) {
// FIXME (149469): This image buffer should not be unconditionally unaccelerated. Making it match the context breaks nested clipping, though.
- auto maskImage = SVGRenderingContext::createImageBuffer(clippedContentBounds, absoluteTransform, DestinationColorSpace::SRGB(), RenderingMode::Unaccelerated, nullptr);
+ auto maskImage = SVGRenderingContext::createImageBuffer(clippedContentBounds, absoluteTransform, DestinationColorSpace::SRGB(), RenderingMode::Unaccelerated, hostWindow());
if (!maskImage)
return false;
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp (287910 => 287911)
--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp 2022-01-12 07:17:33 UTC (rev 287910)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp 2022-01-12 07:49:25 UTC (rev 287911)
@@ -52,15 +52,15 @@
}
#if USE(CG)
-static inline bool createMaskAndSwapContextForTextGradient(GraphicsContext*& context, GraphicsContext*& savedContext, RefPtr<ImageBuffer>& imageBuffer, RenderObject* object)
+static inline bool createMaskAndSwapContextForTextGradient(GraphicsContext*& context, GraphicsContext*& savedContext, RefPtr<ImageBuffer>& imageBuffer, RenderElement& renderer)
{
- auto* textRootBlock = RenderSVGText::locateRenderSVGTextAncestor(*object);
+ auto* textRootBlock = RenderSVGText::locateRenderSVGTextAncestor(renderer);
ASSERT(textRootBlock);
AffineTransform absoluteTransform = SVGRenderingContext::calculateTransformationToOutermostCoordinateSystem(*textRootBlock);
FloatRect repaintRect = textRootBlock->repaintRectInLocalCoordinates();
- auto maskImage = SVGRenderingContext::createImageBuffer(repaintRect, absoluteTransform, DestinationColorSpace::SRGB(), context->renderingMode());
+ auto maskImage = SVGRenderingContext::createImageBuffer(repaintRect, absoluteTransform, DestinationColorSpace::SRGB(), context->renderingMode(), renderer.hostWindow());
if (!maskImage)
return false;
@@ -72,9 +72,9 @@
return true;
}
-static inline AffineTransform clipToTextMask(GraphicsContext& context, RefPtr<ImageBuffer>& imageBuffer, FloatRect& targetRect, RenderObject* object, bool boundingBoxMode, const AffineTransform& gradientTransform)
+static inline AffineTransform clipToTextMask(GraphicsContext& context, RefPtr<ImageBuffer>& imageBuffer, FloatRect& targetRect, RenderElement& renderer, bool boundingBoxMode, const AffineTransform& gradientTransform)
{
- auto* textRootBlock = RenderSVGText::locateRenderSVGTextAncestor(*object);
+ auto* textRootBlock = RenderSVGText::locateRenderSVGTextAncestor(renderer);
ASSERT(textRootBlock);
AffineTransform absoluteTransform = SVGRenderingContext::calculateTransformationToOutermostCoordinateSystem(*textRootBlock);
@@ -153,7 +153,7 @@
if (isPaintingText) {
#if USE(CG)
- if (!createMaskAndSwapContextForTextGradient(context, m_savedContext, m_imageBuffer, &renderer)) {
+ if (!createMaskAndSwapContextForTextGradient(context, m_savedContext, m_imageBuffer, renderer)) {
context->restore();
return false;
}
@@ -196,7 +196,7 @@
context = std::exchange(m_savedContext, nullptr);
FloatRect targetRect;
- AffineTransform userspaceTransform = clipToTextMask(*context, m_imageBuffer, targetRect, &renderer, gradientUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX, gradientTransform());
+ AffineTransform userspaceTransform = clipToTextMask(*context, m_imageBuffer, targetRect, renderer, gradientUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX, gradientTransform());
context->setFillGradient(gradient, userspaceTransform);
context->fillRect(targetRect);
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp (287910 => 287911)
--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp 2022-01-12 07:17:33 UTC (rev 287910)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp 2022-01-12 07:49:25 UTC (rev 287911)
@@ -84,7 +84,7 @@
#endif
// FIXME (149470): This image buffer should not be unconditionally unaccelerated. Making it match the context breaks alpha masking, though.
- maskerData->maskImage = SVGRenderingContext::createImageBuffer(repaintRect, absoluteTransform, maskColorSpace, RenderingMode::Unaccelerated, nullptr);
+ maskerData->maskImage = SVGRenderingContext::createImageBuffer(repaintRect, absoluteTransform, maskColorSpace, RenderingMode::Unaccelerated, hostWindow());
if (!maskerData->maskImage)
return false;
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp (287910 => 287911)
--- trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp 2022-01-12 07:17:33 UTC (rev 287910)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp 2022-01-12 07:49:25 UTC (rev 287911)
@@ -241,7 +241,7 @@
RefPtr<ImageBuffer> RenderSVGResourcePattern::createTileImage(const PatternAttributes& attributes, const FloatRect& tileBoundaries, const FloatRect& absoluteTileBoundaries, const AffineTransform& tileImageTransform, FloatRect& clampedAbsoluteTileBoundaries, RenderingMode renderingMode) const
{
clampedAbsoluteTileBoundaries = ImageBuffer::clampedRect(absoluteTileBoundaries);
- auto tileImage = SVGRenderingContext::createImageBuffer(absoluteTileBoundaries, clampedAbsoluteTileBoundaries, DestinationColorSpace::SRGB(), renderingMode);
+ auto tileImage = SVGRenderingContext::createImageBuffer(absoluteTileBoundaries, clampedAbsoluteTileBoundaries, DestinationColorSpace::SRGB(), renderingMode, hostWindow());
if (!tileImage)
return nullptr;
Modified: trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp (287910 => 287911)
--- trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp 2022-01-12 07:17:33 UTC (rev 287910)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp 2022-01-12 07:49:25 UTC (rev 287911)
@@ -6,6 +6,7 @@
* Copyright (C) 2009 Dirk Schulze <[email protected]>
* Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
* Copyright (C) 2018 Adobe Systems Incorporated. All rights reserved.
+ * Copyright (C) 2022 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -251,7 +252,7 @@
return imageBuffer;
}
-RefPtr<ImageBuffer> SVGRenderingContext::createImageBuffer(const FloatRect& targetRect, const FloatRect& clampedRect, const DestinationColorSpace& colorSpace, RenderingMode renderingMode)
+RefPtr<ImageBuffer> SVGRenderingContext::createImageBuffer(const FloatRect& targetRect, const FloatRect& clampedRect, const DestinationColorSpace& colorSpace, RenderingMode renderingMode, const HostWindow* hostWindow)
{
IntSize clampedSize = roundedIntSize(clampedRect.size());
FloatSize unclampedSize = roundedIntSize(targetRect.size());
@@ -260,7 +261,7 @@
if (clampedSize.isEmpty())
return nullptr;
- auto imageBuffer = ImageBuffer::create(clampedSize, renderingMode, 1, colorSpace, PixelFormat::BGRA8);
+ auto imageBuffer = ImageBuffer::create(clampedSize, renderingMode, ShouldUseDisplayList::No, RenderingPurpose::DOM, 1, colorSpace, PixelFormat::BGRA8, hostWindow);
if (!imageBuffer)
return nullptr;
Modified: trunk/Source/WebCore/rendering/svg/SVGRenderingContext.h (287910 => 287911)
--- trunk/Source/WebCore/rendering/svg/SVGRenderingContext.h 2022-01-12 07:17:33 UTC (rev 287910)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderingContext.h 2022-01-12 07:49:25 UTC (rev 287911)
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (C) 2007 Rob Buis <[email protected]>
* Copyright (C) 2007 Nikolas Zimmermann <[email protected]>
* Copyright (C) 2007 Eric Seidel <[email protected]>
@@ -5,6 +5,7 @@
* Copyright (C) 2009 Google, Inc. All rights reserved.
* Copyright (C) Research In Motion Limited 2010. All rights reserved.
* Copyright (C) 2012 Zoltan Herczeg <[email protected]>.
+ * Copyright (C) 2022 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -35,7 +36,6 @@
class RenderObject;
class RenderSVGResourceFilter;
-// SVGRenderingContext
class SVGRenderingContext {
public:
enum NeedsGraphicsContextSave {
@@ -61,7 +61,7 @@
bool isRenderingPrepared() const { return m_renderingFlags & RenderingPrepared; }
static RefPtr<ImageBuffer> createImageBuffer(const FloatRect& targetRect, const AffineTransform& absoluteTransform, const DestinationColorSpace&, RenderingMode, const HostWindow* = nullptr);
- static RefPtr<ImageBuffer> createImageBuffer(const FloatRect& targetRect, const FloatRect& clampedRect, const DestinationColorSpace&, RenderingMode);
+ static RefPtr<ImageBuffer> createImageBuffer(const FloatRect& targetRect, const FloatRect& clampedRect, const DestinationColorSpace&, RenderingMode, const HostWindow* = nullptr);
static void renderSubtreeToContext(GraphicsContext&, RenderElement&, const AffineTransform&);
static void clipToImageBuffer(GraphicsContext&, const AffineTransform& absoluteTransform, const FloatRect& targetRect, RefPtr<ImageBuffer>&, bool safeToClear);
Modified: trunk/Source/WebCore/svg/SVGFEImageElement.cpp (287910 => 287911)
--- trunk/Source/WebCore/svg/SVGFEImageElement.cpp 2022-01-12 07:17:33 UTC (rev 287910)
+++ trunk/Source/WebCore/svg/SVGFEImageElement.cpp 2022-01-12 07:49:25 UTC (rev 287911)
@@ -198,7 +198,7 @@
auto imageRect = renderer->repaintRectInLocalCoordinates();
- auto imageBuffer = SVGRenderingContext::createImageBuffer(imageRect, shearFreeAbsoluteTransform, DestinationColorSpace::SRGB(), RenderingMode::Unaccelerated);
+ auto imageBuffer = SVGRenderingContext::createImageBuffer(imageRect, shearFreeAbsoluteTransform, DestinationColorSpace::SRGB(), RenderingMode::Unaccelerated, renderer->hostWindow());
if (!imageBuffer)
return { };
Modified: trunk/Source/WebKit/ChangeLog (287910 => 287911)
--- trunk/Source/WebKit/ChangeLog 2022-01-12 07:17:33 UTC (rev 287910)
+++ trunk/Source/WebKit/ChangeLog 2022-01-12 07:49:25 UTC (rev 287911)
@@ -1,3 +1,18 @@
+2022-01-11 Said Abou-Hallawa <[email protected]>
+
+ [GPU Process] Make SVG resources create remote ImageBuffers for their drawing
+ https://bugs.webkit.org/show_bug.cgi?id=235073
+ rdar://87402419
+
+ Reviewed by Darin Adler.
+
+ * GPUProcess/graphics/QualifiedResourceHeap.h:
+ (WebKit::QualifiedResourceHeap::get const):
+ Do not assert here if the entry of the HashMap does not hold a variant
+ of the required type. We already return nullptr without assertion if there
+ is no entry for the required renderingResourceIdentifier. We should let
+ the caller decides what to do in the case of error.
+
2022-01-11 Geoffrey Garen <[email protected]>
WebPageProxy destruction should not launch a network process
Modified: trunk/Source/WebKit/GPUProcess/graphics/QualifiedResourceHeap.h (287910 => 287911)
--- trunk/Source/WebKit/GPUProcess/graphics/QualifiedResourceHeap.h 2022-01-12 07:17:33 UTC (rev 287910)
+++ trunk/Source/WebKit/GPUProcess/graphics/QualifiedResourceHeap.h 2022-01-12 07:49:25 UTC (rev 287911)
@@ -159,8 +159,8 @@
auto iterator = m_resources.find(renderingResourceIdentifier);
if (iterator == m_resources.end())
return nullptr;
- ASSERT(std::holds_alternative<Ref<T>>(iterator->value));
- return std::get<Ref<T>>(iterator->value).ptr();
+ auto value = std::get_if<Ref<T>>(&iterator->value);
+ return value ? value->ptr() : nullptr;
}
template <typename T>