[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
simon.fraser at apple.com
simon.fraser at apple.com
Wed Dec 22 14:41:18 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 2e6f3507fad6b16f82c4c8a9389ff5dad41e6337
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Oct 15 22:33:34 2010 +0000
2010-10-15 Simon Fraser <simon.fraser at apple.com>
Reviewed by Dan Bernstein.
Add 'didDraw' callback for framerate tracking
https://bugs.webkit.org/show_bug.cgi?id=47478
Hook up the 'didDraw' callback for WebKit2 on Mac.
* UIProcess/API/C/WKPage.h:
* UIProcess/API/mac/WKView.mm:
(-[WKView drawRect:]):
* UIProcess/API/qt/qwkpage.cpp:
(QWKPage::QWKPage):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didDraw):
* UIProcess/WebPageProxy.h:
* UIProcess/WebUIClient.cpp:
(WebKit::WebUIClient::didDraw):
* UIProcess/WebUIClient.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69892 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index ff4e09d..2fc8462 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,24 @@
+2010-10-15 Simon Fraser <simon.fraser at apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Add 'didDraw' callback for framerate tracking
+ https://bugs.webkit.org/show_bug.cgi?id=47478
+
+ Hook up the 'didDraw' callback for WebKit2 on Mac.
+
+ * UIProcess/API/C/WKPage.h:
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView drawRect:]):
+ * UIProcess/API/qt/qwkpage.cpp:
+ (QWKPage::QWKPage):
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::didDraw):
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/WebUIClient.cpp:
+ (WebKit::WebUIClient::didDraw):
+ * UIProcess/WebUIClient.h:
+
2010-10-15 Anders Carlsson <andersca at apple.com>
Reviewed by Sam Weinig.
diff --git a/WebKit2/UIProcess/API/C/WKPage.h b/WebKit2/UIProcess/API/C/WKPage.h
index c658126..89b1cda 100644
--- a/WebKit2/UIProcess/API/C/WKPage.h
+++ b/WebKit2/UIProcess/API/C/WKPage.h
@@ -142,6 +142,7 @@ typedef void (*WKPageDidNotHandleKeyEventCallback)(WKPageRef page, WKNativeEvent
typedef WKRect (*WKPageGetWindowFrameCallback)(WKPageRef page, const void *clientInfo);
typedef void (*WKPageSetWindowFrameCallback)(WKPageRef page, WKRect frame, const void *clientInfo);
typedef bool (*WKPageRunBeforeUnloadConfirmPanelCallback)(WKPageRef page, WKStringRef message, WKFrameRef frame, const void *clientInfo);
+typedef void (*WKPageDidDraw)(WKPageRef page, const void *clientInfo);
struct WKPageUIClient {
int version;
@@ -159,6 +160,7 @@ struct WKPageUIClient {
WKPageGetWindowFrameCallback getWindowFrame;
WKPageSetWindowFrameCallback setWindowFrame;
WKPageRunBeforeUnloadConfirmPanelCallback runBeforeUnloadConfirmPanel;
+ WKPageDidDraw didDraw;
};
typedef struct WKPageUIClient WKPageUIClient;
diff --git a/WebKit2/UIProcess/API/mac/WKView.mm b/WebKit2/UIProcess/API/mac/WKView.mm
index c8f8bc1..eb01542 100644
--- a/WebKit2/UIProcess/API/mac/WKView.mm
+++ b/WebKit2/UIProcess/API/mac/WKView.mm
@@ -477,6 +477,7 @@ static bool isViewVisible(NSView *view)
if (_data->_page->isValid() && _data->_page->drawingArea()) {
CGContextRef context = static_cast<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]);
_data->_page->drawingArea()->paint(IntRect(rect), context);
+ _data->_page->didDraw();
}
}
diff --git a/WebKit2/UIProcess/API/qt/qwkpage.cpp b/WebKit2/UIProcess/API/qt/qwkpage.cpp
index 2947323..dc68ea1 100644
--- a/WebKit2/UIProcess/API/qt/qwkpage.cpp
+++ b/WebKit2/UIProcess/API/qt/qwkpage.cpp
@@ -300,7 +300,8 @@ QWKPage::QWKPage(WKPageNamespaceRef namespaceRef)
0, /* didNotHandleKeyEvent */
0, /* getWindowFrame */
0, /* setWindowFrame */
- 0 /* runBeforeUnloadConfirmPanel */
+ 0, /* runBeforeUnloadConfirmPanel */
+ 0 /* didDraw */
};
WKPageSetPageUIClient(pageRef(), &uiClient);
}
diff --git a/WebKit2/UIProcess/WebPageProxy.cpp b/WebKit2/UIProcess/WebPageProxy.cpp
index 0a55d19..3088145 100644
--- a/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/WebKit2/UIProcess/WebPageProxy.cpp
@@ -894,6 +894,11 @@ void WebPageProxy::didChangeViewportData(const ViewportArguments& args)
m_pageClient->setViewportArguments(args);
}
+void WebPageProxy::didDraw()
+{
+ m_uiClient.didDraw(this);
+}
+
// BackForwardList
void WebPageProxy::backForwardAddItem(uint64_t itemID)
diff --git a/WebKit2/UIProcess/WebPageProxy.h b/WebKit2/UIProcess/WebPageProxy.h
index 168076e..43528e2 100644
--- a/WebKit2/UIProcess/WebPageProxy.h
+++ b/WebKit2/UIProcess/WebPageProxy.h
@@ -200,6 +200,8 @@ public:
void didLeaveAcceleratedCompositing();
#endif
+ void didDraw();
+
enum UndoOrRedo { Undo, Redo };
void addEditCommand(WebEditCommandProxy*);
void removeEditCommand(WebEditCommandProxy*);
diff --git a/WebKit2/UIProcess/WebUIClient.cpp b/WebKit2/UIProcess/WebUIClient.cpp
index aa31e8f..6f0bde9 100644
--- a/WebKit2/UIProcess/WebUIClient.cpp
+++ b/WebKit2/UIProcess/WebUIClient.cpp
@@ -166,4 +166,13 @@ bool WebUIClient::runBeforeUnloadConfirmPanel(WebPageProxy* page, const String&
return m_pageUIClient.runBeforeUnloadConfirmPanel(toAPI(page), toAPI(message.impl()), toAPI(frame), m_pageUIClient.clientInfo);
}
+void WebUIClient::didDraw(WebPageProxy* page)
+{
+ if (!m_pageUIClient.didDraw)
+ return;
+
+ return m_pageUIClient.didDraw(toAPI(page), m_pageUIClient.clientInfo);
+}
+
+
} // namespace WebKit
diff --git a/WebKit2/UIProcess/WebUIClient.h b/WebKit2/UIProcess/WebUIClient.h
index f24df54..a4b811f 100644
--- a/WebKit2/UIProcess/WebUIClient.h
+++ b/WebKit2/UIProcess/WebUIClient.h
@@ -67,6 +67,8 @@ public:
bool canRunBeforeUnloadConfirmPanel();
bool runBeforeUnloadConfirmPanel(WebPageProxy*, const String&, WebFrameProxy*);
+ void didDraw(WebPageProxy*);
+
private:
WKPageUIClient m_pageUIClient;
};
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list