WebKit Bugzilla
Attachment 346000 Details for
Bug 188141
: Shrink GraphicsLayerCA
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188141-20180728145823.patch (text/plain), 80.78 KB, created by
Simon Fraser (smfr)
on 2018-07-28 14:58:24 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2018-07-28 14:58:24 PDT
Size:
80.78 KB
patch
obsolete
>Subversion Revision: 234343 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 102c257fa1d4be9ba2b1d1ad9ec61e0ee758dc72..c36ea45c71471cfa7e03f4225f68701f57f572b6 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,76 @@ >+2018-07-28 Simon Fraser <simon.fraser@apple.com> >+ >+ Shrink GraphicsLayerCA >+ https://bugs.webkit.org/show_bug.cgi?id=188141 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Shrink GraphicsLayerCA from 1040 to 880 bytes by: >+ * moving all the clone-related stuff into the lazily-allocated m_layerClones >+ * moving all the animation-related stuff into the lazily-allocated m_animations >+ * making enums be 8-bit >+ * re-ordering data members >+ >+ * page/cocoa/ResourceUsageOverlayCocoa.mm: >+ (WebCore::ResourceUsageOverlay::platformInitialize): >+ * platform/graphics/GraphicsLayer.cpp: >+ (WebCore::GraphicsLayer::GraphicsLayer): >+ (WebCore::operator<<): >+ * platform/graphics/GraphicsLayer.h: >+ * platform/graphics/GraphicsLayerClient.h: >+ * platform/graphics/WindRule.h: >+ * platform/graphics/ca/GraphicsLayerCA.cpp: >+ (WebCore::GraphicsLayerCA::GraphicsLayerCA): >+ (WebCore::GraphicsLayerCA::moveOrCopyAnimations): >+ (WebCore::GraphicsLayerCA::addProcessingActionForAnimation): >+ (WebCore::GraphicsLayerCA::setContentsToSolidColor): >+ (WebCore::GraphicsLayerCA::setContentsToImage): >+ (WebCore::GraphicsLayerCA::setContentsToPlatformLayer): >+ (WebCore::GraphicsLayerCA::contentsLayerForMedia const): >+ (WebCore::GraphicsLayerCA::layerDidDisplay): >+ (WebCore::layerTypeForCustomBackdropAppearance): >+ (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): >+ (WebCore::GraphicsLayerCA::updateGeometry): >+ (WebCore::GraphicsLayerCA::updateMasksToBounds): >+ (WebCore::GraphicsLayerCA::updateContentsVisibility): >+ (WebCore::GraphicsLayerCA::updateContentsOpaque): >+ (WebCore::GraphicsLayerCA::updateBackfaceVisibility): >+ (WebCore::GraphicsLayerCA::updateFilters): >+ (WebCore::GraphicsLayerCA::updateBackdropFilters): >+ (WebCore::GraphicsLayerCA::updateBackdropFiltersRect): >+ (WebCore::GraphicsLayerCA::ensureStructuralLayer): >+ (WebCore::GraphicsLayerCA::updateDrawsContent): >+ (WebCore::GraphicsLayerCA::updateCoverage): >+ (WebCore::GraphicsLayerCA::updateDebugIndicators): >+ (WebCore::GraphicsLayerCA::updateContentsImage): >+ (WebCore::GraphicsLayerCA::updateContentsPlatformLayer): >+ (WebCore::GraphicsLayerCA::updateContentsColorLayer): >+ (WebCore::GraphicsLayerCA::updateContentsRects): >+ (WebCore::GraphicsLayerCA::updateMasksToBoundsRect): >+ (WebCore::GraphicsLayerCA::updateMaskLayer): >+ (WebCore::GraphicsLayerCA::updateAnimations): >+ (WebCore::GraphicsLayerCA::isRunningTransformAnimation const): >+ (WebCore::GraphicsLayerCA::ensureLayerAnimations): >+ (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): >+ * platform/graphics/ca/GraphicsLayerCA.h: >+ (WebCore::GraphicsLayerCA::animationIsRunning const): >+ (WebCore::GraphicsLayerCA::primaryLayerClones const): Deleted. >+ * platform/graphics/ca/PlatformCALayerClient.h: >+ (WebCore::PlatformCALayerClient::platformCALayerContentsOrientation const): >+ * platform/graphics/ca/TileCoverageMap.h: >+ * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h: >+ * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: >+ (PlatformCALayerCocoa::PlatformCALayerCocoa): >+ (PlatformCALayerCocoa::requiresCustomAppearanceUpdateOnBoundsChange const): >+ (PlatformCALayerCocoa::updateCustomAppearance): >+ (PlatformCALayer::drawLayerContents): >+ * rendering/RenderLayerBacking.cpp: >+ (WebCore::RenderLayerBacking::updateCustomAppearance): >+ (WebCore::RenderLayerBacking::updateConfiguration): >+ * rendering/RenderLayerCompositor.cpp: >+ (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged): >+ (WebCore::RenderLayerCompositor::updateOverflowControlsLayers): >+ > 2018-07-24 Simon Fraser <simon.fraser@apple.com> > > Animation stops with object-fit:contain on an animated 2d canvas >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index fcb37d14655b344beb93b7f690e5ea8695d051ff..edeee374dbe7d0cacbd63c6ebfc8f9dda556109f 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,24 @@ >+2018-07-28 Simon Fraser <simon.fraser@apple.com> >+ >+ Shrink GraphicsLayerCA >+ https://bugs.webkit.org/show_bug.cgi?id=188141 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Shrink GraphicsLayerCA from 1040 to 880 bytes by: >+ * moving all the clone-related stuff into the lazily-allocated m_layerClones >+ * moving all the animation-related stuff into the lazily-allocated m_animations >+ * making enums be 8-bit >+ * re-ordering data members >+ >+ * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm: >+ (WebKit::updateCustomAppearance): >+ (WebKit::RemoteLayerTreePropertyApplier::applyProperties): >+ * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: >+ (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties): >+ * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp: >+ (WebKit::PlatformCALayerRemote::requiresCustomAppearanceUpdateOnBoundsChange const): >+ > 2018-07-27 Chris Dumez <cdumez@apple.com> > > Fix thread-safety issues related to RealtimeMediaSource::audioSamplesAvailable() >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index 0e3375663b93d5b86e3cb5018566cab48fae5d06..a6680ec8df28f74bcf96bd4ac234cb9f15afabec 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,19 @@ >+2018-07-28 Simon Fraser <simon.fraser@apple.com> >+ >+ Shrink GraphicsLayerCA >+ https://bugs.webkit.org/show_bug.cgi?id=188141 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Shrink GraphicsLayerCA from 1040 to 880 bytes by: >+ * moving all the clone-related stuff into the lazily-allocated m_layerClones >+ * moving all the animation-related stuff into the lazily-allocated m_animations >+ * making enums be 8-bit >+ * re-ordering data members >+ >+ * WebView/WebView.mm: >+ (-[WebView _setMediaLayer:forPluginView:]): >+ > 2018-07-26 Andy VanWagoner <andy@vanwagoner.family> > > [INTL] Remove INTL sub-feature compile flags >diff --git a/Source/WebCore/page/cocoa/ResourceUsageOverlayCocoa.mm b/Source/WebCore/page/cocoa/ResourceUsageOverlayCocoa.mm >index b50ac7975155c864ca0021c229609e77aea98311..a33ef2afd86bcc065867348d8f6d7d3cbb28ca83 100644 >--- a/Source/WebCore/page/cocoa/ResourceUsageOverlayCocoa.mm >+++ b/Source/WebCore/page/cocoa/ResourceUsageOverlayCocoa.mm >@@ -226,7 +226,7 @@ void ResourceUsageOverlay::platformInitialize() > [m_layer.get() setBackgroundColor:adoptCF(createColor(0, 0, 0, 0.8)).get()]; > [m_layer.get() setBounds:CGRectMake(0, 0, normalWidth, normalHeight)]; > >- overlay().layer().setContentsToPlatformLayer(m_layer.get(), GraphicsLayer::NoContentsLayer); >+ overlay().layer().setContentsToPlatformLayer(m_layer.get(), GraphicsLayer::ContentsLayerPurpose::None); > > ResourceUsageThread::addObserver(this, [this] (const ResourceUsageData& data) { > appendDataToHistory(data); >diff --git a/Source/WebCore/platform/graphics/GraphicsLayer.cpp b/Source/WebCore/platform/graphics/GraphicsLayer.cpp >index 33fdd82328c6f26ce49dd6fbcb00771841cd6e69..90022e6a817a681ee2df64bb436a9212ea5603f0 100644 >--- a/Source/WebCore/platform/graphics/GraphicsLayer.cpp >+++ b/Source/WebCore/platform/graphics/GraphicsLayer.cpp >@@ -112,12 +112,6 @@ bool GraphicsLayer::supportsContentsTiling() > > GraphicsLayer::GraphicsLayer(Type type, GraphicsLayerClient& client) > : m_client(client) >- , m_anchorPoint(0.5f, 0.5f, 0) >- , m_opacity(1) >- , m_zPosition(0) >-#if ENABLE(CSS_COMPOSITING) >- , m_blendMode(BlendModeNormal) >-#endif > , m_type(type) > , m_contentsOpaque(false) > , m_supportsSubpixelAntialiasedText(false) >@@ -135,14 +129,6 @@ GraphicsLayer::GraphicsLayer(Type type, GraphicsLayerClient& client) > , m_isTrackingDisplayListReplay(false) > , m_userInteractionEnabled(true) > , m_canDetachBackingStore(true) >- , m_paintingPhase(GraphicsLayerPaintAllWithOverflowClip) >- , m_contentsOrientation(CompositingCoordinatesTopDown) >- , m_parent(nullptr) >- , m_maskLayer(nullptr) >- , m_replicaLayer(nullptr) >- , m_replicatedLayer(nullptr) >- , m_repaintCount(0) >- , m_customAppearance(NoCustomAppearance) > { > #ifndef NDEBUG > m_client.verifyNotPainting(); >@@ -906,11 +892,11 @@ TextStream& operator<<(TextStream& ts, const Vector<GraphicsLayer::PlatformLayer > TextStream& operator<<(TextStream& ts, const WebCore::GraphicsLayer::CustomAppearance& customAppearance) > { > switch (customAppearance) { >- case GraphicsLayer::CustomAppearance::NoCustomAppearance: ts << "none"; break; >+ case GraphicsLayer::CustomAppearance::None: ts << "none"; break; > case GraphicsLayer::CustomAppearance::ScrollingOverhang: ts << "scrolling-overhang"; break; > case GraphicsLayer::CustomAppearance::ScrollingShadow: ts << "scrolling-shadow"; break; >- case GraphicsLayer::CustomAppearance::LightBackdropAppearance: ts << "light-backdrop"; break; >- case GraphicsLayer::CustomAppearance::DarkBackdropAppearance: ts << "dark-backdrop"; break; >+ case GraphicsLayer::CustomAppearance::LightBackdrop: ts << "light-backdrop"; break; >+ case GraphicsLayer::CustomAppearance::DarkBackdrop: ts << "dark-backdrop"; break; > } > return ts; > } >diff --git a/Source/WebCore/platform/graphics/GraphicsLayer.h b/Source/WebCore/platform/graphics/GraphicsLayer.h >index e640f477cca514244caa3c7b51fa99c747616082..b501a8f0ea276f28ccf76cd02d7649fedf216367 100644 >--- a/Source/WebCore/platform/graphics/GraphicsLayer.h >+++ b/Source/WebCore/platform/graphics/GraphicsLayer.h >@@ -233,7 +233,7 @@ protected: > class GraphicsLayer { > WTF_MAKE_NONCOPYABLE(GraphicsLayer); WTF_MAKE_FAST_ALLOCATED; > public: >- enum class Type { >+ enum class Type : uint8_t { > Normal, > PageTiledBacking, > Scrolling, >@@ -267,13 +267,13 @@ public: > // Returns true if the child list changed. > WEBCORE_EXPORT virtual bool setChildren(const Vector<GraphicsLayer*>&); > >- enum ContentsLayerPurpose { >- NoContentsLayer = 0, >- ContentsLayerForImage, >- ContentsLayerForMedia, >- ContentsLayerForCanvas, >- ContentsLayerForBackgroundColor, >- ContentsLayerForPlugin >+ enum class ContentsLayerPurpose : uint8_t { >+ None = 0, >+ Image, >+ Media, >+ Canvas, >+ BackgroundColor, >+ Plugin > }; > > // Add child layers. If the child is already parented, it will be removed from its old parent. >@@ -475,7 +475,7 @@ public: > // For hosting this GraphicsLayer in a native layer hierarchy. > virtual PlatformLayer* platformLayer() const { return 0; } > >- enum CompositingCoordinatesOrientation { CompositingCoordinatesTopDown, CompositingCoordinatesBottomUp }; >+ enum class CompositingCoordinatesOrientation : uint8_t { TopDown, BottomUp }; > > // Flippedness of the contents of this layer. Does not affect sublayer geometry. > virtual void setContentsOrientation(CompositingCoordinatesOrientation orientation) { m_contentsOrientation = orientation; } >@@ -496,7 +496,13 @@ public: > virtual void setDebugBackgroundColor(const Color&) { } > virtual void setDebugBorder(const Color&, float /*borderWidth*/) { } > >- enum CustomAppearance { NoCustomAppearance, ScrollingOverhang, ScrollingShadow, LightBackdropAppearance, DarkBackdropAppearance }; >+ enum class CustomAppearance : uint8_t { >+ None, >+ ScrollingOverhang, >+ ScrollingShadow, >+ LightBackdrop, >+ DarkBackdrop >+ }; > virtual void setCustomAppearance(CustomAppearance customAppearance) { m_customAppearance = customAppearance; } > CustomAppearance customAppearance() const { return m_customAppearance; } > >@@ -628,7 +634,7 @@ protected: > // If set, overrides m_position. Only used for coverage computation. > std::optional<FloatPoint> m_approximatePosition; > >- FloatPoint3D m_anchorPoint; >+ FloatPoint3D m_anchorPoint { 0.5f, 0.5f, 0 }; > FloatSize m_size; > FloatPoint m_boundsOrigin; > >@@ -636,17 +642,20 @@ protected: > TransformationMatrix m_childrenTransform; > > Color m_backgroundColor; >- float m_opacity; >- float m_zPosition; >+ float m_opacity { 1 }; >+ float m_zPosition { 0 }; > > FilterOperations m_filters; > FilterOperations m_backdropFilters; > > #if ENABLE(CSS_COMPOSITING) >- BlendMode m_blendMode; >+ BlendMode m_blendMode { BlendModeNormal }; > #endif > > const Type m_type; >+ CustomAppearance m_customAppearance { CustomAppearance::None }; >+ GraphicsLayerPaintingPhase m_paintingPhase { GraphicsLayerPaintAllWithOverflowClip }; >+ CompositingCoordinatesOrientation m_contentsOrientation { CompositingCoordinatesOrientation::TopDown }; // affects orientation of layer contents > > bool m_contentsOpaque : 1; > bool m_supportsSubpixelAntialiasedText : 1; >@@ -664,18 +673,17 @@ protected: > bool m_isTrackingDisplayListReplay : 1; > bool m_userInteractionEnabled : 1; > bool m_canDetachBackingStore : 1; >- >- GraphicsLayerPaintingPhase m_paintingPhase; >- CompositingCoordinatesOrientation m_contentsOrientation; // affects orientation of layer contents >+ >+ int m_repaintCount { 0 }; > > Vector<GraphicsLayer*> m_children; >- GraphicsLayer* m_parent; >+ GraphicsLayer* m_parent { nullptr }; > >- GraphicsLayer* m_maskLayer; // Reference to mask layer. We don't own this. >+ GraphicsLayer* m_maskLayer { nullptr }; // Reference to mask layer. We don't own this. > >- GraphicsLayer* m_replicaLayer; // A layer that replicates this layer. We only allow one, for now. >+ GraphicsLayer* m_replicaLayer { nullptr }; // A layer that replicates this layer. We only allow one, for now. > // The replica is not parented; this is the primary reference to it. >- GraphicsLayer* m_replicatedLayer; // For a replica layer, a reference to the original layer. >+ GraphicsLayer* m_replicatedLayer { nullptr }; // For a replica layer, a reference to the original layer. > FloatPoint m_replicatedLayerPosition; // For a replica layer, the position of the replica. > > FloatRect m_contentsRect; >@@ -686,12 +694,9 @@ protected: > FloatRoundedRect m_backdropFiltersRect; > std::optional<FloatRect> m_animationExtent; > >- int m_repaintCount; >- CustomAppearance m_customAppearance; >- > #if USE(CA) >- Path m_shapeLayerPath; > WindRule m_shapeLayerWindRule { WindRule::NonZero }; >+ Path m_shapeLayerPath; > #endif > }; > >diff --git a/Source/WebCore/platform/graphics/GraphicsLayerClient.h b/Source/WebCore/platform/graphics/GraphicsLayerClient.h >index c3aa277467a14b7b76eaf59846a8a1ea3f8f7bc1..dc2700c8e32ec148220e9c2bd8fa48783be2a36f 100644 >--- a/Source/WebCore/platform/graphics/GraphicsLayerClient.h >+++ b/Source/WebCore/platform/graphics/GraphicsLayerClient.h >@@ -48,7 +48,7 @@ enum GraphicsLayerPaintingPhaseFlags { > GraphicsLayerPaintChildClippingMask = 1 << 6, > GraphicsLayerPaintAllWithOverflowClip = GraphicsLayerPaintBackground | GraphicsLayerPaintForeground > }; >-typedef unsigned GraphicsLayerPaintingPhase; >+typedef uint8_t GraphicsLayerPaintingPhase; > > enum AnimatedPropertyID { > AnimatedPropertyInvalid, >diff --git a/Source/WebCore/platform/graphics/WindRule.h b/Source/WebCore/platform/graphics/WindRule.h >index 40cdb67522762c14981dc6f12c6f23f210b6aa63..564e2037cfca7f928479399b6fb3886481463d0e 100644 >--- a/Source/WebCore/platform/graphics/WindRule.h >+++ b/Source/WebCore/platform/graphics/WindRule.h >@@ -29,7 +29,7 @@ > > namespace WebCore { > >-enum class WindRule { >+enum class WindRule : uint8_t { > NonZero = 0, > EvenOdd = 1 > }; >diff --git a/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp b/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp >index 086c53e6b9019303c8cb4d0077ef3839b55d66d0..e82449a50fcc8e9b817fc77e2aa3a0195f6a1226 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp >+++ b/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp >@@ -220,7 +220,7 @@ private: > virtual bool platformCALayerRespondsToLayoutChanges() const { return true; } > > virtual void platformCALayerAnimationStarted(MonotonicTime beginTime) { } >- virtual GraphicsLayer::CompositingCoordinatesOrientation platformCALayerContentsOrientation() const { return GraphicsLayer::CompositingCoordinatesBottomUp; } >+ virtual GraphicsLayer::CompositingCoordinatesOrientation platformCALayerContentsOrientation() const { return GraphicsLayer::CompositingCoordinatesOrientation::TopDown; } > virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect&, GraphicsLayerPaintBehavior) { } > virtual bool platformCALayerShowDebugBorders() const { return false; } > virtual bool platformCALayerShowRepaintCounter(PlatformCALayer*) const { return false; } >diff --git a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp >index 58c94922b812b9987ae8c6bb57e39141d1dabf7f..ff4b03c2128de8b3a98c2a4d81758cee77cff93b 100644 >--- a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp >+++ b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp >@@ -403,6 +403,13 @@ static LayerDisplayListHashMap& layerDisplayListMap() > > GraphicsLayerCA::GraphicsLayerCA(Type layerType, GraphicsLayerClient& client) > : GraphicsLayer(layerType, client) >+ , m_needsFullRepaint(false) >+ , m_usingBackdropLayerType(false) >+ , m_isViewportConstrained(false) >+ , m_intersectsCoverageRect(false) >+ , m_hasEverPainted(false) >+ , m_hasDescendantsWithRunningTransformAnimations(false) >+ , m_hasDescendantsWithUncommittedChanges(false) > { > } > >@@ -683,10 +690,12 @@ void GraphicsLayerCA::moveOrCopyLayerAnimation(MoveOrCopy operation, const Strin > > void GraphicsLayerCA::moveOrCopyAnimations(MoveOrCopy operation, PlatformCALayer *fromLayer, PlatformCALayer *toLayer) > { >+ if (!m_animations) >+ return; >+ > // Look for running animations affecting this property. >- AnimationsMap::const_iterator end = m_runningAnimations.end(); >- for (AnimationsMap::const_iterator it = m_runningAnimations.begin(); it != end; ++it) { >- const Vector<LayerPropertyAnimation>& propertyAnimations = it->value; >+ for (auto it : m_animations->runningAnimations) { >+ const auto& propertyAnimations = it.value; > size_t numAnimations = propertyAnimations.size(); > for (size_t i = 0; i < numAnimations; ++i) { > const LayerPropertyAnimation& currAnimation = propertyAnimations[i]; >@@ -1010,7 +1019,9 @@ bool GraphicsLayerCA::animationCanBeAccelerated(const KeyframeValueList& valueLi > > void GraphicsLayerCA::addProcessingActionForAnimation(const String& animationName, AnimationProcessingAction processingAction) > { >- auto& processingActions = m_animationsToProcess.ensure(animationName, [] { >+ ensureLayerAnimations(); >+ >+ auto& processingActions = m_animations->animationsToProcess.ensure(animationName, [] { > return Vector<AnimationProcessingAction> { }; > }).iterator->value; > >@@ -1104,8 +1115,8 @@ void GraphicsLayerCA::setContentsToSolidColor(const Color& color) > bool contentsLayerChanged = false; > > if (m_contentsSolidColor.isVisible()) { >- if (!m_contentsLayer || m_contentsLayerPurpose != ContentsLayerForBackgroundColor) { >- m_contentsLayerPurpose = ContentsLayerForBackgroundColor; >+ if (!m_contentsLayer || m_contentsLayerPurpose != ContentsLayerPurpose::BackgroundColor) { >+ m_contentsLayerPurpose = ContentsLayerPurpose::BackgroundColor; > m_contentsLayer = createPlatformCALayer(PlatformCALayer::LayerTypeLayer, this); > #if ENABLE(TREE_DEBUGGING) > m_contentsLayer->setName(String::format("contents color %llu", m_contentsLayer->layerID())); >@@ -1116,7 +1127,7 @@ void GraphicsLayerCA::setContentsToSolidColor(const Color& color) > } > } else { > contentsLayerChanged = m_contentsLayer; >- m_contentsLayerPurpose = NoContentsLayer; >+ m_contentsLayerPurpose = ContentsLayerPurpose::None; > m_contentsLayer = nullptr; > } > >@@ -1140,13 +1151,13 @@ void GraphicsLayerCA::setContentsToImage(Image* image) > m_uncorrectedContentsImage = WTFMove(newImage); > m_pendingContentsImage = m_uncorrectedContentsImage; > >- m_contentsLayerPurpose = ContentsLayerForImage; >+ m_contentsLayerPurpose = ContentsLayerPurpose::Image; > if (!m_contentsLayer) > noteSublayersChanged(); > } else { > m_uncorrectedContentsImage = nullptr; > m_pendingContentsImage = nullptr; >- m_contentsLayerPurpose = NoContentsLayer; >+ m_contentsLayerPurpose = ContentsLayerPurpose::None; > if (m_contentsLayer) > noteSublayersChanged(); > } >@@ -1171,7 +1182,7 @@ void GraphicsLayerCA::setContentsToPlatformLayer(PlatformLayer* platformLayer, C > // For now we don't support such a case. > PlatformCALayer* platformCALayer = PlatformCALayer::platformCALayer(platformLayer); > m_contentsLayer = platformLayer ? (platformCALayer ? platformCALayer : createPlatformCALayer(platformLayer, this).ptr()) : nullptr; >- m_contentsLayerPurpose = platformLayer ? purpose : NoContentsLayer; >+ m_contentsLayerPurpose = platformLayer ? purpose : ContentsLayerPurpose::None; > > if (m_contentsClippingLayer && m_contentsLayer) > m_contentsClippingLayer->appendSublayer(*m_contentsLayer); >@@ -1183,30 +1194,25 @@ void GraphicsLayerCA::setContentsToPlatformLayer(PlatformLayer* platformLayer, C > #if PLATFORM(IOS) > PlatformLayer* GraphicsLayerCA::contentsLayerForMedia() const > { >- return m_contentsLayerPurpose == ContentsLayerForMedia ? m_contentsLayer->platformLayer() : nullptr; >+ return m_contentsLayerPurpose == ContentsLayerPurpose::Media ? m_contentsLayer->platformLayer() : nullptr; > } > #endif > > void GraphicsLayerCA::layerDidDisplay(PlatformCALayer* layer) > { >- LayerMap* layerCloneMap; >+ if (!m_layerClones) >+ return; >+ >+ LayerMap* layerCloneMap = nullptr; > > if (layer == m_layer) >- layerCloneMap = m_layerClones.get(); >+ layerCloneMap = &m_layerClones->primaryLayerClones; > else if (layer == m_contentsLayer) >- layerCloneMap = m_contentsLayerClones.get(); >- else >- return; >+ layerCloneMap = &m_layerClones->contentsLayerClones; > > if (layerCloneMap) { >- LayerMap::const_iterator end = layerCloneMap->end(); >- for (LayerMap::const_iterator it = layerCloneMap->begin(); it != end; ++it) { >- PlatformCALayer* currClone = it->value.get(); >- if (!currClone) >- continue; >- >- currClone->copyContentsFromLayer(layer); >- } >+ for (auto& platformLayerClone : layerCloneMap->values()) >+ platformLayerClone->copyContentsFromLayer(layer); > } > } > >@@ -1683,7 +1689,7 @@ void GraphicsLayerCA::platformCALayerLogFilledVisibleFreshTile(unsigned blankPix > > static PlatformCALayer::LayerType layerTypeForCustomBackdropAppearance(GraphicsLayer::CustomAppearance appearance) > { >- return appearance == GraphicsLayer::LightBackdropAppearance ? PlatformCALayer::LayerTypeLightSystemBackdropLayer : PlatformCALayer::LayerTypeDarkSystemBackdropLayer; >+ return appearance == GraphicsLayer::CustomAppearance::LightBackdrop ? PlatformCALayer::LayerTypeLightSystemBackdropLayer : PlatformCALayer::LayerTypeDarkSystemBackdropLayer; > } > > static bool isCustomBackdropLayerType(PlatformCALayer::LayerType layerType) >@@ -1706,7 +1712,7 @@ void GraphicsLayerCA::commitLayerChangesBeforeSublayers(CommitState& commitState > } > > bool needTiledLayer = requiresTiledLayer(pageScaleFactor); >- bool needBackdropLayerType = (customAppearance() == LightBackdropAppearance || customAppearance() == DarkBackdropAppearance); >+ bool needBackdropLayerType = (customAppearance() == CustomAppearance::LightBackdrop || customAppearance() == CustomAppearance::DarkBackdrop); > > PlatformCALayer::LayerType currentLayerType = m_layer->layerType(); > PlatformCALayer::LayerType neededLayerType = currentLayerType; >@@ -1960,8 +1966,8 @@ void GraphicsLayerCA::updateGeometry(float pageScaleFactor, const FloatPoint& po > m_structuralLayer->setBounds(layerBounds); > m_structuralLayer->setAnchorPoint(m_anchorPoint); > >- if (LayerMap* layerCloneMap = m_structuralLayerClones.get()) { >- for (auto& clone : *layerCloneMap) { >+ if (m_layerClones) { >+ for (auto& clone : m_layerClones->structuralLayerClones) { > PlatformCALayer* cloneLayer = clone.value.get(); > FloatPoint clonePosition = layerPosition; > >@@ -1990,8 +1996,8 @@ void GraphicsLayerCA::updateGeometry(float pageScaleFactor, const FloatPoint& po > m_layer->setBounds(adjustedBounds); > m_layer->setAnchorPoint(scaledAnchorPoint); > >- if (LayerMap* layerCloneMap = m_layerClones.get()) { >- for (auto& clone : *layerCloneMap) { >+ if (m_layerClones) { >+ for (auto& clone : m_layerClones->primaryLayerClones) { > PlatformCALayer* cloneLayer = clone.value.get(); > FloatPoint clonePosition = adjustedPosition; > >@@ -2039,8 +2045,8 @@ void GraphicsLayerCA::updateMasksToBounds() > { > m_layer->setMasksToBounds(m_masksToBounds); > >- if (LayerMap* layerCloneMap = m_layerClones.get()) { >- for (auto& layer : layerCloneMap->values()) >+ if (m_layerClones) { >+ for (auto& layer : m_layerClones->primaryLayerClones.values()) > layer->setMasksToBounds(m_masksToBounds); > } > } >@@ -2057,8 +2063,8 @@ void GraphicsLayerCA::updateContentsVisibility() > } else { > m_layer->setContents(nullptr); > >- if (LayerMap* layerCloneMap = m_layerClones.get()) { >- for (auto& layer : layerCloneMap->values()) >+ if (m_layerClones) { >+ for (auto& layer : m_layerClones->primaryLayerClones.values()) > layer->setContents(nullptr); > } > >@@ -2085,8 +2091,8 @@ void GraphicsLayerCA::updateContentsOpaque(float pageScaleFactor) > > m_layer->setOpaque(contentsOpaque); > >- if (LayerMap* layerCloneMap = m_layerClones.get()) { >- for (auto& layer : layerCloneMap->values()) >+ if (m_layerClones) { >+ for (auto& layer : m_layerClones->primaryLayerClones.values()) > layer->setOpaque(contentsOpaque); > } > } >@@ -2096,16 +2102,16 @@ void GraphicsLayerCA::updateBackfaceVisibility() > if (m_structuralLayer && structuralLayerPurpose() == StructuralLayerForReplicaFlattening) { > m_structuralLayer->setDoubleSided(m_backfaceVisibility); > >- if (LayerMap* layerCloneMap = m_structuralLayerClones.get()) { >- for (auto& layer : layerCloneMap->values()) >+ if (m_layerClones) { >+ for (auto& layer : m_layerClones->structuralLayerClones.values()) > layer->setDoubleSided(m_backfaceVisibility); > } > } > > m_layer->setDoubleSided(m_backfaceVisibility); > >- if (LayerMap* layerCloneMap = m_layerClones.get()) { >- for (auto& layer : layerCloneMap->values()) >+ if (m_layerClones) { >+ for (auto& layer : m_layerClones->primaryLayerClones.values()) > layer->setDoubleSided(m_backfaceVisibility); > } > } >@@ -2114,8 +2120,8 @@ void GraphicsLayerCA::updateFilters() > { > m_layer->setFilters(m_filters); > >- if (LayerMap* layerCloneMap = m_layerClones.get()) { >- for (auto& clone : *layerCloneMap) { >+ if (m_layerClones) { >+ for (auto& clone : m_layerClones->primaryLayerClones) { > if (m_replicaLayer && isReplicatedRootClone(clone.key)) > continue; > >@@ -2146,8 +2152,8 @@ void GraphicsLayerCA::updateBackdropFilters() > m_backdropLayer->setHidden(!m_contentsVisible); > m_backdropLayer->setFilters(m_backdropFilters); > >- if (LayerMap* layerCloneMap = m_backdropLayerClones.get()) { >- for (auto& clone : *layerCloneMap) { >+ if (m_layerClones) { >+ for (auto& clone : m_layerClones->backdropLayerClones) { > PlatformCALayer* cloneLayer = clone.value.get(); > cloneLayer->setHidden(!m_contentsVisible); > cloneLayer->setFilters(m_backdropFilters); >@@ -2169,24 +2175,22 @@ void GraphicsLayerCA::updateBackdropFiltersRect() > > updateClippingStrategy(*m_backdropLayer, m_backdropClippingLayer, m_backdropFiltersRect); > >- if (m_backdropLayerClones) { >- for (auto& clone : *m_backdropLayerClones) { >+ if (m_layerClones) { >+ for (auto& clone : m_layerClones->backdropLayerClones) { > PlatformCALayer* backdropCloneLayer = clone.value.get(); > backdropCloneLayer->setBounds(contentBounds); > backdropCloneLayer->setPosition(m_backdropFiltersRect.rect().location()); > > CloneID cloneID = clone.key; >- RefPtr<PlatformCALayer> backdropClippingLayerClone; >- if (m_backdropClippingLayerClones) >- backdropClippingLayerClone = m_backdropClippingLayerClones->get(cloneID); >+ RefPtr<PlatformCALayer> backdropClippingLayerClone = m_layerClones->backdropLayerClones.get(cloneID); > > bool hadBackdropClippingLayer = backdropClippingLayerClone; > updateClippingStrategy(*backdropCloneLayer, backdropClippingLayerClone, m_backdropFiltersRect); > >- if (!backdropClippingLayerClone && m_backdropClippingLayerClones) >- m_backdropClippingLayerClones->remove(cloneID); >+ if (!backdropClippingLayerClone) >+ m_layerClones->backdropLayerClones.remove(cloneID); > else if (backdropClippingLayerClone && !hadBackdropClippingLayer) >- m_backdropClippingLayerClones->add(cloneID, backdropClippingLayerClone); >+ m_layerClones->backdropLayerClones.add(cloneID, backdropClippingLayerClone); > } > } > } >@@ -2296,13 +2300,11 @@ void GraphicsLayerCA::ensureStructuralLayer(StructuralLayerPurpose purpose) > m_layer->setTransform(TransformationMatrix()); > m_layer->setOpacity(1); > if (m_layerClones) { >- LayerMap::const_iterator end = m_layerClones->end(); >- for (LayerMap::const_iterator it = m_layerClones->begin(); it != end; ++it) { >- PlatformCALayer* currLayer = it->value.get(); >- currLayer->setPosition(point); >- currLayer->setAnchorPoint(anchorPoint); >- currLayer->setTransform(TransformationMatrix()); >- currLayer->setOpacity(1); >+ for (auto& layer : m_layerClones->primaryLayerClones.values()) { >+ layer->setPosition(point); >+ layer->setAnchorPoint(anchorPoint); >+ layer->setTransform(TransformationMatrix()); >+ layer->setOpacity(1); > } > } > >@@ -2329,11 +2331,10 @@ void GraphicsLayerCA::updateDrawsContent() > m_layer->setNeedsDisplay(); > m_hasEverPainted = false; > } else { >- m_layer->setContents(0); >+ m_layer->setContents(nullptr); > if (m_layerClones) { >- LayerMap::const_iterator end = m_layerClones->end(); >- for (LayerMap::const_iterator it = m_layerClones->begin(); it != end; ++it) >- it->value->setContents(0); >+ for (auto& layer : m_layerClones->primaryLayerClones.values()) >+ layer->setContents(nullptr); > } > } > } >@@ -2368,8 +2369,8 @@ void GraphicsLayerCA::updateCoverage(const CommitState& commitState) > > m_layer->setBackingStoreAttached(requiresBacking); > if (m_layerClones) { >- for (auto& it : *m_layerClones) >- it.value->setBackingStoreAttached(requiresBacking); >+ for (auto& layer : m_layerClones->primaryLayerClones.values()) >+ layer->setBackingStoreAttached(requiresBacking); > } > } > >@@ -2421,20 +2422,16 @@ void GraphicsLayerCA::updateDebugIndicators() > setLayerDebugBorder(*m_contentsLayer, contentsLayerDebugBorderColor(showDebugBorders), contentsLayerBorderWidth); > > if (m_layerClones) { >- for (auto& clone : m_layerClones->values()) >- setLayerDebugBorder(*clone, borderColor, width); >- } >+ for (auto& layer : m_layerClones->primaryLayerClones.values()) >+ setLayerDebugBorder(*layer, borderColor, width); > >- if (m_structuralLayerClones) { > Color cloneLayerBorderColor = cloneLayerDebugBorderColor(showDebugBorders); >- for (auto& clone : m_structuralLayerClones->values()) >- setLayerDebugBorder(*clone, cloneLayerBorderColor, cloneLayerBorderWidth); >- } >+ for (auto& layer : m_layerClones->structuralLayerClones.values()) >+ setLayerDebugBorder(*layer, cloneLayerBorderColor, cloneLayerBorderWidth); > >- if (m_contentsLayerClones) { > Color contentsLayerBorderColor = contentsLayerDebugBorderColor(showDebugBorders); >- for (auto& contentsLayerClone : m_contentsLayerClones->values()) >- setLayerDebugBorder(*contentsLayerClone, contentsLayerBorderColor, contentsLayerBorderWidth); >+ for (auto& layer : m_layerClones->contentsLayerClones.values()) >+ setLayerDebugBorder(*layer, contentsLayerBorderColor, contentsLayerBorderWidth); > } > } > >@@ -2535,10 +2532,9 @@ void GraphicsLayerCA::updateContentsImage() > m_contentsLayer->setContents(m_pendingContentsImage.get()); > m_pendingContentsImage = nullptr; > >- if (m_contentsLayerClones) { >- LayerMap::const_iterator end = m_contentsLayerClones->end(); >- for (LayerMap::const_iterator it = m_contentsLayerClones->begin(); it != end; ++it) >- it->value->setContents(m_contentsLayer->contents()); >+ if (m_layerClones) { >+ for (auto& layer : m_layerClones->contentsLayerClones.values()) >+ layer->setContents(m_contentsLayer->contents()); > } > > updateContentsRects(); >@@ -2557,7 +2553,7 @@ void GraphicsLayerCA::updateContentsPlatformLayer() > // Platform layer was set as m_contentsLayer, and will get parented in updateSublayerList(). > setupContentsLayer(m_contentsLayer.get()); > >- if (m_contentsLayerPurpose == ContentsLayerForCanvas) >+ if (m_contentsLayerPurpose == ContentsLayerPurpose::Canvas) > m_contentsLayer->setNeedsDisplay(); > > updateContentsRects(); >@@ -2566,7 +2562,7 @@ void GraphicsLayerCA::updateContentsPlatformLayer() > void GraphicsLayerCA::updateContentsColorLayer() > { > // Color layer was set as m_contentsLayer, and will get parented in updateSublayerList(). >- if (!m_contentsLayer || m_contentsLayerPurpose != ContentsLayerForBackgroundColor) >+ if (!m_contentsLayer || m_contentsLayerPurpose != ContentsLayerPurpose::BackgroundColor) > return; > > setupContentsLayer(m_contentsLayer.get()); >@@ -2574,10 +2570,9 @@ void GraphicsLayerCA::updateContentsColorLayer() > ASSERT(m_contentsSolidColor.isValid()); > m_contentsLayer->setBackgroundColor(m_contentsSolidColor); > >- if (m_contentsLayerClones) { >- LayerMap::const_iterator end = m_contentsLayerClones->end(); >- for (LayerMap::const_iterator it = m_contentsLayerClones->begin(); it != end; ++it) >- it->value->setBackgroundColor(m_contentsSolidColor); >+ if (m_layerClones) { >+ for (auto& layer : m_layerClones->contentsLayerClones.values()) >+ layer->setBackgroundColor(m_contentsSolidColor); > } > } > >@@ -2672,30 +2667,23 @@ void GraphicsLayerCA::updateContentsRects() > m_contentsLayer->setPosition(contentOrigin); > m_contentsLayer->setBounds(contentBounds); > >- if (m_contentsLayerClones) { >- for (auto& layer : m_contentsLayerClones->values()) { >+ if (m_layerClones) { >+ for (auto& layer : m_layerClones->contentsLayerClones.values()) { > layer->setPosition(contentOrigin); > layer->setBounds(contentBounds); > } >- } >- >- if (m_contentsClippingLayerClones) { >- if (!m_contentsShapeMaskLayerClones && m_contentsShapeMaskLayer) >- m_contentsShapeMaskLayerClones = std::make_unique<LayerMap>(); > >- for (auto& clone : *m_contentsClippingLayerClones) { >+ for (auto& clone : m_layerClones->contentsClippingLayerClones) { > CloneID cloneID = clone.key; >- RefPtr<PlatformCALayer> shapeMaskLayerClone; >- if (m_contentsShapeMaskLayerClones) >- shapeMaskLayerClone = m_contentsShapeMaskLayerClones->get(cloneID); >+ RefPtr<PlatformCALayer> shapeMaskLayerClone = m_layerClones->contentsShapeMaskLayerClones.get(cloneID); > > bool hadShapeMask = shapeMaskLayerClone; > updateClippingStrategy(*clone.value, shapeMaskLayerClone, m_contentsClippingRect); > >- if (!shapeMaskLayerClone && m_contentsShapeMaskLayerClones) >- m_contentsShapeMaskLayerClones->remove(cloneID); >+ if (!shapeMaskLayerClone) >+ m_layerClones->contentsShapeMaskLayerClones.remove(cloneID); > else if (shapeMaskLayerClone && !hadShapeMask) >- m_contentsShapeMaskLayerClones->add(cloneID, shapeMaskLayerClone); >+ m_layerClones->contentsShapeMaskLayerClones.add(cloneID, shapeMaskLayerClone); > } > } > } >@@ -2705,19 +2693,17 @@ void GraphicsLayerCA::updateMasksToBoundsRect() > updateClippingStrategy(*m_layer, m_shapeMaskLayer, m_masksToBoundsRect); > > if (m_layerClones) { >- for (auto& clone : *m_layerClones) { >+ for (auto& clone : m_layerClones->primaryLayerClones) { > CloneID cloneID = clone.key; >- RefPtr<PlatformCALayer> shapeMaskLayerClone; >- if (m_shapeMaskLayerClones) >- shapeMaskLayerClone = m_shapeMaskLayerClones->get(cloneID); >+ RefPtr<PlatformCALayer> shapeMaskLayerClone = m_layerClones->shapeMaskLayerClones.get(cloneID); > > bool hadShapeMask = shapeMaskLayerClone; > updateClippingStrategy(*clone.value, shapeMaskLayerClone, m_masksToBoundsRect); > >- if (!shapeMaskLayerClone && m_shapeMaskLayerClones) >- m_shapeMaskLayerClones->remove(cloneID); >- else if (shapeMaskLayerClone && !hadShapeMask) >- m_shapeMaskLayerClones->add(cloneID, shapeMaskLayerClone); >+ if (!shapeMaskLayerClone) >+ m_layerClones->shapeMaskLayerClones.remove(cloneID); >+ else if (!hadShapeMask && shapeMaskLayerClone) >+ m_layerClones->shapeMaskLayerClones.add(cloneID, shapeMaskLayerClone); > } > } > } >@@ -2729,10 +2715,10 @@ void GraphicsLayerCA::updateMaskLayer() > LayerMap* layerCloneMap; > if (m_structuralLayer && structuralLayerPurpose() == StructuralLayerForBackdrop) { > m_structuralLayer->setMask(maskCALayer); >- layerCloneMap = m_structuralLayerClones.get(); >+ layerCloneMap = m_layerClones ? &m_layerClones->structuralLayerClones : nullptr; > } else { > m_layer->setMask(maskCALayer); >- layerCloneMap = m_layerClones.get(); >+ layerCloneMap = m_layerClones ? &m_layerClones->primaryLayerClones : nullptr; > } > > LayerMap* maskLayerCloneMap = m_maskLayer ? downcast<GraphicsLayerCA>(*m_maskLayer).primaryLayerClones() : nullptr; >@@ -2800,34 +2786,36 @@ RefPtr<PlatformCALayer> GraphicsLayerCA::replicatedLayerRoot(ReplicaState& repli > > void GraphicsLayerCA::updateAnimations() > { >+ if (!m_animations) >+ return; >+ > size_t numAnimations; >- if ((numAnimations = m_uncomittedAnimations.size())) { >+ if ((numAnimations = m_animations->uncomittedAnimations.size())) { > for (size_t i = 0; i < numAnimations; ++i) { >- const LayerPropertyAnimation& pendingAnimation = m_uncomittedAnimations[i]; >+ const LayerPropertyAnimation& pendingAnimation = m_animations->uncomittedAnimations[i]; > setAnimationOnLayer(*pendingAnimation.m_animation, pendingAnimation.m_property, pendingAnimation.m_name, pendingAnimation.m_index, pendingAnimation.m_subIndex, pendingAnimation.m_timeOffset); > >- AnimationsMap::iterator it = m_runningAnimations.find(pendingAnimation.m_name); >- if (it == m_runningAnimations.end()) { >+ AnimationsMap::iterator it = m_animations->runningAnimations.find(pendingAnimation.m_name); >+ if (it == m_animations->runningAnimations.end()) { > Vector<LayerPropertyAnimation> animations; > animations.append(pendingAnimation); >- m_runningAnimations.add(pendingAnimation.m_name, animations); >+ m_animations->runningAnimations.add(pendingAnimation.m_name, animations); > } else { > Vector<LayerPropertyAnimation>& animations = it->value; > animations.append(pendingAnimation); > } > } >- m_uncomittedAnimations.clear(); >+ m_animations->uncomittedAnimations.clear(); > } > >- if (m_animationsToProcess.size()) { >- AnimationsToProcessMap::const_iterator end = m_animationsToProcess.end(); >- for (AnimationsToProcessMap::const_iterator it = m_animationsToProcess.begin(); it != end; ++it) { >- const String& currentAnimationName = it->key; >- auto animationIterator = m_runningAnimations.find(currentAnimationName); >- if (animationIterator == m_runningAnimations.end()) >+ if (m_animations->animationsToProcess.size()) { >+ for (auto it : m_animations->animationsToProcess) { >+ const String& currentAnimationName = it.key; >+ auto animationIterator = m_animations->runningAnimations.find(currentAnimationName); >+ if (animationIterator == m_animations->runningAnimations.end()) > continue; > >- for (const auto& processingInfo : it->value) { >+ for (const auto& processingInfo : it.value) { > const Vector<LayerPropertyAnimation>& animations = animationIterator->value; > for (const auto& currentAnimation : animations) { > switch (processingInfo.action) { >@@ -2844,20 +2832,21 @@ void GraphicsLayerCA::updateAnimations() > } > > if (processingInfo.action == Remove) >- m_runningAnimations.remove(currentAnimationName); >+ m_animations->runningAnimations.remove(currentAnimationName); > } >- > } > >- m_animationsToProcess.clear(); >+ m_animations->animationsToProcess.clear(); > } > } > > bool GraphicsLayerCA::isRunningTransformAnimation() const > { >- AnimationsMap::const_iterator end = m_runningAnimations.end(); >- for (AnimationsMap::const_iterator it = m_runningAnimations.begin(); it != end; ++it) { >- const Vector<LayerPropertyAnimation>& propertyAnimations = it->value; >+ if (!m_animations) >+ return false; >+ >+ for (auto it : m_animations->runningAnimations) { >+ const auto& propertyAnimations = it.value; > size_t numAnimations = propertyAnimations.size(); > for (size_t i = 0; i < numAnimations; ++i) { > const LayerPropertyAnimation& currAnimation = propertyAnimations[i]; >@@ -2868,6 +2857,12 @@ bool GraphicsLayerCA::isRunningTransformAnimation() const > return false; > } > >+void GraphicsLayerCA::ensureLayerAnimations() >+{ >+ if (!m_animations) >+ m_animations = std::make_unique<LayerAnimations>(); >+} >+ > void GraphicsLayerCA::setAnimationOnLayer(PlatformCAAnimation& caAnim, AnimatedPropertyID property, const String& animationName, int index, int subIndex, Seconds timeOffset) > { > PlatformCALayer* layer = animatedLayer(property); >@@ -3132,11 +3127,13 @@ bool GraphicsLayerCA::appendToUncommittedAnimations(const KeyframeValueList& val > > void GraphicsLayerCA::appendToUncommittedAnimations(LayerPropertyAnimation&& animation) > { >+ ensureLayerAnimations(); >+ > // Since we're adding a new animation, make sure we clear any pending AnimationProcessingAction for this animation > // as these are applied after we've committed new animations. >- m_animationsToProcess.remove(animation.m_name); >+ m_animations->animationsToProcess.remove(animation.m_name); > >- m_uncomittedAnimations.append(WTFMove(animation)); >+ m_animations->uncomittedAnimations.append(WTFMove(animation)); > } > > bool GraphicsLayerCA::createFilterAnimationsFromKeyframes(const KeyframeValueList& valueList, const Animation* animation, const String& animationName, Seconds timeOffset) >@@ -3553,9 +3550,20 @@ PlatformCALayer* GraphicsLayerCA::animatedLayer(AnimatedPropertyID property) con > } > } > >+GraphicsLayerCA::LayerMap* GraphicsLayerCA::primaryLayerClones() const >+{ >+ if (!m_layerClones) >+ return nullptr; >+ >+ return m_structuralLayer ? &m_layerClones->structuralLayerClones : &m_layerClones->primaryLayerClones; >+} >+ > GraphicsLayerCA::LayerMap* GraphicsLayerCA::animatedLayerClones(AnimatedPropertyID property) const > { >- return (property == AnimatedPropertyBackgroundColor) ? m_contentsLayerClones.get() : primaryLayerClones(); >+ if (!m_layerClones) >+ return nullptr; >+ >+ return (property == AnimatedPropertyBackgroundColor) ? &m_layerClones->contentsLayerClones : primaryLayerClones(); > } > > void GraphicsLayerCA::updateContentsScale(float pageScaleFactor) >@@ -3572,7 +3580,7 @@ void GraphicsLayerCA::updateContentsScale(float pageScaleFactor) > > m_layer->setContentsScale(contentsScale); > >- if (m_contentsLayer && m_contentsLayerPurpose == ContentsLayerForMedia) >+ if (m_contentsLayer && m_contentsLayerPurpose == ContentsLayerPurpose::Media) > m_contentsLayer->setContentsScale(contentsScale); > > if (tiledBacking()) { >@@ -3816,7 +3824,7 @@ void GraphicsLayerCA::changeLayerTypeTo(PlatformCALayer::LayerType newLayerType) > > GraphicsLayer::CompositingCoordinatesOrientation GraphicsLayerCA::defaultContentsOrientation() const > { >- return CompositingCoordinatesTopDown; >+ return CompositingCoordinatesOrientation::TopDown; > } > > void GraphicsLayerCA::setupContentsLayer(PlatformCALayer* contentsLayer) >@@ -3826,7 +3834,7 @@ void GraphicsLayerCA::setupContentsLayer(PlatformCALayer* contentsLayer) > contentsLayer->setMasksToBounds(true); > #endif > >- if (defaultContentsOrientation() == CompositingCoordinatesBottomUp) { >+ if (defaultContentsOrientation() == CompositingCoordinatesOrientation::BottomUp) { > TransformationMatrix flipper( > 1.0f, 0.0f, 0.0f, 0.0f, > 0.0f, -1.0f, 0.0f, 0.0f, >@@ -3840,7 +3848,7 @@ void GraphicsLayerCA::setupContentsLayer(PlatformCALayer* contentsLayer) > setLayerDebugBorder(*contentsLayer, contentsLayerDebugBorderColor(isShowingDebugBorder()), contentsLayerBorderWidth); > } > >-RefPtr<PlatformCALayer> GraphicsLayerCA::findOrMakeClone(CloneID cloneID, PlatformCALayer *sourceLayer, LayerMap* clones, CloneLevel cloneLevel) >+RefPtr<PlatformCALayer> GraphicsLayerCA::findOrMakeClone(CloneID cloneID, PlatformCALayer *sourceLayer, LayerMap& clones, CloneLevel cloneLevel) > { > if (!sourceLayer) > return nullptr; >@@ -3850,7 +3858,7 @@ RefPtr<PlatformCALayer> GraphicsLayerCA::findOrMakeClone(CloneID cloneID, Platfo > // Add with a dummy value to get an iterator for the insertion position, and a boolean that tells > // us whether there's an item there. This technique avoids two hash lookups. > RefPtr<PlatformCALayer> dummy; >- LayerMap::AddResult addResult = clones->add(cloneID, dummy); >+ LayerMap::AddResult addResult = clones.add(cloneID, dummy); > if (!addResult.isNewEntry) { > // Value was not added, so it exists already. > resultLayer = addResult.iterator->value.get(); >@@ -3874,60 +3882,39 @@ void GraphicsLayerCA::ensureCloneLayers(CloneID cloneID, RefPtr<PlatformCALayer> > contentsLayer = nullptr; > > if (!m_layerClones) >- m_layerClones = std::make_unique<LayerMap>(); >- >- if (!m_structuralLayerClones && m_structuralLayer) >- m_structuralLayerClones = std::make_unique<LayerMap>(); >- >- if (!m_contentsLayerClones && m_contentsLayer) >- m_contentsLayerClones = std::make_unique<LayerMap>(); >- >- if (!m_contentsClippingLayerClones && m_contentsClippingLayer) >- m_contentsClippingLayerClones = std::make_unique<LayerMap>(); >- >- if (!m_contentsShapeMaskLayerClones && m_contentsShapeMaskLayer) >- m_contentsShapeMaskLayerClones = std::make_unique<LayerMap>(); >- >- if (!m_shapeMaskLayerClones && m_shapeMaskLayer) >- m_shapeMaskLayerClones = std::make_unique<LayerMap>(); >- >- if (!m_backdropLayerClones && m_backdropLayer) >- m_backdropLayerClones = std::make_unique<LayerMap>(); >+ m_layerClones = std::make_unique<LayerClones>(); > >- if (!m_backdropClippingLayerClones && m_backdropClippingLayer) >- m_backdropClippingLayerClones = std::make_unique<LayerMap>(); >- >- primaryLayer = findOrMakeClone(cloneID, m_layer.get(), m_layerClones.get(), cloneLevel); >- structuralLayer = findOrMakeClone(cloneID, m_structuralLayer.get(), m_structuralLayerClones.get(), cloneLevel); >- contentsLayer = findOrMakeClone(cloneID, m_contentsLayer.get(), m_contentsLayerClones.get(), cloneLevel); >- contentsClippingLayer = findOrMakeClone(cloneID, m_contentsClippingLayer.get(), m_contentsClippingLayerClones.get(), cloneLevel); >- contentsShapeMaskLayer = findOrMakeClone(cloneID, m_contentsShapeMaskLayer.get(), m_contentsShapeMaskLayerClones.get(), cloneLevel); >- shapeMaskLayer = findOrMakeClone(cloneID, m_shapeMaskLayer.get(), m_shapeMaskLayerClones.get(), cloneLevel); >- backdropLayer = findOrMakeClone(cloneID, m_backdropLayer.get(), m_backdropLayerClones.get(), cloneLevel); >- backdropClippingLayer = findOrMakeClone(cloneID, m_backdropClippingLayer.get(), m_backdropClippingLayerClones.get(), cloneLevel); >+ primaryLayer = findOrMakeClone(cloneID, m_layer.get(), m_layerClones->primaryLayerClones, cloneLevel); >+ structuralLayer = findOrMakeClone(cloneID, m_structuralLayer.get(), m_layerClones->structuralLayerClones, cloneLevel); >+ contentsLayer = findOrMakeClone(cloneID, m_contentsLayer.get(), m_layerClones->contentsLayerClones, cloneLevel); >+ contentsClippingLayer = findOrMakeClone(cloneID, m_contentsClippingLayer.get(), m_layerClones->contentsClippingLayerClones, cloneLevel); >+ contentsShapeMaskLayer = findOrMakeClone(cloneID, m_contentsShapeMaskLayer.get(), m_layerClones->contentsShapeMaskLayerClones, cloneLevel); >+ shapeMaskLayer = findOrMakeClone(cloneID, m_shapeMaskLayer.get(), m_layerClones->shapeMaskLayerClones, cloneLevel); >+ backdropLayer = findOrMakeClone(cloneID, m_backdropLayer.get(), m_layerClones->backdropLayerClones, cloneLevel); >+ backdropClippingLayer = findOrMakeClone(cloneID, m_backdropClippingLayer.get(), m_layerClones->backdropClippingLayerClones, cloneLevel); > } > >-void GraphicsLayerCA::clearClones(std::unique_ptr<LayerMap>& layerMap) >+void GraphicsLayerCA::clearClones(LayerMap& layerMap) > { >- if (!layerMap) >- return; >- >- for (auto& layer : layerMap->values()) >+ for (auto& layer : layerMap.values()) > layer->setOwner(nullptr); >- >- layerMap = nullptr; > } > > void GraphicsLayerCA::removeCloneLayers() > { >- clearClones(m_layerClones); >- clearClones(m_structuralLayerClones); >- clearClones(m_contentsLayerClones); >- clearClones(m_contentsClippingLayerClones); >- clearClones(m_contentsShapeMaskLayerClones); >- clearClones(m_shapeMaskLayerClones); >- clearClones(m_backdropLayerClones); >- clearClones(m_backdropClippingLayerClones); >+ if (!m_layerClones) >+ return; >+ >+ clearClones(m_layerClones->primaryLayerClones); >+ clearClones(m_layerClones->structuralLayerClones); >+ clearClones(m_layerClones->contentsLayerClones); >+ clearClones(m_layerClones->contentsClippingLayerClones); >+ clearClones(m_layerClones->contentsShapeMaskLayerClones); >+ clearClones(m_layerClones->shapeMaskLayerClones); >+ clearClones(m_layerClones->backdropLayerClones); >+ clearClones(m_layerClones->backdropClippingLayerClones); >+ >+ m_layerClones = nullptr; > } > > FloatPoint GraphicsLayerCA::positionForCloneRootLayer() const >@@ -4087,7 +4074,7 @@ void GraphicsLayerCA::setOpacityInternal(float accumulatedOpacity) > > if (preserves3D()) { > m_layer->setOpacity(accumulatedOpacity); >- layerCloneMap = m_layerClones.get(); >+ layerCloneMap = m_layerClones ? &m_layerClones->primaryLayerClones : nullptr; > } else { > primaryLayer()->setOpacity(accumulatedOpacity); > layerCloneMap = primaryLayerClones(); >diff --git a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h >index 296da67eb972ba08f6ca9f325a7595b0ffe8653b..5a180499134136af7818651e76445c9c4b842716 100644 >--- a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h >+++ b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h >@@ -140,7 +140,7 @@ public: > WEBCORE_EXPORT void setContentsToPlatformLayer(PlatformLayer*, ContentsLayerPurpose) override; > WEBCORE_EXPORT void setContentsToSolidColor(const Color&) override; > >- bool usesContentsLayer() const override { return m_contentsLayerPurpose != NoContentsLayer; } >+ bool usesContentsLayer() const override { return m_contentsLayerPurpose != ContentsLayerPurpose::None; } > > WEBCORE_EXPORT void setShowDebugBorder(bool) override; > WEBCORE_EXPORT void setShowRepaintCounter(bool) override; >@@ -237,8 +237,9 @@ private: > static bool isReplicatedRootClone(const CloneID& cloneID) { return cloneID[0U] & 1; } > > typedef HashMap<CloneID, RefPtr<PlatformCALayer>> LayerMap; >- LayerMap* primaryLayerClones() const { return m_structuralLayer.get() ? m_structuralLayerClones.get() : m_layerClones.get(); } >+ LayerMap* primaryLayerClones() const; > LayerMap* animatedLayerClones(AnimatedPropertyID) const; >+ static void clearClones(LayerMap&); > > bool createAnimationFromKeyframes(const KeyframeValueList&, const Animation*, const String& animationName, Seconds timeOffset); > bool createTransformAnimationsFromKeyframes(const KeyframeValueList&, const Animation*, const String& animationName, Seconds timeOffset, const FloatSize& boxSize); >@@ -268,7 +269,7 @@ private: > > bool animationIsRunning(const String& animationName) const > { >- return m_runningAnimations.find(animationName) != m_runningAnimations.end(); >+ return m_animations && m_animations->runningAnimations.contains(animationName); > } > > void commitLayerChangesBeforeSublayers(CommitState&, float pageScaleFactor, const FloatPoint& positionRelativeToBase); >@@ -375,15 +376,13 @@ private: > RefPtr<PlatformCALayer> fetchCloneLayers(GraphicsLayer* replicaRoot, ReplicaState&, CloneLevel); > > Ref<PlatformCALayer> cloneLayer(PlatformCALayer *, CloneLevel); >- RefPtr<PlatformCALayer> findOrMakeClone(CloneID, PlatformCALayer *, LayerMap*, CloneLevel); >+ RefPtr<PlatformCALayer> findOrMakeClone(CloneID, PlatformCALayer *, LayerMap&, CloneLevel); > > void ensureCloneLayers(CloneID, RefPtr<PlatformCALayer>& primaryLayer, RefPtr<PlatformCALayer>& structuralLayer, > RefPtr<PlatformCALayer>& contentsLayer, RefPtr<PlatformCALayer>& contentsClippingLayer, RefPtr<PlatformCALayer>& contentsShapeMaskLayer, > RefPtr<PlatformCALayer>& shapeMaskLayer, RefPtr<PlatformCALayer>& backdropLayer, RefPtr<PlatformCALayer>& backdropClippingLayer, > CloneLevel); > >- static void clearClones(std::unique_ptr<LayerMap>&); >- > bool hasCloneLayers() const { return !!m_layerClones; } > void removeCloneLayers(); > FloatPoint positionForCloneRootLayer() const; >@@ -441,6 +440,8 @@ private: > }; > void ensureStructuralLayer(StructuralLayerPurpose); > StructuralLayerPurpose structuralLayerPurpose() const; >+ >+ void ensureLayerAnimations(); > > void setAnimationOnLayer(PlatformCAAnimation&, AnimatedPropertyID, const String& animationName, int index, int subIndex, Seconds timeOffset); > bool removeCAAnimationFromLayer(AnimatedPropertyID, const String& animationName, int index, int subINdex); >@@ -554,6 +555,13 @@ private: > }; > void addProcessingActionForAnimation(const String&, AnimationProcessingAction); > >+#if PLATFORM(WIN) >+ // FIXME: when initializing m_uncommittedChanges to a non-zero value, nothing is painted on Windows, see https://bugs.webkit.org/show_bug.cgi?id=168666. >+ LayerChangeFlags m_uncommittedChanges { 0 }; >+#else >+ LayerChangeFlags m_uncommittedChanges { CoverageRectChanged }; >+#endif >+ > RefPtr<PlatformCALayer> m_layer; // The main layer > RefPtr<PlatformCALayer> m_structuralLayer; // A layer used for structural reasons, like preserves-3d or replica-flattening. Is the parent of m_layer. > RefPtr<PlatformCALayer> m_contentsClippingLayer; // A layer used to clip inner content >@@ -564,62 +572,57 @@ private: > RefPtr<PlatformCALayer> m_backdropLayer; // The layer used for backdrop rendering, if necessary. > > // References to clones of our layers, for replicated layers. >- std::unique_ptr<LayerMap> m_layerClones; >- std::unique_ptr<LayerMap> m_structuralLayerClones; >- std::unique_ptr<LayerMap> m_contentsLayerClones; >- std::unique_ptr<LayerMap> m_contentsClippingLayerClones; >- std::unique_ptr<LayerMap> m_contentsShapeMaskLayerClones; >- std::unique_ptr<LayerMap> m_shapeMaskLayerClones; >- std::unique_ptr<LayerMap> m_backdropLayerClones; >- std::unique_ptr<LayerMap> m_backdropClippingLayerClones; >+ struct LayerClones { >+ LayerMap primaryLayerClones; >+ LayerMap structuralLayerClones; >+ LayerMap contentsLayerClones; >+ LayerMap contentsClippingLayerClones; >+ LayerMap contentsShapeMaskLayerClones; >+ LayerMap shapeMaskLayerClones; >+ LayerMap backdropLayerClones; >+ LayerMap backdropClippingLayerClones; >+ }; >+ >+ std::unique_ptr<LayerClones> m_layerClones; > > #ifdef VISIBLE_TILE_WASH > RefPtr<PlatformCALayer> m_visibleTileWashLayer; > #endif > FloatRect m_visibleRect; >- FloatSize m_sizeAtLastCoverageRectUpdate; >- >+ FloatRect m_previousCommittedVisibleRect; > FloatRect m_coverageRect; // Area for which we should maintain backing store, in the coordinate space of this layer. >- >- ContentsLayerPurpose m_contentsLayerPurpose { NoContentsLayer }; >- bool m_needsFullRepaint { false }; >- bool m_usingBackdropLayerType { false }; >- bool m_isViewportConstrained { false }; >- bool m_intersectsCoverageRect { false }; >- bool m_hasEverPainted { false }; >- bool m_hasDescendantsWithRunningTransformAnimations { false }; >+ FloatSize m_sizeAtLastCoverageRectUpdate; >+ FloatSize m_pixelAlignmentOffset; > > Color m_contentsSolidColor; > > RetainPtr<CGImageRef> m_uncorrectedContentsImage; > RetainPtr<CGImageRef> m_pendingContentsImage; > >- // Uncommitted transitions and animations. >- Vector<LayerPropertyAnimation> m_uncomittedAnimations; >- > typedef HashMap<String, Vector<AnimationProcessingAction>> AnimationsToProcessMap; >- AnimationsToProcessMap m_animationsToProcess; >- >- // Map of animation names to their associated lists of property animations, so we can remove/pause them. > typedef HashMap<String, Vector<LayerPropertyAnimation>> AnimationsMap; >- AnimationsMap m_runningAnimations; >+ struct LayerAnimations { >+ Vector<LayerPropertyAnimation> uncomittedAnimations; >+ AnimationsToProcessMap animationsToProcess; >+ AnimationsMap runningAnimations; >+ }; >+ >+ std::unique_ptr<LayerAnimations> m_animations; > > Vector<FloatRect> m_dirtyRects; > > std::unique_ptr<DisplayList::DisplayList> m_displayList; > >- FloatSize m_pixelAlignmentOffset; >- >-#if PLATFORM(WIN) >- // FIXME: when initializing m_uncommittedChanges to a non-zero value, nothing is painted on Windows, see https://bugs.webkit.org/show_bug.cgi?id=168666. >- LayerChangeFlags m_uncommittedChanges { 0 }; >-#else >- LayerChangeFlags m_uncommittedChanges { CoverageRectChanged }; >-#endif >- bool m_hasDescendantsWithUncommittedChanges { false }; >- >+ ContentsLayerPurpose m_contentsLayerPurpose { ContentsLayerPurpose::None }; > bool m_isCommittingChanges { false }; >- FloatRect m_previousCommittedVisibleRect; >+ >+ bool m_needsFullRepaint : 1; >+ bool m_usingBackdropLayerType : 1; >+ bool m_isViewportConstrained : 1; >+ bool m_intersectsCoverageRect : 1; >+ bool m_hasEverPainted : 1; >+ bool m_hasDescendantsWithRunningTransformAnimations : 1; >+ bool m_hasDescendantsWithUncommittedChanges : 1; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h b/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h >index 1f9b7c0687d1003c57a8619f4e2f137caa687836..6778de719c50e1a45fc8246d73a908abfbad1306 100644 >--- a/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h >+++ b/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h >@@ -42,7 +42,7 @@ public: > > virtual void platformCALayerAnimationStarted(const String& /*animationKey*/, MonotonicTime) { } > virtual void platformCALayerAnimationEnded(const String& /*animationKey*/) { } >- virtual GraphicsLayer::CompositingCoordinatesOrientation platformCALayerContentsOrientation() const { return GraphicsLayer::CompositingCoordinatesTopDown; } >+ virtual GraphicsLayer::CompositingCoordinatesOrientation platformCALayerContentsOrientation() const { return GraphicsLayer::CompositingCoordinatesOrientation::TopDown; } > virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect& inClip, GraphicsLayerPaintBehavior) = 0; > virtual bool platformCALayerShowDebugBorders() const { return false; } > virtual bool platformCALayerShowRepaintCounter(PlatformCALayer*) const { return false; } >diff --git a/Source/WebCore/platform/graphics/ca/TileCoverageMap.h b/Source/WebCore/platform/graphics/ca/TileCoverageMap.h >index 360b23196d84215298e6ee5e4d7c563a90c2f957..affbff0e0b939089290208aa77af51fb8f021df6 100644 >--- a/Source/WebCore/platform/graphics/ca/TileCoverageMap.h >+++ b/Source/WebCore/platform/graphics/ca/TileCoverageMap.h >@@ -58,7 +58,7 @@ public: > > private: > // PlatformCALayerClient >- GraphicsLayer::CompositingCoordinatesOrientation platformCALayerContentsOrientation() const override { return GraphicsLayer::CompositingCoordinatesTopDown; } >+ GraphicsLayer::CompositingCoordinatesOrientation platformCALayerContentsOrientation() const override { return GraphicsLayer::CompositingCoordinatesOrientation::TopDown; } > bool platformCALayerContentsOpaque() const override { return true; } > bool platformCALayerDrawsContent() const override { return true; } > void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect&, GraphicsLayerPaintBehavior) override; >diff --git a/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h b/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h >index 13446cddb332517f8b18c57b3cc9260e34b875cc..f9c7e8c442053e0c5b1d38a423530b3b5231fa14 100644 >--- a/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h >+++ b/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h >@@ -194,7 +194,7 @@ private: > > RetainPtr<NSObject> m_delegate; > std::unique_ptr<PlatformCALayerList> m_customSublayers; >- GraphicsLayer::CustomAppearance m_customAppearance; >+ GraphicsLayer::CustomAppearance m_customAppearance { GraphicsLayer::CustomAppearance::None }; > std::unique_ptr<FloatRoundedRect> m_shapeRoundedRect; > bool m_wantsDeepColorBackingStore { false }; > bool m_supportsSubpixelAntialiasedText { false }; >diff --git a/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm b/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm >index e4eed9ae195f1070b43308f2b6e8753237aa916f..df04103c71a98964e9f29fe1981b362158a6bd99 100644 >--- a/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm >+++ b/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm >@@ -207,7 +207,6 @@ PlatformCALayer::LayerType PlatformCALayerCocoa::layerTypeForPlatformLayer(Platf > > PlatformCALayerCocoa::PlatformCALayerCocoa(LayerType layerType, PlatformCALayerClient* owner) > : PlatformCALayer(layerType, owner) >- , m_customAppearance(GraphicsLayer::NoCustomAppearance) > { > Class layerClass = Nil; > switch (layerType) { >@@ -278,7 +277,6 @@ PlatformCALayerCocoa::PlatformCALayerCocoa(LayerType layerType, PlatformCALayerC > > PlatformCALayerCocoa::PlatformCALayerCocoa(PlatformLayer* layer, PlatformCALayerClient* owner) > : PlatformCALayer(layerTypeForPlatformLayer(layer), owner) >- , m_customAppearance(GraphicsLayer::NoCustomAppearance) > { > m_layer = layer; > commonInit(); >@@ -992,7 +990,7 @@ void PlatformCALayerCocoa::setShapePath(const Path& path) > > bool PlatformCALayerCocoa::requiresCustomAppearanceUpdateOnBoundsChange() const > { >- return m_customAppearance == GraphicsLayer::ScrollingShadow; >+ return m_customAppearance == GraphicsLayer::CustomAppearance::ScrollingShadow; > } > > void PlatformCALayerCocoa::updateCustomAppearance(GraphicsLayer::CustomAppearance appearance) >@@ -1004,16 +1002,16 @@ void PlatformCALayerCocoa::updateCustomAppearance(GraphicsLayer::CustomAppearanc > > #if ENABLE(RUBBER_BANDING) > switch (appearance) { >- case GraphicsLayer::NoCustomAppearance: >- case GraphicsLayer::LightBackdropAppearance: >- case GraphicsLayer::DarkBackdropAppearance: >+ case GraphicsLayer::CustomAppearance::None: >+ case GraphicsLayer::CustomAppearance::LightBackdrop: >+ case GraphicsLayer::CustomAppearance::DarkBackdrop: > ScrollbarThemeMac::removeOverhangAreaBackground(platformLayer()); > ScrollbarThemeMac::removeOverhangAreaShadow(platformLayer()); > break; >- case GraphicsLayer::ScrollingOverhang: >+ case GraphicsLayer::CustomAppearance::ScrollingOverhang: > ScrollbarThemeMac::setUpOverhangAreaBackground(platformLayer()); > break; >- case GraphicsLayer::ScrollingShadow: >+ case GraphicsLayer::CustomAppearance::ScrollingShadow: > ScrollbarThemeMac::setUpOverhangAreaShadow(platformLayer()); > break; > } >@@ -1141,8 +1139,8 @@ void PlatformCALayer::drawLayerContents(CGContextRef context, WebCore::PlatformC > > CGContextSaveGState(context); > >- // We never use CompositingCoordinatesBottomUp on Mac. >- ASSERT(layerContents->platformCALayerContentsOrientation() == GraphicsLayer::CompositingCoordinatesTopDown); >+ // We never use CompositingCoordinatesOrientation::BottomUp on Mac. >+ ASSERT(layerContents->platformCALayerContentsOrientation() == GraphicsLayer::CompositingCoordinatesOrientation::TopDown); > > #if PLATFORM(IOS) > FontAntialiasingStateSaver fontAntialiasingState(context, [platformCALayer->platformLayer() isOpaque]); >diff --git a/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp b/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp >index a5d5a2a3927cc5911215e7166783090204c669c2..ae2b06a4f4c8c74285cbf5f9dbf83247a9c7afd2 100644 >--- a/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp >+++ b/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp >@@ -161,11 +161,11 @@ void PlatformCALayerWinInternal::setNeedsDisplayInRect(const FloatRect& dirtyRec > // We assume a maximum of 4 digits and a font size of 18. > repaintCounterRect.setWidth(80); > repaintCounterRect.setHeight(22); >- if (owner()->owner()->platformCALayerContentsOrientation() == WebCore::GraphicsLayer::CompositingCoordinatesTopDown) >+ if (owner()->owner()->platformCALayerContentsOrientation() == WebCore::GraphicsLayer::CompositingCoordinatesOrientation::TopDown) > repaintCounterRect.setY(layerBounds.height() - (layerBounds.y() + repaintCounterRect.height())); > internalSetNeedsDisplay(&repaintCounterRect); > } >- if (owner()->owner()->platformCALayerContentsOrientation() == WebCore::GraphicsLayer::CompositingCoordinatesTopDown) { >+ if (owner()->owner()->platformCALayerContentsOrientation() == WebCore::GraphicsLayer::CompositingCoordinatesOrientation::TopDown) { > FloatRect flippedDirtyRect = dirtyRect; > flippedDirtyRect.setY(owner()->bounds().height() - (flippedDirtyRect.y() + flippedDirtyRect.height())); > internalSetNeedsDisplay(&flippedDirtyRect); >diff --git a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp b/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp >index 23f07cbec96c550adcce33d6429aa3bf31a20563..0cec0c5b3f67fa7fd870e1ed78c5e54d49252610 100644 >--- a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp >+++ b/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp >@@ -302,7 +302,7 @@ void GraphicsLayerTextureMapper::setContentsToImage(Image* image) > m_compositedImage = nullptr; > } > >- setContentsToPlatformLayer(m_compositedImage.get(), ContentsLayerForImage); >+ setContentsToPlatformLayer(m_compositedImage.get(), ContentsLayerPurpose::Image); > notifyChange(ContentChange); > GraphicsLayer::setContentsToImage(image); > } >diff --git a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h b/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h >index c81cb73ffee0260b5f6a58dcdbd03b42b137aa42..3fda5f182ff838b98b80539347c0dde901349422 100644 >--- a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h >+++ b/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h >@@ -96,7 +96,7 @@ private: > bool isGraphicsLayerTextureMapper() const override { return true; } > > // TextureMapperPlatformLayer::Client >- void platformLayerWillBeDestroyed() override { setContentsToPlatformLayer(0, NoContentsLayer); } >+ void platformLayerWillBeDestroyed() override { setContentsToPlatformLayer(0, ContentsLayerPurpose::None); } > void setPlatformLayerNeedsDisplay() override { setContentsNeedsDisplay(); } > > void commitLayerChanges(); >diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp >index 91b72045eca715ee4cc950b618968c25a8fc582a..f92a20cc8822e676bad44b13734ae8b0a63fa747 100644 >--- a/Source/WebCore/rendering/RenderLayerBacking.cpp >+++ b/Source/WebCore/rendering/RenderLayerBacking.cpp >@@ -550,11 +550,11 @@ void RenderLayerBacking::updateCustomAppearance(const RenderStyle& style) > { > ControlPart appearance = style.appearance(); > if (appearance == MediaControlsLightBarBackgroundPart) >- m_graphicsLayer->setCustomAppearance(GraphicsLayer::LightBackdropAppearance); >+ m_graphicsLayer->setCustomAppearance(GraphicsLayer::CustomAppearance::LightBackdrop); > else if (appearance == MediaControlsDarkBarBackgroundPart) >- m_graphicsLayer->setCustomAppearance(GraphicsLayer::DarkBackdropAppearance); >+ m_graphicsLayer->setCustomAppearance(GraphicsLayer::CustomAppearance::DarkBackdrop); > else >- m_graphicsLayer->setCustomAppearance(GraphicsLayer::NoCustomAppearance); >+ m_graphicsLayer->setCustomAppearance(GraphicsLayer::CustomAppearance::None); > } > > static bool layerOrAncestorIsTransformedOrUsingCompositedScrolling(RenderLayer& layer) >@@ -745,13 +745,13 @@ bool RenderLayerBacking::updateConfiguration() > } > #else > if (!pluginViewBase->shouldNotAddLayer()) >- m_graphicsLayer->setContentsToPlatformLayer(pluginViewBase->platformLayer(), GraphicsLayer::ContentsLayerForPlugin); >+ m_graphicsLayer->setContentsToPlatformLayer(pluginViewBase->platformLayer(), GraphicsLayer::ContentsLayerPurpose::Plugin); > #endif > } > #if ENABLE(VIDEO) > else if (is<RenderVideo>(renderer()) && downcast<RenderVideo>(renderer()).shouldDisplayVideo()) { > auto* mediaElement = downcast<HTMLMediaElement>(renderer().element()); >- m_graphicsLayer->setContentsToPlatformLayer(mediaElement->platformLayer(), GraphicsLayer::ContentsLayerForMedia); >+ m_graphicsLayer->setContentsToPlatformLayer(mediaElement->platformLayer(), GraphicsLayer::ContentsLayerPurpose::Media); > resetContentsRect(); > } > #endif >@@ -759,7 +759,7 @@ bool RenderLayerBacking::updateConfiguration() > else if (renderer().isCanvas() && canvasCompositingStrategy(renderer()) == CanvasAsLayerContents) { > const HTMLCanvasElement* canvas = downcast<HTMLCanvasElement>(renderer().element()); > if (auto* context = canvas->renderingContext()) >- m_graphicsLayer->setContentsToPlatformLayer(context->platformLayer(), GraphicsLayer::ContentsLayerForCanvas); >+ m_graphicsLayer->setContentsToPlatformLayer(context->platformLayer(), GraphicsLayer::ContentsLayerPurpose::Canvas); > layerConfigChanged = true; > } > #endif >diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp >index b58fc1365f7b7ae5e0df6ca0ce8fa9c47b473594..7ec1ca4e2bbe7616af4b3bd91eaf7d6b86fd395c 100644 >--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp >+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp >@@ -3224,7 +3224,7 @@ void RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged() > m_layerForOverhangAreas->setBackgroundColor(m_rootExtendedBackgroundColor); > > if (!m_rootExtendedBackgroundColor.isValid()) >- m_layerForOverhangAreas->setCustomAppearance(GraphicsLayer::ScrollingOverhang); >+ m_layerForOverhangAreas->setCustomAppearance(GraphicsLayer::CustomAppearance::ScrollingOverhang); > #endif > } > >@@ -3251,7 +3251,7 @@ void RenderLayerCompositor::updateOverflowControlsLayers() > if (m_renderView.settings().backgroundShouldExtendBeyondPage()) > m_layerForOverhangAreas->setBackgroundColor(m_renderView.frameView().documentBackgroundColor()); > else >- m_layerForOverhangAreas->setCustomAppearance(GraphicsLayer::ScrollingOverhang); >+ m_layerForOverhangAreas->setCustomAppearance(GraphicsLayer::CustomAppearance::ScrollingOverhang); > > // We want the overhang areas layer to be positioned below the frame contents, > // so insert it below the clip layer. >@@ -3269,7 +3269,7 @@ void RenderLayerCompositor::updateOverflowControlsLayers() > m_contentShadowLayer->setSize(m_rootContentLayer->size()); > m_contentShadowLayer->setPosition(m_rootContentLayer->position()); > m_contentShadowLayer->setAnchorPoint(FloatPoint3D()); >- m_contentShadowLayer->setCustomAppearance(GraphicsLayer::ScrollingShadow); >+ m_contentShadowLayer->setCustomAppearance(GraphicsLayer::CustomAppearance::ScrollingShadow); > > m_scrollLayer->addChildBelow(m_contentShadowLayer.get(), m_rootContentLayer.get()); > } >diff --git a/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm b/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm >index dd87993a672f18a32f1e948ce247f34454e90a97..87ad10e30711dd9f535ba5cb8ec0b5c284952dc5 100644 >--- a/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm >+++ b/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm >@@ -108,16 +108,16 @@ static void updateCustomAppearance(CALayer *layer, GraphicsLayer::CustomAppearan > { > #if ENABLE(RUBBER_BANDING) > switch (customAppearance) { >- case GraphicsLayer::NoCustomAppearance: >- case GraphicsLayer::DarkBackdropAppearance: >- case GraphicsLayer::LightBackdropAppearance: >+ case GraphicsLayer::CustomAppearance::None: >+ case GraphicsLayer::CustomAppearance::DarkBackdrop: >+ case GraphicsLayer::CustomAppearance::LightBackdrop: > ScrollbarThemeMac::removeOverhangAreaBackground(layer); > ScrollbarThemeMac::removeOverhangAreaShadow(layer); > break; >- case GraphicsLayer::ScrollingOverhang: >+ case GraphicsLayer::CustomAppearance::ScrollingOverhang: > ScrollbarThemeMac::setUpOverhangAreaBackground(layer); > break; >- case GraphicsLayer::ScrollingShadow: >+ case GraphicsLayer::CustomAppearance::ScrollingShadow: > ScrollbarThemeMac::setUpOverhangAreaShadow(layer); > break; > } >@@ -303,7 +303,7 @@ void RemoteLayerTreePropertyApplier::applyProperties(UIView *view, RemoteLayerTr > [children addObject:relatedLayers.get(child)]; > } > >- if (properties.customAppearance == GraphicsLayer::LightBackdropAppearance || properties.customAppearance == GraphicsLayer::DarkBackdropAppearance) { >+ if (properties.customAppearance == GraphicsLayer::CustomAppearance::LightBackdrop || properties.customAppearance == GraphicsLayer::CustomAppearance::DarkBackdrop) { > // This is a UIBackdropView, which should have children attached to > // its content view, not directly on its layers. > [[(_UIBackdropView*)view contentView] _web_setSubviews:children.get()]; >@@ -314,7 +314,7 @@ void RemoteLayerTreePropertyApplier::applyProperties(UIView *view, RemoteLayerTr > if (properties.changedProperties & RemoteLayerTreeTransaction::MaskLayerChanged) { > CALayer *maskOwnerLayer = view.layer; > >- if (properties.customAppearance == GraphicsLayer::LightBackdropAppearance || properties.customAppearance == GraphicsLayer::DarkBackdropAppearance) { >+ if (properties.customAppearance == GraphicsLayer::CustomAppearance::LightBackdrop || properties.customAppearance == GraphicsLayer::CustomAppearance::DarkBackdrop) { > // This is a UIBackdropView, which means any mask must be applied to the CABackdropLayer rather > // that the view's layer. The backdrop is the first layer child. > if (view.layer.sublayers.count && [view.layer.sublayers[0] isKindOfClass:[CABackdropLayer class]]) >diff --git a/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm b/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm >index 75c5f22c38e2b258be9202304a9e5720bfa00154..c97d5e750cff83671f30deb06f219ccbc1e98697 100644 >--- a/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm >+++ b/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm >@@ -90,7 +90,7 @@ RemoteLayerTreeTransaction::LayerProperties::LayerProperties() > , backgroundColor(Color::transparent) > , borderColor(Color::black) > , edgeAntialiasingMask(kCALayerLeftEdge | kCALayerRightEdge | kCALayerBottomEdge | kCALayerTopEdge) >- , customAppearance(GraphicsLayer::NoCustomAppearance) >+ , customAppearance(GraphicsLayer::CustomAppearance::None) > , minificationFilter(PlatformCALayer::FilterType::Linear) > , magnificationFilter(PlatformCALayer::FilterType::Linear) > , blendMode(BlendModeNormal) >diff --git a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp >index c485e09cf98b9a254654c1c17b1abc5bd704a86a..155c054f1cde986f0575dcc14b0d50aeab43329f 100644 >--- a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp >+++ b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp >@@ -832,7 +832,7 @@ void PlatformCALayerRemote::setShapeWindRule(WindRule windRule) > > bool PlatformCALayerRemote::requiresCustomAppearanceUpdateOnBoundsChange() const > { >- return m_properties.customAppearance == GraphicsLayer::ScrollingShadow; >+ return m_properties.customAppearance == GraphicsLayer::CustomAppearance::ScrollingShadow; > } > > GraphicsLayer::CustomAppearance PlatformCALayerRemote::customAppearance() const >diff --git a/Source/WebKitLegacy/mac/WebView/WebView.mm b/Source/WebKitLegacy/mac/WebView/WebView.mm >index 808c3c09dfadff3c1292c15b299b59a062aa0578..84606f3be2e6c843bd2a2b55b9fcd5a367b81367 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebView.mm >@@ -4170,7 +4170,7 @@ - (BOOL)_setMediaLayer:(CALayer*)layer forPluginView:(NSView*)pluginView > continue; > > if (layerForWidget->contentsLayerForMedia() != layer) { >- layerForWidget->setContentsToPlatformLayer(layer, GraphicsLayer::ContentsLayerForMedia); >+ layerForWidget->setContentsToPlatformLayer(layer, GraphicsLayer::ContentsLayerPurpose::Media); > // We need to make sure the layer hierachy change is applied immediately. > if (mainCoreFrame->view()) > mainCoreFrame->view()->flushCompositingStateIncludingSubframes(); >diff --git a/Source/WebKitLegacy/win/FullscreenVideoController.cpp b/Source/WebKitLegacy/win/FullscreenVideoController.cpp >index f81cfefbbf8d02fc0bf3be63e8f35165bf34bb3f..1c76f01285891b62bf48c7736ecff015c5d80ca8 100644 >--- a/Source/WebKitLegacy/win/FullscreenVideoController.cpp >+++ b/Source/WebKitLegacy/win/FullscreenVideoController.cpp >@@ -185,7 +185,7 @@ private: > virtual bool platformCALayerRespondsToLayoutChanges() const { return true; } > > virtual void platformCALayerAnimationStarted(MonotonicTime beginTime) { } >- virtual GraphicsLayer::CompositingCoordinatesOrientation platformCALayerContentsOrientation() const { return GraphicsLayer::CompositingCoordinatesBottomUp; } >+ virtual GraphicsLayer::CompositingCoordinatesOrientation platformCALayerContentsOrientation() const { return GraphicsLayer::CompositingCoordinatesOrientation::BottomUp; } > virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect&, GraphicsLayerPaintBehavior) { } > virtual bool platformCALayerShowDebugBorders() const { return false; } > virtual bool platformCALayerShowRepaintCounter(PlatformCALayer*) const { return false; }
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 188141
:
346000
|
346006
|
346025