summaryrefslogtreecommitdiff
path: root/Source/WebKit2/WebProcess/WebPage/mac
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-11-22 09:09:45 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2012-11-22 09:10:13 +0100
commit470286ecfe79d59df14944e5b5d34630fc739391 (patch)
tree43983212872e06cebefd2ae474418fa2908ca54c /Source/WebKit2/WebProcess/WebPage/mac
parent23037105e948c2065da5a937d3a2396b0ff45c1e (diff)
downloadqtwebkit-470286ecfe79d59df14944e5b5d34630fc739391.tar.gz
Imported WebKit commit e89504fa9195b2063b2530961d4b73dd08de3242 (http://svn.webkit.org/repository/webkit/trunk@135485)
Change-Id: I03774e5ac79721c13ffa30d152537a74d0b12e66 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'Source/WebKit2/WebProcess/WebPage/mac')
-rw-r--r--Source/WebKit2/WebProcess/WebPage/mac/RemoteGraphicsLayer.h35
-rw-r--r--Source/WebKit2/WebProcess/WebPage/mac/RemoteGraphicsLayer.mm147
-rw-r--r--Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.h (renamed from Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeController.h)37
-rw-r--r--Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.mm115
-rw-r--r--Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeController.mm54
-rw-r--r--Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h4
-rw-r--r--Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm10
-rw-r--r--Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm8
8 files changed, 328 insertions, 82 deletions
diff --git a/Source/WebKit2/WebProcess/WebPage/mac/RemoteGraphicsLayer.h b/Source/WebKit2/WebProcess/WebPage/mac/RemoteGraphicsLayer.h
index 7b274a44a..c65cd65d3 100644
--- a/Source/WebKit2/WebProcess/WebPage/mac/RemoteGraphicsLayer.h
+++ b/Source/WebKit2/WebProcess/WebPage/mac/RemoteGraphicsLayer.h
@@ -30,21 +30,48 @@
namespace WebKit {
-class RemoteLayerTreeController;
+class RemoteLayerTreeContext;
class RemoteGraphicsLayer : public WebCore::GraphicsLayer {
public:
- static PassOwnPtr<WebCore::GraphicsLayer> create(WebCore::GraphicsLayerClient*, RemoteLayerTreeController*);
+ static PassOwnPtr<WebCore::GraphicsLayer> create(WebCore::GraphicsLayerClient*, RemoteLayerTreeContext*);
virtual ~RemoteGraphicsLayer();
+ uint64_t layerID() const { return m_layerID; }
+
private:
- RemoteGraphicsLayer(WebCore::GraphicsLayerClient*, RemoteLayerTreeController*);
+ RemoteGraphicsLayer(WebCore::GraphicsLayerClient*, RemoteLayerTreeContext*);
// WebCore::GraphicsLayer
+ virtual void setName(const String&) OVERRIDE;
+
+ virtual bool setChildren(const Vector<WebCore::GraphicsLayer*>&);
+ virtual void addChild(WebCore::GraphicsLayer*);
+ virtual void addChildAtIndex(WebCore::GraphicsLayer*, int index);
+ virtual void addChildAbove(WebCore::GraphicsLayer* childLayer, WebCore::GraphicsLayer* sibling);
+ virtual void addChildBelow(WebCore::GraphicsLayer* childLayer, WebCore::GraphicsLayer* sibling);
+ virtual bool replaceChild(WebCore::GraphicsLayer* oldChild, WebCore::GraphicsLayer* newChild);
+
+ virtual void removeFromParent() OVERRIDE;
+
+ virtual void setPosition(const WebCore::FloatPoint&) OVERRIDE;
+ virtual void setSize(const WebCore::FloatSize&) OVERRIDE;
+
virtual void setNeedsDisplay() OVERRIDE;
virtual void setNeedsDisplayInRect(const WebCore::FloatRect&) OVERRIDE;
+ virtual void flushCompositingState(const WebCore::FloatRect&) OVERRIDE;
+ virtual void flushCompositingStateForThisLayerOnly() OVERRIDE;
+
+ virtual void willBeDestroyed() OVERRIDE;
+
+ void noteLayerPropertiesChanged(unsigned layerChanges);
+ void noteSublayersChanged();
+
+ void recursiveCommitChanges();
- RemoteLayerTreeController* m_controller;
+ uint64_t m_layerID;
+ RemoteLayerTreeContext* m_context;
+ unsigned m_uncommittedLayerChanges;
};
} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/WebPage/mac/RemoteGraphicsLayer.mm b/Source/WebKit2/WebProcess/WebPage/mac/RemoteGraphicsLayer.mm
index 83a67c689..b2ea76325 100644
--- a/Source/WebKit2/WebProcess/WebPage/mac/RemoteGraphicsLayer.mm
+++ b/Source/WebKit2/WebProcess/WebPage/mac/RemoteGraphicsLayer.mm
@@ -26,26 +26,114 @@
#include "config.h"
#include "RemoteGraphicsLayer.h"
+#include "RemoteLayerTreeContext.h"
+#include "RemoteLayerTreeTransaction.h"
+
+#include <wtf/text/CString.h>
+
using namespace WebCore;
namespace WebKit {
-PassOwnPtr<GraphicsLayer> RemoteGraphicsLayer::create(GraphicsLayerClient* client, RemoteLayerTreeController* controller)
+static uint64_t generateLayerID()
+{
+ static uint64_t layerID;
+ return ++layerID;
+}
+
+PassOwnPtr<GraphicsLayer> RemoteGraphicsLayer::create(GraphicsLayerClient* client, RemoteLayerTreeContext* context)
{
- return adoptPtr(new RemoteGraphicsLayer(client, controller));
+ return adoptPtr(new RemoteGraphicsLayer(client, context));
}
-RemoteGraphicsLayer::RemoteGraphicsLayer(GraphicsLayerClient* client, RemoteLayerTreeController* controller)
+RemoteGraphicsLayer::RemoteGraphicsLayer(GraphicsLayerClient* client, RemoteLayerTreeContext* context)
: GraphicsLayer(client)
- , m_controller(controller)
+ , m_layerID(generateLayerID())
+ , m_context(context)
+ , m_uncommittedLayerChanges(RemoteLayerTreeTransaction::NoChange)
{
- // FIXME: This is in place to silence a compiler warning. Remove this
- // once we actually start using m_controller.
- (void)m_controller;
}
RemoteGraphicsLayer::~RemoteGraphicsLayer()
{
+ willBeDestroyed();
+}
+
+void RemoteGraphicsLayer::setName(const String& name)
+{
+ String longName = String::format("RemoteGraphicsLayer(%p) ", this) + name;
+ GraphicsLayer::setName(longName);
+
+ noteLayerPropertiesChanged(RemoteLayerTreeTransaction::NameChanged);
+}
+
+bool RemoteGraphicsLayer::setChildren(const Vector<GraphicsLayer*>& children)
+{
+ if (GraphicsLayer::setChildren(children)) {
+ noteSublayersChanged();
+ return true;
+ }
+
+ return false;
+}
+
+void RemoteGraphicsLayer::addChild(GraphicsLayer* childLayer)
+{
+ GraphicsLayer::addChild(childLayer);
+ noteSublayersChanged();
+}
+
+void RemoteGraphicsLayer::addChildAtIndex(GraphicsLayer* childLayer, int index)
+{
+ GraphicsLayer::addChildAtIndex(childLayer, index);
+ noteSublayersChanged();
+}
+
+void RemoteGraphicsLayer::addChildAbove(GraphicsLayer* childLayer, GraphicsLayer* sibling)
+{
+ GraphicsLayer::addChildAbove(childLayer, sibling);
+ noteSublayersChanged();
+}
+
+void RemoteGraphicsLayer::addChildBelow(GraphicsLayer* childLayer, GraphicsLayer* sibling)
+{
+ GraphicsLayer::addChildBelow(childLayer, sibling);
+ noteSublayersChanged();
+}
+
+bool RemoteGraphicsLayer::replaceChild(GraphicsLayer* oldChild, GraphicsLayer* newChild)
+{
+ if (GraphicsLayer::replaceChild(oldChild, newChild)) {
+ noteSublayersChanged();
+ return true;
+ }
+
+ return false;
+}
+
+void RemoteGraphicsLayer::removeFromParent()
+{
+ if (m_parent)
+ static_cast<RemoteGraphicsLayer*>(m_parent)->noteSublayersChanged();
+ GraphicsLayer::removeFromParent();
+}
+
+void RemoteGraphicsLayer::setPosition(const FloatPoint& position)
+{
+ if (position == m_position)
+ return;
+
+ GraphicsLayer::setPosition(position);
+ noteLayerPropertiesChanged(RemoteLayerTreeTransaction::PositionChanged);
+}
+
+void RemoteGraphicsLayer::setSize(const FloatSize& size)
+{
+ if (size == m_size)
+ return;
+
+ GraphicsLayer::setSize(size);
+ noteLayerPropertiesChanged(RemoteLayerTreeTransaction::SizeChanged);
}
void RemoteGraphicsLayer::setNeedsDisplay()
@@ -60,4 +148,49 @@ void RemoteGraphicsLayer::setNeedsDisplayInRect(const FloatRect&)
// FIXME: Implement this.
}
+void RemoteGraphicsLayer::flushCompositingState(const FloatRect&)
+{
+ recursiveCommitChanges();
+}
+
+void RemoteGraphicsLayer::flushCompositingStateForThisLayerOnly()
+{
+ if (!m_uncommittedLayerChanges)
+ return;
+
+ m_context->currentTransaction().layerPropertiesChanged(this, m_uncommittedLayerChanges);
+
+ m_uncommittedLayerChanges = RemoteLayerTreeTransaction::NoChange;
+}
+
+void RemoteGraphicsLayer::willBeDestroyed()
+{
+ m_context->layerWillBeDestroyed(this);
+ GraphicsLayer::willBeDestroyed();
+}
+
+void RemoteGraphicsLayer::noteLayerPropertiesChanged(unsigned layerChanges)
+{
+ if (!m_uncommittedLayerChanges && m_client)
+ m_client->notifyFlushRequired(this);
+ m_uncommittedLayerChanges |= layerChanges;
+}
+
+void RemoteGraphicsLayer::noteSublayersChanged()
+{
+ noteLayerPropertiesChanged(RemoteLayerTreeTransaction::ChildrenChanged);
+
+ // FIXME: Handle replica layers.
+}
+
+void RemoteGraphicsLayer::recursiveCommitChanges()
+{
+ flushCompositingStateForThisLayerOnly();
+
+ for (size_t i = 0; i < children().size(); ++i) {
+ RemoteGraphicsLayer* graphicsLayer = static_cast<RemoteGraphicsLayer*>(children()[i]);
+ graphicsLayer->recursiveCommitChanges();
+ }
+}
+
} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeController.h b/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.h
index 831d26f93..f5d7973fd 100644
--- a/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeController.h
+++ b/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.h
@@ -23,25 +23,48 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef RemoteLayerTree_h
-#define RemoteLayerTree_h
+#ifndef RemoteLayerTreeContext_h
+#define RemoteLayerTreeContext_h
#include <WebCore/GraphicsLayerFactory.h>
+#include <WebCore/Timer.h>
+#include <wtf/Vector.h>
namespace WebKit {
-class RemoteLayerTreeController : public WebCore::GraphicsLayerFactory {
+class RemoteGraphicsLayer;
+class RemoteLayerTreeTransaction;
+class WebPage;
+
+class RemoteLayerTreeContext : public WebCore::GraphicsLayerFactory {
public:
- static PassOwnPtr<RemoteLayerTreeController> create();
- ~RemoteLayerTreeController();
+ static PassOwnPtr<RemoteLayerTreeContext> create(WebPage*);
+ ~RemoteLayerTreeContext();
+
+ void setRootLayer(WebCore::GraphicsLayer*);
+ void layerWillBeDestroyed(RemoteGraphicsLayer*);
+
+ void scheduleLayerFlush();
+
+ RemoteLayerTreeTransaction& currentTransaction();
private:
- RemoteLayerTreeController();
+ explicit RemoteLayerTreeContext(WebPage*);
// WebCore::GraphicsLayerFactory
virtual PassOwnPtr<WebCore::GraphicsLayer> createGraphicsLayer(WebCore::GraphicsLayerClient*) OVERRIDE;
+
+ void layerFlushTimerFired(WebCore::Timer<RemoteLayerTreeContext>*);
+ void flushLayers();
+
+ WebPage* m_webPage;
+ WebCore::Timer<RemoteLayerTreeContext> m_layerFlushTimer;
+
+ uint64_t m_rootLayerID;
+ Vector<uint64_t> m_destroyedLayers;
+ RemoteLayerTreeTransaction* m_currentTransaction;
};
} // namespace WebKit
-#endif // RemoteLayerTree_h
+#endif // RemoteLayerTreeContext_h
diff --git a/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.mm b/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.mm
new file mode 100644
index 000000000..8503a1f4b
--- /dev/null
+++ b/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.mm
@@ -0,0 +1,115 @@
+/*
+ * 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.
+ */
+
+#import "config.h"
+#import "RemoteLayerTreeContext.h"
+
+#import "RemoteGraphicsLayer.h"
+#import "RemoteLayerTreeTransaction.h"
+#import "RemoteLayerTreeHostMessages.h"
+#import "WebPage.h"
+#import <WebCore/Frame.h>
+#import <WebCore/FrameView.h>
+#import <WebCore/Page.h>
+#import <wtf/PassOwnPtr.h>
+#import <wtf/TemporaryChange.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+PassOwnPtr<RemoteLayerTreeContext> RemoteLayerTreeContext::create(WebPage* webPage)
+{
+ return adoptPtr(new RemoteLayerTreeContext(webPage));
+}
+
+RemoteLayerTreeContext::RemoteLayerTreeContext(WebPage* webPage)
+ : m_webPage(webPage)
+ , m_layerFlushTimer(this, &RemoteLayerTreeContext::layerFlushTimerFired)
+ , m_rootLayerID(0)
+ , m_currentTransaction(nullptr)
+{
+}
+
+RemoteLayerTreeContext::~RemoteLayerTreeContext()
+{
+}
+
+void RemoteLayerTreeContext::setRootLayer(GraphicsLayer* rootLayer)
+{
+ ASSERT(rootLayer);
+
+ m_rootLayerID = static_cast<RemoteGraphicsLayer*>(rootLayer)->layerID();
+}
+
+void RemoteLayerTreeContext::layerWillBeDestroyed(RemoteGraphicsLayer* graphicsLayer)
+{
+ ASSERT(!m_destroyedLayers.contains(graphicsLayer->layerID()));
+
+ m_destroyedLayers.append(graphicsLayer->layerID());
+}
+
+void RemoteLayerTreeContext::scheduleLayerFlush()
+{
+ if (m_layerFlushTimer.isActive())
+ return;
+
+ m_layerFlushTimer.startOneShot(0);
+}
+
+RemoteLayerTreeTransaction& RemoteLayerTreeContext::currentTransaction()
+{
+ ASSERT(m_currentTransaction);
+
+ return *m_currentTransaction;
+}
+
+PassOwnPtr<GraphicsLayer> RemoteLayerTreeContext::createGraphicsLayer(GraphicsLayerClient* client)
+{
+ return RemoteGraphicsLayer::create(client, this);
+}
+
+void RemoteLayerTreeContext::layerFlushTimerFired(WebCore::Timer<RemoteLayerTreeContext>*)
+{
+ flushLayers();
+}
+
+void RemoteLayerTreeContext::flushLayers()
+{
+ ASSERT(!m_currentTransaction);
+
+ RemoteLayerTreeTransaction transaction;
+ transaction.setRootLayerID(m_rootLayerID);
+ transaction.setDestroyedLayerIDs(std::move(m_destroyedLayers));
+
+ TemporaryChange<RemoteLayerTreeTransaction*> transactionChange(m_currentTransaction, &transaction);
+
+ m_webPage->layoutIfNeeded();
+ m_webPage->corePage()->mainFrame()->view()->flushCompositingStateIncludingSubframes();
+
+ m_webPage->send(Messages::RemoteLayerTreeHost::Commit(transaction));
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeController.mm b/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeController.mm
deleted file mode 100644
index 43b895d28..000000000
--- a/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeController.mm
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.
- */
-
-#import "config.h"
-#import "RemoteLayerTreeController.h"
-
-#import "RemoteGraphicsLayer.h"
-#import <wtf/PassOwnPtr.h>
-
-using namespace WebCore;
-
-namespace WebKit {
-
-PassOwnPtr<RemoteLayerTreeController> RemoteLayerTreeController::create()
-{
- return adoptPtr(new RemoteLayerTreeController);
-}
-
-RemoteLayerTreeController::RemoteLayerTreeController()
-{
-}
-
-RemoteLayerTreeController::~RemoteLayerTreeController()
-{
-}
-
-PassOwnPtr<GraphicsLayer> RemoteLayerTreeController::createGraphicsLayer(GraphicsLayerClient* client)
-{
- return RemoteGraphicsLayer::create(client, this);
-}
-
-} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h b/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h
index d85c343fc..86f32b061 100644
--- a/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h
+++ b/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h
@@ -31,7 +31,7 @@
namespace WebKit {
-class RemoteLayerTreeController;
+class RemoteLayerTreeContext;
class RemoteLayerTreeDrawingArea : public DrawingArea {
public:
@@ -49,7 +49,7 @@ private:
virtual void setRootCompositingLayer(WebCore::GraphicsLayer*) OVERRIDE;
virtual void scheduleCompositingLayerFlush() OVERRIDE;
- OwnPtr<RemoteLayerTreeController> m_remoteLayerTreeController;
+ OwnPtr<RemoteLayerTreeContext> m_RemoteLayerTreeContext;
};
} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm b/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm
index b6cfc574f..d014e16ad 100644
--- a/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm
+++ b/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm
@@ -26,7 +26,7 @@
#import "config.h"
#import "RemoteLayerTreeDrawingArea.h"
-#import "RemoteLayerTreeController.h"
+#import "RemoteLayerTreeContext.h"
using namespace WebCore;
@@ -39,7 +39,7 @@ PassOwnPtr<RemoteLayerTreeDrawingArea> RemoteLayerTreeDrawingArea::create(WebPag
RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea(WebPage* webPage, const WebPageCreationParameters&)
: DrawingArea(DrawingAreaTypeRemoteLayerTree, webPage)
- , m_remoteLayerTreeController(RemoteLayerTreeController::create())
+ , m_RemoteLayerTreeContext(RemoteLayerTreeContext::create(webPage))
{
}
@@ -57,15 +57,17 @@ void RemoteLayerTreeDrawingArea::scroll(const IntRect& scrollRect, const IntSize
GraphicsLayerFactory* RemoteLayerTreeDrawingArea::graphicsLayerFactory()
{
- return m_remoteLayerTreeController.get();
+ return m_RemoteLayerTreeContext.get();
}
-void RemoteLayerTreeDrawingArea::setRootCompositingLayer(GraphicsLayer*)
+void RemoteLayerTreeDrawingArea::setRootCompositingLayer(GraphicsLayer* rootLayer)
{
+ m_RemoteLayerTreeContext->setRootLayer(rootLayer);
}
void RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush()
{
+ m_RemoteLayerTreeContext->scheduleLayerFlush();
}
} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm b/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
index 7b0c9ab36..5f09d751b 100644
--- a/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
+++ b/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
@@ -384,9 +384,9 @@ void WebPage::characterIndexForPoint(IntPoint point, uint64_t& index)
return;
HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(point, false);
- frame = result.innerNonSharedNode() ? result.innerNonSharedNode()->document()->frame() : m_page->focusController()->focusedOrMainFrame();
+ frame = result.innerNonSharedNode() ? result.innerNodeFrame() : m_page->focusController()->focusedOrMainFrame();
- RefPtr<Range> range = frame->rangeForPoint(result.roundedPoint());
+ RefPtr<Range> range = frame->rangeForPoint(result.roundedPointInInnerNodeFrame());
if (!range)
return;
@@ -679,7 +679,7 @@ bool WebPage::platformHasLocalDataForURL(const WebCore::KURL& url)
NSMutableURLRequest* request = [[NSMutableURLRequest alloc] initWithURL:url];
[request setValue:(NSString*)userAgent() forHTTPHeaderField:@"User-Agent"];
NSCachedURLResponse *cachedResponse;
- if (CFURLStorageSessionRef storageSession = ResourceHandle::currentStorageSession())
+ if (CFURLStorageSessionRef storageSession = corePage()->mainFrame()->loader()->networkingContext()->storageSession())
cachedResponse = WKCachedResponseForRequest(storageSession, request);
else
cachedResponse = [[NSURLCache sharedURLCache] cachedResponseForRequest:request];
@@ -693,7 +693,7 @@ static NSCachedURLResponse *cachedResponseForURL(WebPage* webPage, const KURL& u
RetainPtr<NSMutableURLRequest> request(AdoptNS, [[NSMutableURLRequest alloc] initWithURL:url]);
[request.get() setValue:(NSString *)webPage->userAgent() forHTTPHeaderField:@"User-Agent"];
- if (CFURLStorageSessionRef storageSession = ResourceHandle::currentStorageSession())
+ if (CFURLStorageSessionRef storageSession = webPage->corePage()->mainFrame()->loader()->networkingContext()->storageSession())
return WKCachedResponseForRequest(storageSession, request.get());
return [[NSURLCache sharedURLCache] cachedResponseForRequest:request.get()];