Title: [238549] trunk/Source/WebKit
- Revision
- 238549
- Author
- [email protected]
- Date
- 2018-11-27 04:39:27 -0800 (Tue, 27 Nov 2018)
Log Message
Stop collecting related layers in RemoteLayerTreeHost::updateLayerTree
https://bugs.webkit.org/show_bug.cgi?id=192003
Reviewed by Tim Horton.
We can pass the node hash directly to RemoteLayerTreePropertyApplier. The collection step doesn't seem
to add anything except an extra hash lookup.
* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::updateLayerTree):
Pass m_nodes directly.
Some random cleanups.
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (238548 => 238549)
--- trunk/Source/WebKit/ChangeLog 2018-11-27 12:27:29 UTC (rev 238548)
+++ trunk/Source/WebKit/ChangeLog 2018-11-27 12:39:27 UTC (rev 238549)
@@ -1,5 +1,22 @@
2018-11-27 Antti Koivisto <[email protected]>
+ Stop collecting related layers in RemoteLayerTreeHost::updateLayerTree
+ https://bugs.webkit.org/show_bug.cgi?id=192003
+
+ Reviewed by Tim Horton.
+
+ We can pass the node hash directly to RemoteLayerTreePropertyApplier. The collection step doesn't seem
+ to add anything except an extra hash lookup.
+
+ * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
+ * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
+ (WebKit::RemoteLayerTreeHost::updateLayerTree):
+
+ Pass m_nodes directly.
+ Some random cleanups.
+
+2018-11-27 Antti Koivisto <[email protected]>
+
Remote tile layers shouldn't be UIViews
https://bugs.webkit.org/show_bug.cgi?id=191953
Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h (238548 => 238549)
--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h 2018-11-27 12:27:29 UTC (rev 238548)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h 2018-11-27 12:39:27 UTC (rev 238549)
@@ -35,7 +35,7 @@
class RemoteLayerTreePropertyApplier {
public:
- using RelatedLayerMap = HashMap<WebCore::GraphicsLayer::PlatformLayerID, RemoteLayerTreeNode*>;
+ using RelatedLayerMap = HashMap<WebCore::GraphicsLayer::PlatformLayerID, std::unique_ptr<RemoteLayerTreeNode>>;
static void applyProperties(RemoteLayerTreeNode&, RemoteLayerTreeHost*, const RemoteLayerTreeTransaction::LayerProperties&, const RelatedLayerMap&, RemoteLayerBackingStore::LayerContentsType);
static void applyPropertiesToLayer(CALayer *, RemoteLayerTreeHost*, const RemoteLayerTreeTransaction::LayerProperties&, RemoteLayerBackingStore::LayerContentsType);
Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm (238548 => 238549)
--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm 2018-11-27 12:27:29 UTC (rev 238548)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm 2018-11-27 12:39:27 UTC (rev 238549)
@@ -82,8 +82,11 @@
rootLayerChanged = true;
}
- typedef std::pair<GraphicsLayer::PlatformLayerID, GraphicsLayer::PlatformLayerID> LayerIDPair;
- Vector<LayerIDPair> clonesToUpdate;
+ struct LayerAndClone {
+ GraphicsLayer::PlatformLayerID layerID;
+ GraphicsLayer::PlatformLayerID cloneLayerID;
+ };
+ Vector<LayerAndClone> clonesToUpdate;
#if PLATFORM(MAC) || PLATFORM(IOSMAC)
// Can't use the iOS code on macOS yet: rdar://problem/31247730
@@ -99,33 +102,20 @@
auto* node = nodeForID(layerID);
ASSERT(node);
- RemoteLayerTreePropertyApplier::RelatedLayerMap relatedLayers;
- if (properties.changedProperties & RemoteLayerTreeTransaction::ChildrenChanged) {
- for (auto& child : properties.children)
- relatedLayers.set(child, nodeForID(child));
- }
+ if (properties.changedProperties.contains(RemoteLayerTreeTransaction::ClonedContentsChanged) && properties.clonedLayerID)
+ clonesToUpdate.append({ layerID, properties.clonedLayerID });
- if (properties.changedProperties & RemoteLayerTreeTransaction::MaskLayerChanged && properties.maskLayerID)
- relatedLayers.set(properties.maskLayerID, nodeForID(properties.maskLayerID));
+ RemoteLayerTreePropertyApplier::applyProperties(*node, this, properties, m_nodes, layerContentsType);
- if (properties.changedProperties & RemoteLayerTreeTransaction::ClonedContentsChanged && properties.clonedLayerID)
- clonesToUpdate.append(LayerIDPair(layerID, properties.clonedLayerID));
-
if (m_isDebugLayerTreeHost) {
- RemoteLayerTreePropertyApplier::applyProperties(*node, this, properties, relatedLayers, layerContentsType);
-
- if (properties.changedProperties & RemoteLayerTreeTransaction::BorderWidthChanged)
+ if (properties.changedProperties.contains(RemoteLayerTreeTransaction::BorderWidthChanged))
node->layer().borderWidth = properties.borderWidth / indicatorScaleFactor;
node->layer().masksToBounds = false;
- } else
- RemoteLayerTreePropertyApplier::applyProperties(*node, this, properties, relatedLayers, layerContentsType);
+ }
}
- for (const auto& layerPair : clonesToUpdate) {
- auto* layer = layerForID(layerPair.first);
- auto* clonedLayer = layerForID(layerPair.second);
- layer.contents = clonedLayer.contents;
- }
+ for (const auto& layerAndClone : clonesToUpdate)
+ layerForID(layerAndClone.layerID).contents = layerForID(layerAndClone.cloneLayerID).contents;
for (auto& destroyedLayer : transaction.destroyedLayers())
layerWillBeRemoved(destroyedLayer);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes