Diff
Modified: trunk/Source/WebKit2/ChangeLog (134258 => 134259)
--- trunk/Source/WebKit2/ChangeLog 2012-11-12 19:03:11 UTC (rev 134258)
+++ trunk/Source/WebKit2/ChangeLog 2012-11-12 19:04:43 UTC (rev 134259)
@@ -1,3 +1,45 @@
+2012-11-12 Anders Carlsson <[email protected]>
+
+ Layer property changes should schedule a remote layer flush
+ https://bugs.webkit.org/show_bug.cgi?id=101951
+
+ Reviewed by Andreas Kling.
+
+ * Shared/mac/RemoteLayerTreeTransaction.h:
+ * Shared/mac/RemoteLayerTreeTransaction.mm:
+ New class. For now this just contains the changed layer properties flags but this will be extended
+ to cover changed layers as well.
+
+ * WebKit2.xcodeproj/project.pbxproj:
+ Add new files.
+
+ * WebProcess/WebPage/mac/RemoteGraphicsLayer.mm:
+ (WebKit::RemoteGraphicsLayer::RemoteGraphicsLayer):
+ Initialize m_uncommittedLayerChanges.
+
+ (WebKit::RemoteGraphicsLayer::setName):
+ Set the name and call noteLayerPropertiesChanged.
+
+ (WebKit::RemoteGraphicsLayer::noteLayerPropertiesChanged):
+ Notify that a flush is required (if required).
+
+ * WebProcess/WebPage/mac/RemoteLayerTreeController.h:
+ Add a layer flush timer.
+
+ * WebProcess/WebPage/mac/RemoteLayerTreeController.mm:
+ (WebKit::RemoteLayerTreeController::RemoteLayerTreeController):
+ Initialize the layer flush timer.
+
+ (WebKit::RemoteLayerTreeController::scheduleLayerFlush):
+ Schedule the layer flush timer if needed.
+
+ (WebKit::RemoteLayerTreeController::layerFlushTimerFired):
+ Empty stub for now.
+
+ * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
+ (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
+ Call the remote layer tree controller.
+
2012-11-12 Kenneth Rohde Christiansen <[email protected]>
[EFL] Add implementations of device - user conversion methods
Copied: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h (from rev 134256, trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeController.h) (0 => 134259)
--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h (rev 0)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h 2012-11-12 19:04:43 UTC (rev 134259)
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+
+#ifndef RemoteLayerTreeTransaction_h
+#define RemoteLayerTreeTransaction_h
+
+namespace WebKit {
+
+class RemoteLayerTreeTransaction {
+public:
+ enum LayerChange {
+ NoChange = 0,
+ NameChanged = 1 << 1,
+ };
+};
+
+} // namespace WebKit
+
+#endif // RemoteLayerTreeTransaction_h
Copied: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm (from rev 134256, trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeController.h) (0 => 134259)
--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm (rev 0)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm 2012-11-12 19:04:43 UTC (rev 134259)
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+
+#include "config.h"
+#include "RemoteLayerTreeTransaction.h"
Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (134258 => 134259)
--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2012-11-12 19:03:11 UTC (rev 134258)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2012-11-12 19:04:43 UTC (rev 134259)
@@ -254,6 +254,8 @@
1AEFD2F711D1807B008219D3 /* ArgumentCoders.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AEFD2F611D1807B008219D3 /* ArgumentCoders.h */; };
1AF05D8614688348008B1E81 /* TiledCoreAnimationDrawingAreaProxy.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AF05D8414688348008B1E81 /* TiledCoreAnimationDrawingAreaProxy.mm */; };
1AF05D8714688348008B1E81 /* TiledCoreAnimationDrawingAreaProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AF05D8514688348008B1E81 /* TiledCoreAnimationDrawingAreaProxy.h */; };
+ 1AF1AC6B1651759E00C17D7F /* RemoteLayerTreeTransaction.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AF1AC691651759E00C17D7F /* RemoteLayerTreeTransaction.mm */; };
+ 1AF1AC6C1651759E00C17D7F /* RemoteLayerTreeTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AF1AC6A1651759E00C17D7F /* RemoteLayerTreeTransaction.h */; };
1C8E25A81270E3BB00BC7BD0 /* WebInspectorFrontendClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C8E256B1270DE3800BC7BD0 /* WebInspectorFrontendClient.cpp */; };
1C8E25A91270E3BC00BC7BD0 /* WebInspectorFrontendClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C8E256A1270DE3800BC7BD0 /* WebInspectorFrontendClient.h */; };
1C8E28201275D15400BC7BD0 /* WebInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C8E281E1275D15400BC7BD0 /* WebInspector.h */; };
@@ -1441,6 +1443,8 @@
1AEFD2F611D1807B008219D3 /* ArgumentCoders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArgumentCoders.h; sourceTree = "<group>"; };
1AF05D8414688348008B1E81 /* TiledCoreAnimationDrawingAreaProxy.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TiledCoreAnimationDrawingAreaProxy.mm; sourceTree = "<group>"; };
1AF05D8514688348008B1E81 /* TiledCoreAnimationDrawingAreaProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TiledCoreAnimationDrawingAreaProxy.h; sourceTree = "<group>"; };
+ 1AF1AC691651759E00C17D7F /* RemoteLayerTreeTransaction.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteLayerTreeTransaction.mm; sourceTree = "<group>"; };
+ 1AF1AC6A1651759E00C17D7F /* RemoteLayerTreeTransaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteLayerTreeTransaction.h; sourceTree = "<group>"; };
1C77C1951288A872006A742F /* WebInspectorProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebInspectorProxy.messages.in; sourceTree = "<group>"; };
1C8E256A1270DE3800BC7BD0 /* WebInspectorFrontendClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebInspectorFrontendClient.h; sourceTree = "<group>"; };
1C8E256B1270DE3800BC7BD0 /* WebInspectorFrontendClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebInspectorFrontendClient.cpp; sourceTree = "<group>"; };
@@ -3696,6 +3700,8 @@
BCF505E51243047B005955AE /* PlatformCertificateInfo.h */,
BCF505E61243047B005955AE /* PlatformCertificateInfo.mm */,
E1CC1B8F12D7EADF00625838 /* PrintInfoMac.mm */,
+ 1AF1AC6A1651759E00C17D7F /* RemoteLayerTreeTransaction.h */,
+ 1AF1AC691651759E00C17D7F /* RemoteLayerTreeTransaction.mm */,
1AAB4AA91296F1540023952F /* SandboxExtensionMac.mm */,
51D1304F1382EAC000351EDD /* SecItemRequestData.cpp */,
51D130501382EAC000351EDD /* SecItemRequestData.h */,
@@ -4875,6 +4881,7 @@
1AB16AEE164B41E400290D62 /* RemoteGraphicsLayer.h in Headers */,
51217461164C20E30037A5C1 /* ShareableResource.h in Headers */,
51217465164C21370037A5C1 /* WebResourceBuffer.h in Headers */,
+ 1AF1AC6C1651759E00C17D7F /* RemoteLayerTreeTransaction.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -5816,6 +5823,7 @@
1AB16AED164B41E400290D62 /* RemoteGraphicsLayer.mm in Sources */,
51217460164C20E30037A5C1 /* ShareableResource.cpp in Sources */,
51217464164C21370037A5C1 /* WebResourceBuffer.cpp in Sources */,
+ 1AF1AC6B1651759E00C17D7F /* RemoteLayerTreeTransaction.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteGraphicsLayer.h (134258 => 134259)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteGraphicsLayer.h 2012-11-12 19:03:11 UTC (rev 134258)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteGraphicsLayer.h 2012-11-12 19:04:43 UTC (rev 134259)
@@ -41,10 +41,15 @@
RemoteGraphicsLayer(WebCore::GraphicsLayerClient*, RemoteLayerTreeController*);
// WebCore::GraphicsLayer
+ virtual void setName(const String&) OVERRIDE;
virtual void setNeedsDisplay() OVERRIDE;
virtual void setNeedsDisplayInRect(const WebCore::FloatRect&) OVERRIDE;
+ void noteLayerPropertiesChanged(unsigned layerChanges);
+
RemoteLayerTreeController* m_controller;
+
+ unsigned m_uncommittedLayerChanges;
};
} // namespace WebKit
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteGraphicsLayer.mm (134258 => 134259)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteGraphicsLayer.mm 2012-11-12 19:03:11 UTC (rev 134258)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteGraphicsLayer.mm 2012-11-12 19:04:43 UTC (rev 134259)
@@ -26,6 +26,10 @@
#include "config.h"
#include "RemoteGraphicsLayer.h"
+#include "RemoteLayerTreeTransaction.h"
+
+#include <wtf/text/CString.h>
+
using namespace WebCore;
namespace WebKit {
@@ -38,6 +42,7 @@
RemoteGraphicsLayer::RemoteGraphicsLayer(GraphicsLayerClient* client, RemoteLayerTreeController* controller)
: GraphicsLayer(client)
, m_controller(controller)
+ , m_uncommittedLayerChanges(RemoteLayerTreeTransaction::NoChange)
{
// FIXME: This is in place to silence a compiler warning. Remove this
// once we actually start using m_controller.
@@ -48,6 +53,14 @@
{
}
+void RemoteGraphicsLayer::setName(const String& name)
+{
+ String longName = String::format("RemoteGraphicsLayer(%p) ", this) + name;
+ GraphicsLayer::setName(longName);
+
+ noteLayerPropertiesChanged(RemoteLayerTreeTransaction::NameChanged);
+}
+
void RemoteGraphicsLayer::setNeedsDisplay()
{
FloatRect hugeRect(-std::numeric_limits<float>::max() / 2, -std::numeric_limits<float>::max() / 2,
@@ -60,4 +73,11 @@
// FIXME: Implement this.
}
+void RemoteGraphicsLayer::noteLayerPropertiesChanged(unsigned layerChanges)
+{
+ if (!m_uncommittedLayerChanges && m_client)
+ m_client->notifyFlushRequired(this);
+ m_uncommittedLayerChanges |= layerChanges;
+}
+
} // namespace WebKit
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeController.h (134258 => 134259)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeController.h 2012-11-12 19:03:11 UTC (rev 134258)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeController.h 2012-11-12 19:04:43 UTC (rev 134259)
@@ -27,6 +27,7 @@
#define RemoteLayerTree_h
#include <WebCore/GraphicsLayerFactory.h>
+#include <WebCore/Timer.h>
namespace WebKit {
@@ -35,11 +36,17 @@
static PassOwnPtr<RemoteLayerTreeController> create();
~RemoteLayerTreeController();
+ void scheduleLayerFlush();
+
private:
RemoteLayerTreeController();
// WebCore::GraphicsLayerFactory
virtual PassOwnPtr<WebCore::GraphicsLayer> createGraphicsLayer(WebCore::GraphicsLayerClient*) OVERRIDE;
+
+ void layerFlushTimerFired(WebCore::Timer<RemoteLayerTreeController>*);
+
+ WebCore::Timer<RemoteLayerTreeController> m_layerFlushTimer;
};
} // namespace WebKit
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeController.mm (134258 => 134259)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeController.mm 2012-11-12 19:03:11 UTC (rev 134258)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeController.mm 2012-11-12 19:04:43 UTC (rev 134259)
@@ -39,6 +39,7 @@
}
RemoteLayerTreeController::RemoteLayerTreeController()
+ : m_layerFlushTimer(this, &RemoteLayerTreeController::layerFlushTimerFired)
{
}
@@ -46,9 +47,22 @@
{
}
+void RemoteLayerTreeController::scheduleLayerFlush()
+{
+ if (m_layerFlushTimer.isActive())
+ return;
+
+ m_layerFlushTimer.startOneShot(0);
+}
+
PassOwnPtr<GraphicsLayer> RemoteLayerTreeController::createGraphicsLayer(GraphicsLayerClient* client)
{
return RemoteGraphicsLayer::create(client, this);
}
+void RemoteLayerTreeController::layerFlushTimerFired(WebCore::Timer<RemoteLayerTreeController>*)
+{
+ // FIXME: Package up the transaction and send it to the UI process.
+}
+
} // namespace WebKit
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm (134258 => 134259)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm 2012-11-12 19:03:11 UTC (rev 134258)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm 2012-11-12 19:04:43 UTC (rev 134259)
@@ -66,6 +66,7 @@
void RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush()
{
+ m_remoteLayerTreeController->scheduleLayerFlush();
}
} // namespace WebKit