Diff
Modified: trunk/Source/WebKit2/ChangeLog (134292 => 134293)
--- trunk/Source/WebKit2/ChangeLog 2012-11-12 21:14:48 UTC (rev 134292)
+++ trunk/Source/WebKit2/ChangeLog 2012-11-12 21:16:39 UTC (rev 134293)
@@ -1,5 +1,34 @@
2012-11-12 Anders Carlsson <[email protected]>
+ More work towards packaging layer changes up into a transaction object
+ https://bugs.webkit.org/show_bug.cgi?id=101969
+
+ Reviewed by Andreas Kling.
+
+ * Shared/mac/RemoteLayerTreeTransaction.h:
+ * Shared/mac/RemoteLayerTreeTransaction.mm:
+ (WebKit::RemoteLayerTreeTransaction::RemoteLayerTreeTransaction):
+ (WebKit::RemoteLayerTreeTransaction::~RemoteLayerTreeTransaction):
+ (WebKit::RemoteLayerTreeTransaction::layerPropertiesChanged):
+ Add empty stubs.
+
+ * WebProcess/WebPage/mac/RemoteGraphicsLayer.mm:
+ (WebKit::RemoteGraphicsLayer::flushCompositingStateForThisLayerOnly):
+ Call layerPropertiesChanged on the current transaction.
+
+ * WebProcess/WebPage/mac/RemoteLayerTreeController.h:
+ * WebProcess/WebPage/mac/RemoteLayerTreeController.mm:
+ (WebKit::RemoteLayerTreeController::RemoteLayerTreeController):
+ Initialize m_currentTransaction till 0.
+
+ (WebKit::RemoteLayerTreeController::currentTransaction):
+ Add getter. This may only be called from beneath flushLayers.
+
+ (WebKit::RemoteLayerTreeController::flushLayers):
+ Create a transaction before flusing the compositing state.
+
+2012-11-12 Anders Carlsson <[email protected]>
+
More work on remote layer flushing
https://bugs.webkit.org/show_bug.cgi?id=101960
Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h (134292 => 134293)
--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h 2012-11-12 21:14:48 UTC (rev 134292)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h 2012-11-12 21:16:39 UTC (rev 134293)
@@ -28,12 +28,19 @@
namespace WebKit {
+class RemoteGraphicsLayer;
+
class RemoteLayerTreeTransaction {
public:
enum LayerChange {
NoChange = 0,
NameChanged = 1 << 1,
};
+
+ RemoteLayerTreeTransaction();
+ ~RemoteLayerTreeTransaction();
+
+ void layerPropertiesChanged(const RemoteGraphicsLayer*, unsigned layerChanges);
};
} // namespace WebKit
Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm (134292 => 134293)
--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm 2012-11-12 21:14:48 UTC (rev 134292)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm 2012-11-12 21:16:39 UTC (rev 134293)
@@ -25,3 +25,20 @@
#include "config.h"
#include "RemoteLayerTreeTransaction.h"
+
+namespace WebKit {
+
+RemoteLayerTreeTransaction::RemoteLayerTreeTransaction()
+{
+}
+
+RemoteLayerTreeTransaction::~RemoteLayerTreeTransaction()
+{
+}
+
+void RemoteLayerTreeTransaction::layerPropertiesChanged(const RemoteGraphicsLayer*, unsigned layerChanges)
+{
+ // FIXME: Implement this.
+}
+
+} // namespace WebKit
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteGraphicsLayer.mm (134292 => 134293)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteGraphicsLayer.mm 2012-11-12 21:14:48 UTC (rev 134292)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteGraphicsLayer.mm 2012-11-12 21:16:39 UTC (rev 134293)
@@ -26,6 +26,7 @@
#include "config.h"
#include "RemoteGraphicsLayer.h"
+#include "RemoteLayerTreeController.h"
#include "RemoteLayerTreeTransaction.h"
#include <wtf/text/CString.h>
@@ -80,7 +81,12 @@
void RemoteGraphicsLayer::flushCompositingStateForThisLayerOnly()
{
- // FIXME: Flush the changed properties.
+ if (!m_uncommittedLayerChanges)
+ return;
+
+ m_controller->currentTransaction().layerPropertiesChanged(this, m_uncommittedLayerChanges);
+
+ m_uncommittedLayerChanges = RemoteLayerTreeTransaction::NoChange;
}
void RemoteGraphicsLayer::noteLayerPropertiesChanged(unsigned layerChanges)
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeController.h (134292 => 134293)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeController.h 2012-11-12 21:14:48 UTC (rev 134292)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeController.h 2012-11-12 21:16:39 UTC (rev 134293)
@@ -31,6 +31,7 @@
namespace WebKit {
+class RemoteLayerTreeTransaction;
class WebPage;
class RemoteLayerTreeController : public WebCore::GraphicsLayerFactory {
@@ -41,6 +42,8 @@
void setRootLayer(WebCore::GraphicsLayer*);
void scheduleLayerFlush();
+ RemoteLayerTreeTransaction& currentTransaction();
+
private:
explicit RemoteLayerTreeController(WebPage*);
@@ -52,6 +55,7 @@
WebPage* m_webPage;
WebCore::Timer<RemoteLayerTreeController> m_layerFlushTimer;
+ RemoteLayerTreeTransaction* m_currentTransaction;
};
} // namespace WebKit
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeController.mm (134292 => 134293)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeController.mm 2012-11-12 21:14:48 UTC (rev 134292)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeController.mm 2012-11-12 21:16:39 UTC (rev 134293)
@@ -27,11 +27,13 @@
#import "RemoteLayerTreeController.h"
#import "RemoteGraphicsLayer.h"
+#import "RemoteLayerTreeTransaction.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;
@@ -45,6 +47,7 @@
RemoteLayerTreeController::RemoteLayerTreeController(WebPage* webPage)
: m_webPage(webPage)
, m_layerFlushTimer(this, &RemoteLayerTreeController::layerFlushTimerFired)
+ , m_currentTransaction(0)
{
}
@@ -64,6 +67,13 @@
m_layerFlushTimer.startOneShot(0);
}
+RemoteLayerTreeTransaction& RemoteLayerTreeController::currentTransaction()
+{
+ ASSERT(m_currentTransaction);
+
+ return *m_currentTransaction;
+}
+
PassOwnPtr<GraphicsLayer> RemoteLayerTreeController::createGraphicsLayer(GraphicsLayerClient* client)
{
return RemoteGraphicsLayer::create(client, this);
@@ -76,6 +86,11 @@
void RemoteLayerTreeController::flushLayers()
{
+ ASSERT(!m_currentTransaction);
+
+ RemoteLayerTreeTransaction transaction;
+ TemporaryChange<RemoteLayerTreeTransaction*> transactionChange(m_currentTransaction, &transaction);
+
m_webPage->layoutIfNeeded();
m_webPage->corePage()->mainFrame()->view()->flushCompositingStateIncludingSubframes();