WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-221637-20210209185645.patch (text/plain), 43.92 KB, created by
Said Abou-Hallawa
on 2021-02-09 18:56:46 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Said Abou-Hallawa
Created:
2021-02-09 18:56:46 PST
Size:
43.92 KB
patch
obsolete
>Subversion Revision: 272549 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 27f690c4f3f6e026d47fc9077f78c4820de6c978..466bfea1722c4f969a3e7cd450a01d446778a717 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,100 @@ >+2021-02-09 Said Abou-Hallawa <said@apple.com> >+ >+ Make Pattern hold a NativeImage instead of an Image >+ https://bugs.webkit.org/show_bug.cgi?id=221637 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This will make caching the Pattern data in the GPUP straightforward since >+ all we need is to cache the NativeImage and encode the pattern data. >+ >+ * html/canvas/CanvasPattern.cpp: >+ (WebCore::CanvasPattern::create): >+ (WebCore::CanvasPattern::CanvasPattern): >+ * html/canvas/CanvasPattern.h: >+ * html/canvas/CanvasRenderingContext2DBase.cpp: >+ (WebCore::CanvasRenderingContext2DBase::createPattern): >+ * inspector/InspectorCanvas.cpp: >+ (WebCore::InspectorCanvas::buildArrayForCanvasPattern): >+ Extract a NativeImage of an Image. The platform Patterns deal with >+ NativeImages only. >+ >+ * platform/graphics/Image.h: >+ Remove ImageHandle. >+ >+ * platform/graphics/Pattern.cpp: >+ (WebCore::Pattern::create): >+ (WebCore::Pattern::Pattern): >+ (WebCore::Pattern::setPatternSpaceTransform): >+ * platform/graphics/Pattern.h: >+ (WebCore::Pattern::encode const): Deleted. >+ (WebCore::Pattern::decode): Deleted. >+ Make the new struct 'Parameters' holds all the members other than the >+ NativeImage. This struct + RenderingResourceIdentifer of the NativeImage >+ will be recorded for the strokePattern and the fillPattern. >+ >+ * platform/graphics/cairo/CairoOperations.cpp: >+ (WebCore::Cairo::FillSource::FillSource): >+ * platform/graphics/cairo/PatternCairo.cpp: >+ (WebCore::Pattern::createPlatformPattern const): >+ * platform/graphics/cg/PatternCG.cpp: >+ (WebCore::Pattern::createPlatformPattern const): >+ The platform Pattern deals only with NativeImages. >+ >+ * platform/graphics/displaylists/DisplayList.cpp: >+ (WebCore::DisplayList::DisplayList::shouldDumpForFlags): >+ SetState::state() is renamed to SetStateItem::stateChange() since it >+ returns GraphicsContextStateChange. >+ >+ * platform/graphics/displaylists/DisplayListItemBuffer.cpp: >+ (WebCore::DisplayList::ItemHandle::apply): >+ SetState::apply() has to be a special case. >+ >+ * platform/graphics/displaylists/DisplayListItems.cpp: >+ (WebCore::DisplayList::SetState::SetState): >+ (WebCore::DisplayList::SetState::apply): >+ (WebCore::DisplayList::operator<<): >+ (WebCore::DisplayList::SetState::apply const): Deleted. >+ Add a new constructor for SetState to be used by the decoder. All the >+ members of GraphicsContextStateChange will be copied but strokePattern >+ and fillPattern will be created only when their NativeImages are resolved >+ in the SetState::apply(). >+ >+ * platform/graphics/displaylists/DisplayListItems.h: >+ (WebCore::DisplayList::SetState::stateChange const): >+ (WebCore::DisplayList::SetState::strokePatternParameters const): >+ (WebCore::DisplayList::SetState::fillPatternParameters const): >+ (WebCore::DisplayList::SetState::strokePatternImageIdentifier const): >+ (WebCore::DisplayList::SetState::fillPatternImageIdentifier const): >+ (WebCore::DisplayList::SetState::encode const): >+ (WebCore::DisplayList::SetState::decode): >+ (WebCore::DisplayList::SetState::state const): Deleted. >+ Specialize the encode and the decoding of strokePattern and fillPattern >+ by using the Pattern::Parameters and the RenderingResourceIdentifer of >+ the NativeImage. >+ >+ * platform/graphics/displaylists/DisplayListRecorder.cpp: >+ (WebCore::DisplayList::Recorder::cacheNativeImage): >+ (WebCore::DisplayList::Recorder::appendStateChangeItem): >+ (WebCore::DisplayList::Recorder::drawNativeImage): >+ (WebCore::DisplayList::Recorder::drawPattern): >+ * platform/graphics/displaylists/DisplayListRecorder.h: >+ Cache the NativeImages of strokePattern and fillPattern. >+ >+ * platform/graphics/displaylists/DisplayListReplayer.cpp: >+ (WebCore::DisplayList::applySetStateItem): >+ (WebCore::DisplayList::Replayer::applyItem): >+ Resolve the NativeImages of strokePattern and fillPattern from the cached >+ NativeImages. >+ >+ * platform/graphics/filters/FETile.cpp: >+ (WebCore::FETile::platformApplySoftware): >+ * rendering/RenderLayerBacking.cpp: >+ (WebCore::patternForDescription): >+ * rendering/svg/RenderSVGResourcePattern.cpp: >+ (WebCore::RenderSVGResourcePattern::buildPattern): >+ Patterns should be created with NativeImages. >+ > 2021-02-08 Said Abou-Hallawa <said@apple.com> > > A Pattern with an SVG image is not rendered correctly >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index c799cf01b014a68ad18fc2b4a54fd6f63031fd24..30be160bc8ce3e33d4fb5f8d4de6b194e6b76d85 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,16 @@ >+2021-02-09 Said Abou-Hallawa <said@apple.com> >+ >+ Make Pattern hold a NativeImage instead of an Image >+ https://bugs.webkit.org/show_bug.cgi?id=221637 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Shared/WebCoreArgumentCoders.cpp: >+ (IPC::ArgumentCoder<ImageHandle>::encode): Deleted. >+ (IPC::ArgumentCoder<ImageHandle>::decode): Deleted. >+ * Shared/WebCoreArgumentCoders.h: >+ Delete the encoding and decoding of Image since it is not used anymore >+ > 2021-02-08 Chris Dumez <cdumez@apple.com> > > Prevent WebProcess to re-enter on sync IPC to the GPUProcess >diff --git a/Source/WebCore/html/canvas/CanvasPattern.cpp b/Source/WebCore/html/canvas/CanvasPattern.cpp >index 72ea1a87c6d0e26018757ee2f7bc60463c9aa805..0aa1f121bf685767484a5d6b2e27935bd8616683 100644 >--- a/Source/WebCore/html/canvas/CanvasPattern.cpp >+++ b/Source/WebCore/html/canvas/CanvasPattern.cpp >@@ -28,19 +28,19 @@ > > #include "DOMMatrix2DInit.h" > #include "DOMMatrixReadOnly.h" >-#include "Image.h" >+#include "NativeImage.h" > #include "Pattern.h" > #include <wtf/text/WTFString.h> > > namespace WebCore { > >-Ref<CanvasPattern> CanvasPattern::create(Ref<Image>&& image, bool repeatX, bool repeatY, bool originClean) >+Ref<CanvasPattern> CanvasPattern::create(Ref<NativeImage>&& image, bool repeatX, bool repeatY, bool originClean) > { > return adoptRef(*new CanvasPattern(WTFMove(image), repeatX, repeatY, originClean)); > } > >-CanvasPattern::CanvasPattern(Ref<Image>&& image, bool repeatX, bool repeatY, bool originClean) >- : m_pattern(Pattern::create(WTFMove(image), repeatX, repeatY)) >+CanvasPattern::CanvasPattern(Ref<NativeImage>&& image, bool repeatX, bool repeatY, bool originClean) >+ : m_pattern(Pattern::create(WTFMove(image), { repeatX, repeatY })) > , m_originClean(originClean) > { > } >diff --git a/Source/WebCore/html/canvas/CanvasPattern.h b/Source/WebCore/html/canvas/CanvasPattern.h >index c8a9e3ce161bbb8f9a1d75be29fdceb821cc9931..e46d21bc5135d9a74f4575c9dd65e9cecdcb8d2a 100644 >--- a/Source/WebCore/html/canvas/CanvasPattern.h >+++ b/Source/WebCore/html/canvas/CanvasPattern.h >@@ -32,13 +32,13 @@ > > namespace WebCore { > >-class Image; >+class NativeImage; > class Pattern; > struct DOMMatrix2DInit; > > class CanvasPattern : public RefCounted<CanvasPattern> { > public: >- static Ref<CanvasPattern> create(Ref<Image>&&, bool repeatX, bool repeatY, bool originClean); >+ static Ref<CanvasPattern> create(Ref<NativeImage>&&, bool repeatX, bool repeatY, bool originClean); > ~CanvasPattern(); > > static bool parseRepetitionType(const String&, bool& repeatX, bool& repeatY); >@@ -51,7 +51,7 @@ public: > ExceptionOr<void> setTransform(DOMMatrix2DInit&&); > > private: >- CanvasPattern(Ref<Image>&&, bool repeatX, bool repeatY, bool originClean); >+ CanvasPattern(Ref<NativeImage>&&, bool repeatX, bool repeatY, bool originClean); > > Ref<Pattern> m_pattern; > bool m_originClean; >diff --git a/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp b/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp >index 8830c5ddaeda47f2282e04d81724341f04e89c3d..9ff22a7c3d5decce6a64baaa6acbec116b102c0b 100644 >--- a/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp >+++ b/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp >@@ -1937,7 +1937,15 @@ ExceptionOr<RefPtr<CanvasPattern>> CanvasRenderingContext2DBase::createPattern(H > if (cachedImage->image()->isSVGImage()) > originClean = false; > >- return RefPtr<CanvasPattern> { CanvasPattern::create(*cachedImage->imageForRenderer(imageElement.renderer()), repeatX, repeatY, originClean) }; >+ auto* image = cachedImage->imageForRenderer(imageElement.renderer()); >+ if (!image) >+ return Exception { InvalidStateError }; >+ >+ auto nativeImage = image->nativeImage(); >+ if (!nativeImage) >+ return Exception { InvalidStateError }; >+ >+ return RefPtr<CanvasPattern> { CanvasPattern::create(nativeImage.releaseNonNull(), repeatX, repeatY, originClean) }; > } > > ExceptionOr<RefPtr<CanvasPattern>> CanvasRenderingContext2DBase::createPattern(CanvasBase& canvas, bool repeatX, bool repeatY) >@@ -1948,8 +1956,12 @@ ExceptionOr<RefPtr<CanvasPattern>> CanvasRenderingContext2DBase::createPattern(C > > if (!copiedImage) > return Exception { InvalidStateError }; >+ >+ auto nativeImage = copiedImage->nativeImage(); >+ if (!nativeImage) >+ return Exception { InvalidStateError }; > >- return RefPtr<CanvasPattern> { CanvasPattern::create(*copiedImage, repeatX, repeatY, canvas.originClean()) }; >+ return RefPtr<CanvasPattern> { CanvasPattern::create(nativeImage.releaseNonNull(), repeatX, repeatY, canvas.originClean()) }; > } > > #if ENABLE(VIDEO) >@@ -1964,7 +1976,7 @@ ExceptionOr<RefPtr<CanvasPattern>> CanvasRenderingContext2DBase::createPattern(H > > #if USE(CG) > if (auto nativeImage = videoElement.nativeImageForCurrentTime()) >- return RefPtr<CanvasPattern> { CanvasPattern::create(BitmapImage::create(WTFMove(nativeImage)), repeatX, repeatY, originClean) }; >+ return RefPtr<CanvasPattern> { CanvasPattern::create(nativeImage.releaseNonNull(), repeatX, repeatY, originClean) }; > #endif > > auto renderingMode = !drawingContext() || drawingContext()->isAcceleratedContext() ? RenderingMode::Accelerated : RenderingMode::Unaccelerated; >@@ -1974,7 +1986,7 @@ ExceptionOr<RefPtr<CanvasPattern>> CanvasRenderingContext2DBase::createPattern(H > > videoElement.paintCurrentFrameInContext(imageBuffer->context(), FloatRect(FloatPoint(), size(videoElement))); > >- return RefPtr<CanvasPattern> { CanvasPattern::create(ImageBuffer::sinkIntoImage(WTFMove(imageBuffer), PreserveResolution::Yes).releaseNonNull(), repeatX, repeatY, originClean) }; >+ return RefPtr<CanvasPattern> { CanvasPattern::create(ImageBuffer::sinkIntoNativeImage(WTFMove(imageBuffer)).releaseNonNull(), repeatX, repeatY, originClean) }; > } > > #endif >diff --git a/Source/WebCore/inspector/InspectorCanvas.cpp b/Source/WebCore/inspector/InspectorCanvas.cpp >index 0c85f8a83767966ba26b5c333ed60c01a50aa116..e5f2210ae98733e984ab584f6f9a3c847b5a8049 100644 >--- a/Source/WebCore/inspector/InspectorCanvas.cpp >+++ b/Source/WebCore/inspector/InspectorCanvas.cpp >@@ -1202,9 +1202,10 @@ Ref<JSON::ArrayOf<JSON::Value>> InspectorCanvas::buildArrayForCanvasGradient(con > > Ref<JSON::ArrayOf<JSON::Value>> InspectorCanvas::buildArrayForCanvasPattern(const CanvasPattern& canvasPattern) > { >- Image& tileImage = canvasPattern.pattern().tileImage(); >+ auto& tileImage = canvasPattern.pattern().tileImage(); >+ FloatRect rect = { { }, tileImage.size() }; > auto imageBuffer = ImageBuffer::create(tileImage.size(), RenderingMode::Unaccelerated); >- imageBuffer->context().drawImage(tileImage, FloatPoint(0, 0)); >+ imageBuffer->context().drawNativeImage(tileImage, tileImage.size(), rect, rect); > > String repeat; > bool repeatX = canvasPattern.pattern().repeatX(); >diff --git a/Source/WebCore/platform/graphics/Image.h b/Source/WebCore/platform/graphics/Image.h >index 436b37d6c8ec6f00f4feb4dd36f4a2923c7f96ea..da010f3fdcd06805628b860cae32bd9be9a45480 100644 >--- a/Source/WebCore/platform/graphics/Image.h >+++ b/Source/WebCore/platform/graphics/Image.h >@@ -210,11 +210,6 @@ private: > std::unique_ptr<Timer> m_animationStartTimer; > }; > >-class ImageHandle { >-public: >- RefPtr<Image> image; >-}; >- > WTF::TextStream& operator<<(WTF::TextStream&, const Image&); > > } // namespace WebCore >diff --git a/Source/WebCore/platform/graphics/Pattern.cpp b/Source/WebCore/platform/graphics/Pattern.cpp >index 796a07c186b62ff4e6b6ea26107ff9fc4c438e71..635323769f8033de328e8d44e57975a1d3cd6065 100644 >--- a/Source/WebCore/platform/graphics/Pattern.cpp >+++ b/Source/WebCore/platform/graphics/Pattern.cpp >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. >+ * Copyright (C) 2006-2021 Apple Inc. All rights reserved. > * Copyright (C) 2008 Eric Seidel <eric@webkit.org> > * > * Redistribution and use in source and binary forms, with or without >@@ -31,23 +31,22 @@ > > namespace WebCore { > >-Ref<Pattern> Pattern::create(Ref<Image>&& tileImage, bool repeatX, bool repeatY) >+Ref<Pattern> Pattern::create(Ref<NativeImage>&& tileImage, const Parameters& parameters) > { >- return adoptRef(*new Pattern(WTFMove(tileImage), repeatX, repeatY)); >+ return adoptRef(*new Pattern(WTFMove(tileImage), parameters)); > } > >-Pattern::Pattern(Ref<Image>&& image, bool repeatX, bool repeatY) >+Pattern::Pattern(Ref<NativeImage>&& image, const Parameters& parameters) > : m_tileImage(WTFMove(image)) >- , m_repeatX(repeatX) >- , m_repeatY(repeatY) >+ , m_parameters(parameters) > { > } > > Pattern::~Pattern() = default; > >-void Pattern::setPatternSpaceTransform(const AffineTransform& patternSpaceTransformation) >+void Pattern::setPatternSpaceTransform(const AffineTransform& patternSpaceTransform) > { >- m_patternSpaceTransformation = patternSpaceTransformation; >+ m_parameters.patternSpaceTransform = patternSpaceTransform; > } > > } >diff --git a/Source/WebCore/platform/graphics/Pattern.h b/Source/WebCore/platform/graphics/Pattern.h >index 2a563da2617d1b04248b90ab0639db2caf9a88c0..6abcbdd15951d8ff697a68aaa0effb6e9f58f616 100644 >--- a/Source/WebCore/platform/graphics/Pattern.h >+++ b/Source/WebCore/platform/graphics/Pattern.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. >+ * Copyright (C) 2006-2021 Apple Inc. All rights reserved. > * Copyright (C) 2008 Eric Seidel <eric@webkit.org> > * Copyright (C) 2007-2008 Torch Mobile, Inc. > * >@@ -53,76 +53,43 @@ namespace WebCore { > class AffineTransform; > class GraphicsContext; > class Image; >-class ImageHandle; > > class Pattern final : public RefCounted<Pattern> { > public: >- WEBCORE_EXPORT static Ref<Pattern> create(Ref<Image>&& tileImage, bool repeatX, bool repeatY); >+ struct Parameters { >+ Parameters(bool repeatX = true, bool repeatY = true, AffineTransform patternSpaceTransform = { }) >+ : repeatX(repeatX) >+ , repeatY(repeatY) >+ , patternSpaceTransform(patternSpaceTransform) >+ { >+ } >+ bool repeatX; >+ bool repeatY; >+ AffineTransform patternSpaceTransform; >+ }; >+ >+ WEBCORE_EXPORT static Ref<Pattern> create(Ref<NativeImage>&& tileImage, const Parameters& = { }); > WEBCORE_EXPORT ~Pattern(); > >- Image& tileImage() const { return m_tileImage.get(); } >+ NativeImage& tileImage() const { return m_tileImage.get(); } >+ const Parameters& parameters() const { return m_parameters; } > >- // Pattern space is an abstract space that maps to the default user space by the transformation 'userSpaceTransformation' >+ // Pattern space is an abstract space that maps to the default user space by the transformation 'userSpaceTransform' > #if !USE(DIRECT2D) >- PlatformPatternPtr createPlatformPattern(const AffineTransform& userSpaceTransformation) const; >+ PlatformPatternPtr createPlatformPattern(const AffineTransform& userSpaceTransform) const; > #else >- PlatformPatternPtr createPlatformPattern(const GraphicsContext&, float alpha, const AffineTransform& userSpaceTransformation) const; >+ PlatformPatternPtr createPlatformPattern(const GraphicsContext&, float alpha, const AffineTransform& userSpaceTransform) const; > #endif >- WEBCORE_EXPORT void setPatternSpaceTransform(const AffineTransform& patternSpaceTransformation); >- const AffineTransform& patternSpaceTransform() const { return m_patternSpaceTransformation; }; >- bool repeatX() const { return m_repeatX; } >- bool repeatY() const { return m_repeatY; } >- >- template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static Optional<Ref<Pattern>> decode(Decoder&); >+ void setPatternSpaceTransform(const AffineTransform&); >+ const AffineTransform& patternSpaceTransform() const { return m_parameters.patternSpaceTransform; }; >+ bool repeatX() const { return m_parameters.repeatX; } >+ bool repeatY() const { return m_parameters.repeatY; } > > private: >- Pattern(Ref<Image>&&, bool repeatX, bool repeatY); >+ Pattern(Ref<NativeImage>&&, const Parameters&); > >- Ref<Image> m_tileImage; >- AffineTransform m_patternSpaceTransformation; >- bool m_repeatX; >- bool m_repeatY; >+ Ref<NativeImage> m_tileImage; >+ Parameters m_parameters; > }; > >-template<class Encoder> >-void Pattern::encode(Encoder& encoder) const >-{ >- ImageHandle imageHandle; >- imageHandle.image = m_tileImage.ptr(); >- encoder << imageHandle; >- encoder << m_patternSpaceTransformation; >- encoder << m_repeatX; >- encoder << m_repeatY; >-} >- >-template<class Decoder> >-Optional<Ref<Pattern>> Pattern::decode(Decoder& decoder) >-{ >- Optional<ImageHandle> imageHandle; >- decoder >> imageHandle; >- if (!imageHandle) >- return WTF::nullopt; >- >- Optional<AffineTransform> patternSpaceTransformation; >- decoder >> patternSpaceTransformation; >- if (!patternSpaceTransformation) >- return WTF::nullopt; >- >- Optional<bool> repeatX; >- decoder >> repeatX; >- if (!repeatX) >- return WTF::nullopt; >- >- Optional<bool> repeatY; >- decoder >> repeatY; >- if (!repeatY) >- return WTF::nullopt; >- >- auto pattern = Pattern::create(imageHandle->image.releaseNonNull(), *repeatX, *repeatY); >- pattern->setPatternSpaceTransform(*patternSpaceTransformation); >- return pattern; >-} >- > } //namespace >- >diff --git a/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp b/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp >index 7320da1cbfe9285fd126f00241438c4dba39ecc9..7fae777c3966b4c486de2232b19113231fd92df0 100644 >--- a/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp >+++ b/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp >@@ -567,7 +567,7 @@ FillSource::FillSource(const GraphicsContextState& state) > pattern.object = adoptRef(state.fillPattern->createPlatformPattern(AffineTransform())); > > auto& patternImage = state.fillPattern->tileImage(); >- pattern.size = FloatSize(patternImage.width(), patternImage.height()); >+ pattern.size = patternImage.size(); > pattern.transform = state.fillPattern->patternSpaceTransform(); > pattern.repeatX = state.fillPattern->repeatX(); > pattern.repeatY = state.fillPattern->repeatY(); >diff --git a/Source/WebCore/platform/graphics/cairo/PatternCairo.cpp b/Source/WebCore/platform/graphics/cairo/PatternCairo.cpp >index 560f747a8fb6481be4a301858500aa9fa160f786..68dabaf98aca9d1cfb71e16522b9deb25807ff1f 100644 >--- a/Source/WebCore/platform/graphics/cairo/PatternCairo.cpp >+++ b/Source/WebCore/platform/graphics/cairo/PatternCairo.cpp >@@ -35,18 +35,18 @@ namespace WebCore { > > cairo_pattern_t* Pattern::createPlatformPattern(const AffineTransform&) const > { >- auto nativeImage = tileImage().nativeImageForCurrentFrame(); >- if (!nativeImage) >+ auto platformImage = tileImage().platformImage(); >+ if (!platformImage) > return nullptr; > >- cairo_pattern_t* pattern = cairo_pattern_create_for_surface(nativeImage->platformImage().get()); >+ cairo_pattern_t* pattern = cairo_pattern_create_for_surface(platformImage.get()); > > // cairo merges patter space and user space itself >- cairo_matrix_t matrix = toCairoMatrix(m_patternSpaceTransformation); >+ cairo_matrix_t matrix = toCairoMatrix(patternSpaceTransform()); > cairo_matrix_invert(&matrix); > cairo_pattern_set_matrix(pattern, &matrix); > >- if (m_repeatX || m_repeatY) >+ if (repeatX() || repeatY()) > cairo_pattern_set_extend(pattern, CAIRO_EXTEND_REPEAT); > return pattern; > } >diff --git a/Source/WebCore/platform/graphics/cg/PatternCG.cpp b/Source/WebCore/platform/graphics/cg/PatternCG.cpp >index 6954c566570ad7ae6c1e760f0787d3770acaa694..f1b9e3a7c05569a9891b698d283ab5397c725f54 100644 >--- a/Source/WebCore/platform/graphics/cg/PatternCG.cpp >+++ b/Source/WebCore/platform/graphics/cg/PatternCG.cpp >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2006-2017 Apple Inc. All rights reserved. >+ * Copyright (C) 2006-2021 Apple Inc. All rights reserved. > * Copyright (C) 2008 Eric Seidel <eric@webkit.org> > * > * Redistribution and use in source and binary forms, with or without >@@ -55,24 +55,21 @@ static void patternReleaseCallback(void* info) > }); > } > >-CGPatternRef Pattern::createPlatformPattern(const AffineTransform& userSpaceTransformation) const >+CGPatternRef Pattern::createPlatformPattern(const AffineTransform& userSpaceTransform) const > { >- FloatRect tileRect = tileImage().rect(); >+ FloatRect tileRect = { { }, tileImage().size() }; > >- AffineTransform patternTransform = userSpaceTransformation * m_patternSpaceTransformation; >+ AffineTransform patternTransform = userSpaceTransform * patternSpaceTransform(); > patternTransform.scaleNonUniform(1, -1); > patternTransform.translate(0, -tileRect.height()); > >- PlatformImagePtr platformImage; >- if (auto nativeImage = tileImage().nativeImage()) >- platformImage = nativeImage->platformImage(); >- >+ PlatformImagePtr platformImage = tileImage().platformImage(); > if (!platformImage) > return nullptr; > > // If we're repeating in both directions, we can use image-backed patterns > // instead of custom patterns, and avoid tiling-edge pixel cracks. >- if (m_repeatX && m_repeatY) >+ if (repeatX() && repeatY()) > return CGPatternCreateWithImage2(platformImage.get(), patternTransform, kCGPatternTilingConstantSpacing); > > // If FLT_MAX should also be used for xStep or yStep, nothing is rendered. Using fractions of FLT_MAX also >@@ -80,8 +77,8 @@ CGPatternRef Pattern::createPlatformPattern(const AffineTransform& userSpaceTran > // INT_MAX is almost correct, but there seems to be some number wrapping occurring making the fill > // pattern is not filled correctly. > // To make error of floating point less than 0.5, we use the half of the number of mantissa of float (1 << 22). >- CGFloat xStep = m_repeatX ? tileRect.width() : (1 << 22); >- CGFloat yStep = m_repeatY ? tileRect.height() : (1 << 22); >+ CGFloat xStep = repeatX() ? tileRect.width() : (1 << 22); >+ CGFloat yStep = repeatY() ? tileRect.height() : (1 << 22); > > // The pattern will release the CGImageRef when it's done rendering in patternReleaseCallback > CGImageRef image = platformImage.leakRef(); >diff --git a/Source/WebCore/platform/graphics/displaylists/DisplayList.cpp b/Source/WebCore/platform/graphics/displaylists/DisplayList.cpp >index d153dfa45c21ad873e4d484671f3d04acb74854b..e079f730be859ac3b05b9429c30e8361d143aeb4 100644 >--- a/Source/WebCore/platform/graphics/displaylists/DisplayList.cpp >+++ b/Source/WebCore/platform/graphics/displaylists/DisplayList.cpp >@@ -91,10 +91,10 @@ bool DisplayList::shouldDumpForFlags(AsTextFlags flags, ItemHandle item) > if (!(flags & AsTextFlag::IncludesPlatformOperations)) { > const auto& stateItem = item.get<SetState>(); > // FIXME: for now, only drop the item if the only state-change flags are platform-specific. >- if (stateItem.state().m_changeFlags == GraphicsContextState::ShouldSubpixelQuantizeFontsChange) >+ if (stateItem.stateChange().m_changeFlags == GraphicsContextState::ShouldSubpixelQuantizeFontsChange) > return false; > >- if (stateItem.state().m_changeFlags == GraphicsContextState::ShouldSubpixelQuantizeFontsChange) >+ if (stateItem.stateChange().m_changeFlags == GraphicsContextState::ShouldSubpixelQuantizeFontsChange) > return false; > } > break; >diff --git a/Source/WebCore/platform/graphics/displaylists/DisplayListItemBuffer.cpp b/Source/WebCore/platform/graphics/displaylists/DisplayListItemBuffer.cpp >index 50c8d8f7577a16705ecf855ad169818b6df98bba..395fe671ccf7422a165676c79cd1e09ef559a94d 100644 >--- a/Source/WebCore/platform/graphics/displaylists/DisplayListItemBuffer.cpp >+++ b/Source/WebCore/platform/graphics/displaylists/DisplayListItemBuffer.cpp >@@ -89,7 +89,7 @@ void ItemHandle::apply(GraphicsContext& context) > return; > } > case ItemType::SetState: { >- get<SetState>().apply(context); >+ ASSERT_NOT_REACHED(); > return; > } > case ItemType::SetLineCap: { >diff --git a/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp b/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp >index 213db9c8cf42ec1ae2d1339375d9f5630e76d743..f90091f12d25bb7c5609275d014dea1ab10293da 100644 >--- a/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp >+++ b/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp >@@ -209,23 +209,29 @@ static TextStream& operator<<(TextStream& ts, const SetStrokeThickness& state) > } > > SetState::SetState(const GraphicsContextState& state, GraphicsContextState::StateChangeFlags flags) >- : m_state(state, flags) >+ : m_stateChange(state, flags) > { > } > >-SetState::SetState(const GraphicsContextStateChange& stateChange) >- : m_state(stateChange) >+SetState::SetState(const GraphicsContextStateChange& stateChange, const PatternData& strokePattern, const PatternData& fillPattern) >+ : m_stateChange(stateChange) >+ , m_strokePattern(strokePattern) >+ , m_fillPattern(fillPattern) > { > } > >-void SetState::apply(GraphicsContext& context) const >+void SetState::apply(GraphicsContext& context, NativeImage* strokePatternImage, NativeImage* fillPatternImage) > { >- m_state.apply(context); >+ if (m_stateChange.m_changeFlags.contains(GraphicsContextState::StrokePatternChange) && strokePatternImage) >+ m_stateChange.m_state.strokePattern = Pattern::create(makeRef(*strokePatternImage), m_strokePattern.parameters); >+ if (m_stateChange.m_changeFlags.contains(GraphicsContextState::FillPatternChange) && fillPatternImage) >+ m_stateChange.m_state.fillPattern = Pattern::create(makeRef(*fillPatternImage), m_fillPattern.parameters); >+ m_stateChange.apply(context); > } > > static TextStream& operator<<(TextStream& ts, const SetState& state) > { >- ts << state.state(); >+ ts << state.stateChange(); > return ts; > } > >diff --git a/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h b/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h >index 4cfbd89b046595f281d41e21205a7ff3a6a6367e..706b84ff80521d39bb0575b2b8639335cc76ea0c 100644 >--- a/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h >+++ b/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h >@@ -254,9 +254,12 @@ public: > static constexpr bool isDrawingItem = false; > > WEBCORE_EXPORT SetState(const GraphicsContextState&, GraphicsContextState::StateChangeFlags); >- WEBCORE_EXPORT SetState(const GraphicsContextStateChange&); >- >- const GraphicsContextStateChange& state() const { return m_state; } >+ >+ const GraphicsContextStateChange& stateChange() const { return m_stateChange; } >+ const Pattern::Parameters& strokePatternParameters() const { return m_strokePattern.parameters; } >+ const Pattern::Parameters& fillPatternParameters() const { return m_fillPattern.parameters; } >+ RenderingResourceIdentifier strokePatternImageIdentifier() const { return m_strokePattern.tileImageIdentifier; } >+ RenderingResourceIdentifier fillPatternImageIdentifier() const { return m_fillPattern.tileImageIdentifier; } > > static void builderState(GraphicsContext&, const GraphicsContextState&, GraphicsContextState::StateChangeFlags); > >@@ -265,19 +268,28 @@ public: > template<class Encoder> void encode(Encoder&) const; > template<class Decoder> static Optional<SetState> decode(Decoder&); > >- void apply(GraphicsContext&) const; >+ void apply(GraphicsContext&, NativeImage* strokePatternImage, NativeImage* fillPatternImage); > > private: >- GraphicsContextStateChange m_state; >+ struct PatternData { >+ RenderingResourceIdentifier tileImageIdentifier; >+ Pattern::Parameters parameters; >+ }; >+ >+ WEBCORE_EXPORT SetState(const GraphicsContextStateChange&, const PatternData& strokePattern, const PatternData& fillPattern); >+ >+ GraphicsContextStateChange m_stateChange; >+ PatternData m_strokePattern; >+ PatternData m_fillPattern; > }; > > template<class Encoder> > void SetState::encode(Encoder& encoder) const > { >- auto changeFlags = m_state.m_changeFlags; >+ auto changeFlags = m_stateChange.m_changeFlags; > encoder << changeFlags; > >- auto& state = m_state.m_state; >+ auto& state = m_stateChange.m_state; > > if (changeFlags.contains(GraphicsContextState::StrokeGradientChange)) { > encoder << !!state.strokeGradient; >@@ -287,8 +299,10 @@ void SetState::encode(Encoder& encoder) const > > if (changeFlags.contains(GraphicsContextState::StrokePatternChange)) { > encoder << !!state.strokePattern; >- if (state.strokePattern) >- encoder << *state.strokePattern; >+ if (auto& pattern = state.strokePattern) { >+ encoder << pattern->tileImage().renderingResourceIdentifier(); >+ encoder.encodeFixedLengthData(reinterpret_cast<const uint8_t*>(&pattern->parameters()), sizeof(Pattern::Parameters), 1); >+ } > } > > if (changeFlags.contains(GraphicsContextState::FillGradientChange)) { >@@ -299,8 +313,10 @@ void SetState::encode(Encoder& encoder) const > > if (changeFlags.contains(GraphicsContextState::FillPatternChange)) { > encoder << !!state.fillPattern; >- if (state.fillPattern) >- encoder << *state.fillPattern; >+ if (auto& pattern = state.fillPattern) { >+ encoder << pattern->tileImage().renderingResourceIdentifier(); >+ encoder.encodeFixedLengthData(reinterpret_cast<const uint8_t*>(&pattern->parameters()), sizeof(Pattern::Parameters), 1); >+ } > } > > if (changeFlags.contains(GraphicsContextState::ShadowChange)) { >@@ -366,6 +382,9 @@ Optional<SetState> SetState::decode(Decoder& decoder) > GraphicsContextStateChange stateChange; > stateChange.m_changeFlags = *changeFlags; > >+ PatternData strokePattern; >+ PatternData fillPattern; >+ > if (stateChange.m_changeFlags.contains(GraphicsContextState::StrokeGradientChange)) { > Optional<bool> hasStrokeGradient; > decoder >> hasStrokeGradient; >@@ -388,11 +407,16 @@ Optional<SetState> SetState::decode(Decoder& decoder) > return WTF::nullopt; > > if (hasStrokePattern.value()) { >- auto strokePattern = Pattern::decode(decoder); >- if (!strokePattern) >+ Optional<RenderingResourceIdentifier> renderingResourceIdentifier; >+ decoder >> renderingResourceIdentifier; >+ if (!renderingResourceIdentifier) > return WTF::nullopt; > >- stateChange.m_state.strokePattern = WTFMove(*strokePattern); >+ Pattern::Parameters parameters; >+ if (!decoder.decodeFixedLengthData(reinterpret_cast<uint8_t*>(¶meters), sizeof(Pattern::Parameters), 1)) >+ return WTF::nullopt; >+ >+ strokePattern = { *renderingResourceIdentifier, parameters }; > } > } > >@@ -418,11 +442,16 @@ Optional<SetState> SetState::decode(Decoder& decoder) > return WTF::nullopt; > > if (hasFillPattern.value()) { >- auto fillPattern = Pattern::decode(decoder); >- if (!fillPattern) >+ Optional<RenderingResourceIdentifier> renderingResourceIdentifier; >+ decoder >> renderingResourceIdentifier; >+ if (!renderingResourceIdentifier) > return WTF::nullopt; > >- stateChange.m_state.fillPattern = WTFMove(*fillPattern); >+ Pattern::Parameters parameters; >+ if (!decoder.decodeFixedLengthData(reinterpret_cast<uint8_t*>(¶meters), sizeof(Pattern::Parameters), 1)) >+ return WTF::nullopt; >+ >+ fillPattern = { *renderingResourceIdentifier, parameters }; > } > } > >@@ -583,7 +612,7 @@ Optional<SetState> SetState::decode(Decoder& decoder) > stateChange.m_state.shadowsIgnoreTransforms = *shadowsIgnoreTransforms; > } > >- return { stateChange }; >+ return {{ stateChange, strokePattern, fillPattern }}; > } > > class SetLineCap { >diff --git a/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp b/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp >index 4cdc3b0aecc94dcb1666f09929416651724b3a3a..99f716bae56be9a9e42f0bbbb34e2637bcfa0e33 100644 >--- a/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp >+++ b/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp >@@ -85,9 +85,20 @@ static bool containsOnlyInlineStateChanges(const GraphicsContextStateChange& cha > return true; > } > >+void Recorder::cacheNativeImage(NativeImage& image) >+{ >+ if (m_delegate) >+ m_delegate->cacheNativeImage(image); >+ m_displayList.cacheNativeImage(image); >+} >+ > void Recorder::appendStateChangeItem(const GraphicsContextStateChange& changes, GraphicsContextState::StateChangeFlags changeFlags) > { > if (!containsOnlyInlineStateChanges(changes, changeFlags)) { >+ if (auto pattern = changes.m_state.strokePattern) >+ cacheNativeImage(pattern->tileImage()); >+ if (auto pattern = changes.m_state.fillPattern) >+ cacheNativeImage(pattern->tileImage()); > append<SetState>(changes.m_state, changeFlags); > return; > } >@@ -183,17 +194,13 @@ void Recorder::drawImageBuffer(WebCore::ImageBuffer& imageBuffer, const FloatRec > > void Recorder::drawNativeImage(NativeImage& image, const FloatSize& imageSize, const FloatRect& destRect, const FloatRect& srcRect, const ImagePaintingOptions& options) > { >- if (m_delegate) >- m_delegate->cacheNativeImage(image); >- m_displayList.cacheNativeImage(image); >+ cacheNativeImage(image); > append<DrawNativeImage>(image.renderingResourceIdentifier(), imageSize, destRect, srcRect, options); > } > > void Recorder::drawPattern(NativeImage& image, const FloatSize& imageSize, const FloatRect& destRect, const FloatRect& tileRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, const ImagePaintingOptions& options) > { >- if (m_delegate) >- m_delegate->cacheNativeImage(image); >- m_displayList.cacheNativeImage(image); >+ cacheNativeImage(image); > append<DrawPattern>(image.renderingResourceIdentifier(), imageSize, destRect, tileRect, patternTransform, phase, spacing, options); > } > >diff --git a/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h b/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h >index 64f78acb6c4963985266d2c43571eb69445ce03c..8046a21a2e1811490c67060295c67e0ddaaac1b3 100644 >--- a/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h >+++ b/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h >@@ -171,6 +171,8 @@ private: > > WEBCORE_EXPORT void willAppendItemOfType(ItemType); > >+ void cacheNativeImage(NativeImage&); >+ > void appendStateChangeItem(const GraphicsContextStateChange&, GraphicsContextState::StateChangeFlags); > > FloatRect extentFromLocalBounds(const FloatRect&) const; >diff --git a/Source/WebCore/platform/graphics/displaylists/DisplayListReplayer.cpp b/Source/WebCore/platform/graphics/displaylists/DisplayListReplayer.cpp >index 325db9739e9fcf2131e914e6ae5c85a82ebae1c9..4d906a24564462f6e018169d1b168992d8df2cca 100644 >--- a/Source/WebCore/platform/graphics/displaylists/DisplayListReplayer.cpp >+++ b/Source/WebCore/platform/graphics/displaylists/DisplayListReplayer.cpp >@@ -70,6 +70,29 @@ inline static Optional<RenderingResourceIdentifier> applyNativeImageItem(Graphic > return resourceIdentifier; > } > >+inline static Optional<RenderingResourceIdentifier> applySetStateItem(GraphicsContext& context, const NativeImageHashMap& nativeImages, ItemHandle item) >+{ >+ auto& setStateItem = item.get<SetState>(); >+ >+ NativeImage* strokePatternImage = nullptr; >+ NativeImage* fillPatternImage = nullptr; >+ >+ if (auto resourceIdentifier = setStateItem.strokePatternImageIdentifier()) { >+ strokePatternImage = nativeImages.get(resourceIdentifier); >+ if (!strokePatternImage) >+ return resourceIdentifier; >+ } >+ >+ if (auto resourceIdentifier = setStateItem.fillPatternImageIdentifier()) { >+ fillPatternImage = nativeImages.get(resourceIdentifier); >+ if (!fillPatternImage) >+ return resourceIdentifier; >+ } >+ >+ setStateItem.apply(context, strokePatternImage, fillPatternImage); >+ return WTF::nullopt; >+} >+ > template<class T> > inline static Optional<RenderingResourceIdentifier> applyFontItem(GraphicsContext& context, const FontRenderingResourceMap& fonts, ItemHandle item) > { >@@ -117,6 +140,12 @@ std::pair<Optional<StopReplayReason>, Optional<RenderingResourceIdentifier>> Rep > return { WTF::nullopt, WTF::nullopt }; > } > >+ if (item.is<SetState>()) { >+ if (auto missingCachedResourceIdentifier = applySetStateItem(m_context, m_nativeImages, item)) >+ return { StopReplayReason::MissingCachedResource, WTFMove(missingCachedResourceIdentifier) }; >+ return { WTF::nullopt, WTF::nullopt }; >+ } >+ > item.apply(m_context); > return { WTF::nullopt, WTF::nullopt }; > } >diff --git a/Source/WebCore/platform/graphics/filters/FETile.cpp b/Source/WebCore/platform/graphics/filters/FETile.cpp >index 5633a0afa64dd66d6aed9e97de2e68dbe16b3811..165e67bc30f45c646ab2b048e62083c77f4412c8 100644 >--- a/Source/WebCore/platform/graphics/filters/FETile.cpp >+++ b/Source/WebCore/platform/graphics/filters/FETile.cpp >@@ -72,15 +72,15 @@ void FETile::platformApplySoftware() > tileImageContext.translate(-inMaxEffectLocation.x(), -inMaxEffectLocation.y()); > tileImageContext.drawImageBuffer(*inBuffer, in->absolutePaintRect().location()); > >- auto tileImageCopy = ImageBuffer::sinkIntoImage(WTFMove(tileImage)); >+ auto tileImageCopy = ImageBuffer::sinkIntoNativeImage(WTFMove(tileImage)); > if (!tileImageCopy) > return; > >- auto pattern = Pattern::create(tileImageCopy.releaseNonNull(), true, true); >- > AffineTransform patternTransform; > patternTransform.translate(inMaxEffectLocation - maxEffectLocation); >- pattern.get().setPatternSpaceTransform(patternTransform); >+ >+ auto pattern = Pattern::create(tileImageCopy.releaseNonNull(), { true, true, patternTransform}); >+ > GraphicsContext& filterContext = resultImage->context(); > filterContext.setFillPattern(WTFMove(pattern)); > filterContext.fillRect(FloatRect(FloatPoint(), absolutePaintRect().size())); >diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp >index 0d04811b3e981c51651354ad80f0bcf762a0bebd..c70c14ade1ff5bdede474cefbe3813080145d151 100644 >--- a/Source/WebCore/rendering/RenderLayerBacking.cpp >+++ b/Source/WebCore/rendering/RenderLayerBacking.cpp >@@ -3266,14 +3266,13 @@ static RefPtr<Pattern> patternForDescription(PatternDescription description, Flo > imageContext.drawText(font, textRun, { textGap, yOffset }, 0); > } > >- auto tileImage = ImageBuffer::sinkIntoImage(WTFMove(imageBuffer)); >- auto fillPattern = Pattern::create(tileImage.releaseNonNull(), true, true); >+ auto tileImage = ImageBuffer::sinkIntoNativeImage(WTFMove(imageBuffer)); >+ > AffineTransform patternOffsetTransform; > patternOffsetTransform.translate(contentOffset + description.phase); > patternOffsetTransform.scale(1 / destContext.scaleFactor()); >- fillPattern->setPatternSpaceTransform(patternOffsetTransform); > >- return fillPattern; >+ return Pattern::create(tileImage.releaseNonNull(), { true, true, patternOffsetTransform}); > }; > #endif > >diff --git a/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp b/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp >index e342431d1491f3f1d0bbd4bcf95a0526ed030fd1..94719b3ef8772efca07c0e2b35dd1c0406097369 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp >@@ -112,16 +112,12 @@ PatternData* RenderSVGResourcePattern::buildPattern(RenderElement& renderer, Opt > > const IntSize tileImageSize = tileImage->logicalSize(); > >- RefPtr<Image> copiedImage = ImageBuffer::sinkIntoImage(WTFMove(tileImage)); >+ auto copiedImage = ImageBuffer::sinkIntoNativeImage(WTFMove(tileImage)); > if (!copiedImage) > return nullptr; > >- // Build pattern. >- auto patternData = makeUnique<PatternData>(); >- patternData->pattern = Pattern::create(copiedImage.releaseNonNull(), true, true); >- > // Compute pattern space transformation. >- >+ auto patternData = makeUnique<PatternData>(); > patternData->transform.translate(tileBoundaries.location()); > patternData->transform.scale(tileBoundaries.size() / tileImageSize); > >@@ -135,7 +131,9 @@ PatternData* RenderSVGResourcePattern::buildPattern(RenderElement& renderer, Opt > if (shouldTransformOnTextPainting(renderer, additionalTextTransformation)) > patternData->transform *= additionalTextTransformation; > } >- patternData->pattern->setPatternSpaceTransform(patternData->transform); >+ >+ // Build pattern. >+ patternData->pattern = Pattern::create(copiedImage.releaseNonNull(), { true, true, patternData->transform }); > > // Various calls above may trigger invalidations in some fringe cases (ImageBuffer allocation > // failures in the SVG image cache for example). To avoid having our PatternData deleted by >diff --git a/Source/WebKit/Shared/WebCoreArgumentCoders.cpp b/Source/WebKit/Shared/WebCoreArgumentCoders.cpp >index 19af29966827d4b601d8cd527bf14c9a77d7089b..bb7c84bf81475ccc919f0783004d92971800fe5e 100644 >--- a/Source/WebKit/Shared/WebCoreArgumentCoders.cpp >+++ b/Source/WebKit/Shared/WebCoreArgumentCoders.cpp >@@ -1075,18 +1075,6 @@ static WARN_UNUSED_RETURN bool decodeOptionalImage(Decoder& decoder, RefPtr<Imag > return decodeImage(decoder, image); > } > >-void ArgumentCoder<ImageHandle>::encode(Encoder& encoder, const ImageHandle& imageHandle) >-{ >- encodeOptionalImage(encoder, imageHandle.image.get()); >-} >- >-bool ArgumentCoder<ImageHandle>::decode(Decoder& decoder, ImageHandle& imageHandle) >-{ >- if (!decodeOptionalImage(decoder, imageHandle.image)) >- return false; >- return true; >-} >- > void ArgumentCoder<Ref<Font>>::encode(Encoder& encoder, const Ref<WebCore::Font>& font) > { > encoder << font->origin(); >diff --git a/Source/WebKit/Shared/WebCoreArgumentCoders.h b/Source/WebKit/Shared/WebCoreArgumentCoders.h >index 00c143fbbb89d2664cae50a5e1fbf3f8e9159507..6f72180f9853273e3f16f610b4d531f1acf18ae6 100644 >--- a/Source/WebKit/Shared/WebCoreArgumentCoders.h >+++ b/Source/WebKit/Shared/WebCoreArgumentCoders.h >@@ -109,7 +109,6 @@ class FixedPositionViewportConstraints; > class Font; > class FontPlatformData; > class HTTPHeaderMap; >-class ImageHandle; > class IntPoint; > class IntRect; > class IntSize; >@@ -418,11 +417,6 @@ template<> struct ArgumentCoder<Ref<WebCore::Font>> { > static Optional<WebCore::FontPlatformData> decodePlatformData(Decoder&); > }; > >-template<> struct ArgumentCoder<WebCore::ImageHandle> { >- static void encode(Encoder&, const WebCore::ImageHandle&); >- static WARN_UNUSED_RETURN bool decode(Decoder&, WebCore::ImageHandle&); >-}; >- > template<> struct ArgumentCoder<WebCore::ResourceRequest> { > static void encode(Encoder&, const WebCore::ResourceRequest&); > static WARN_UNUSED_RETURN bool decode(Decoder&, WebCore::ResourceRequest&);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 221637
:
419783
|
419784
|
419787
|
419793
|
419803
|
420097
|
420101