Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AsyncScrolling: add ScrollingTreePositionedNode base class
https://bugs.webkit.org/show_bug.cgi?id=246453 Reviewed by Žan Doberšek. Make Cocoa and Nicosia implementations inherit from the base class and move the common code there. * Source/WebCore/Sources.txt: * Source/WebCore/SourcesCocoa.txt: * Source/WebCore/SourcesGTK.txt: * Source/WebCore/SourcesWPE.txt: * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebCore/page/scrolling/ScrollingTreePositionedNode.cpp: Renamed from Source/WebCore/page/scrolling/cocoa/ScrollingTreePositionedNode.mm. (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren): (WebCore::ScrollingTreePositionedNode::scrollDeltaSinceLastCommit const): * Source/WebCore/page/scrolling/ScrollingTreePositionedNode.h: Copied from Source/WebCore/page/scrolling/cocoa/ScrollingTreePositionedNode.h. * Source/WebCore/page/scrolling/cocoa/ScrollingTreeFixedNode.mm: (WebCore::ScrollingTreeFixedNode::applyLayerPositions): * Source/WebCore/page/scrolling/cocoa/ScrollingTreePositionedNodeCocoa.h: Renamed from Source/WebCore/page/scrolling/cocoa/ScrollingTreePositionedNode.h. (WebCore::ScrollingTreePositionedNodeCocoa::layer const): * Source/WebCore/page/scrolling/cocoa/ScrollingTreePositionedNodeCocoa.mm: Added. (WebCore::ScrollingTreePositionedNodeCocoa::create): (WebCore::ScrollingTreePositionedNodeCocoa::ScrollingTreePositionedNodeCocoa): (WebCore::ScrollingTreePositionedNodeCocoa::commitStateBeforeChildren): (WebCore::ScrollingTreePositionedNodeCocoa::applyLayerPositions): * Source/WebCore/page/scrolling/mac/ScrollingTreeMac.mm: (ScrollingTreeMac::createScrollingTreeNode): * Source/WebCore/page/scrolling/nicosia/ScrollingTreeFixedNode.cpp: (WebCore::ScrollingTreeFixedNode::applyLayerPositions): * Source/WebCore/page/scrolling/nicosia/ScrollingTreeNicosia.cpp: (WebCore::ScrollingTreeNicosia::createScrollingTreeNode): * Source/WebCore/page/scrolling/nicosia/ScrollingTreePositionedNodeNicosia.cpp: Renamed from Source/WebCore/page/scrolling/nicosia/ScrollingTreePositionedNode.cpp. (WebCore::ScrollingTreePositionedNodeNicosia::create): (WebCore::ScrollingTreePositionedNodeNicosia::ScrollingTreePositionedNodeNicosia): (WebCore::ScrollingTreePositionedNodeNicosia::commitStateBeforeChildren): (WebCore::ScrollingTreePositionedNodeNicosia::applyLayerPositions): * Source/WebCore/page/scrolling/nicosia/ScrollingTreePositionedNodeNicosia.h: Renamed from Source/WebCore/page/scrolling/nicosia/ScrollingTreePositionedNode.h. * Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp: (WebKit::RemoteScrollingTree::createScrollingTreeNode): Canonical link: https://commits.webkit.org/255724@main
- Loading branch information
1 parent
2fe2393
commit 8df9660
Showing
18 changed files
with
188 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
Source/WebCore/page/scrolling/cocoa/ScrollingTreePositionedNodeCocoa.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright (C) 2012 Apple Inc. All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | ||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS | ||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ||
* THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#if ENABLE(ASYNC_SCROLLING) | ||
|
||
#include "ScrollingTreePositionedNode.h" | ||
#include <wtf/RetainPtr.h> | ||
|
||
OBJC_CLASS CALayer; | ||
|
||
namespace WebCore { | ||
|
||
class ScrollingTreePositionedNodeCocoa : public ScrollingTreePositionedNode { | ||
public: | ||
WEBCORE_EXPORT static Ref<ScrollingTreePositionedNodeCocoa> create(ScrollingTree&, ScrollingNodeID); | ||
|
||
virtual ~ScrollingTreePositionedNodeCocoa(); | ||
|
||
CALayer *layer() const { return m_layer.get(); } | ||
|
||
private: | ||
ScrollingTreePositionedNodeCocoa(ScrollingTree&, ScrollingNodeID); | ||
|
||
void commitStateBeforeChildren(const ScrollingStateNode&) override; | ||
|
||
void applyLayerPositions() override; | ||
|
||
RetainPtr<CALayer> m_layer; | ||
}; | ||
|
||
} // namespace WebCore | ||
|
||
SPECIALIZE_TYPE_TRAITS_SCROLLING_NODE(ScrollingTreePositionedNodeCocoa, isPositionedNodeCocoa()) | ||
|
||
#endif // ENABLE(ASYNC_SCROLLING) |
Oops, something went wrong.