Title: [132708] trunk/Source/WebKit/chromium
- Revision
- 132708
- Author
- commit-qu...@webkit.org
- Date
- 2012-10-26 16:03:27 -0700 (Fri, 26 Oct 2012)
Log Message
[chromium] Allow embedder to enter/leave force compositing mode
https://bugs.webkit.org/show_bug.cgi?id=100458
Patch by James Robinson <jam...@chromium.org> on 2012-10-26
Reviewed by Adrienne Walker.
This adds API for the embedder to decide when to enter and leave force compositing mode since it's
more efficient to only toggle this setting when the embedder is about to produce a frame.
* public/WebWidget.h:
(WebWidget):
(WebKit::WebWidget::enterForceCompositingMode):
* src/WebFrameImpl.cpp:
(WebKit::WebViewImpl::enterForceCompositingMode):
(WebKit):
* src/WebViewImpl.h:
(WebViewImpl):
Modified Paths
Diff
Modified: trunk/Source/WebKit/chromium/ChangeLog (132707 => 132708)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-10-26 22:59:39 UTC (rev 132707)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-10-26 23:03:27 UTC (rev 132708)
@@ -1,3 +1,22 @@
+2012-10-26 James Robinson <jam...@chromium.org>
+
+ [chromium] Allow embedder to enter/leave force compositing mode
+ https://bugs.webkit.org/show_bug.cgi?id=100458
+
+ Reviewed by Adrienne Walker.
+
+ This adds API for the embedder to decide when to enter and leave force compositing mode since it's
+ more efficient to only toggle this setting when the embedder is about to produce a frame.
+
+ * public/WebWidget.h:
+ (WebWidget):
+ (WebKit::WebWidget::enterForceCompositingMode):
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebViewImpl::enterForceCompositingMode):
+ (WebKit):
+ * src/WebViewImpl.h:
+ (WebViewImpl):
+
2012-10-26 Dominic Mazzoni <dmazz...@google.com>
AX: Notification should be sent when accessibilityIsIgnored changes
Modified: trunk/Source/WebKit/chromium/public/WebWidget.h (132707 => 132708)
--- trunk/Source/WebKit/chromium/public/WebWidget.h 2012-10-26 22:59:39 UTC (rev 132707)
+++ trunk/Source/WebKit/chromium/public/WebWidget.h 2012-10-26 23:03:27 UTC (rev 132708)
@@ -83,14 +83,16 @@
// Called to update imperative animation state. This should be called before
// paint, although the client can rate-limit these calls.
- //
- // FIXME: remove this function entirely when inversion patches land.
virtual void animate(double ignored) { }
// Called to layout the WebWidget. This MUST be called before Paint,
// and it may result in calls to WebWidgetClient::didInvalidateRect.
virtual void layout() { }
+ // Called to toggle the WebWidget in or out of force compositing mode. This
+ // should be called before paint.
+ virtual void enterForceCompositingMode(bool enter) { }
+
enum PaintOptions {
// Attempt to fulfill the painting request by reading back from the
// compositor, assuming we're using a compositor to render.
Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (132707 => 132708)
--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp 2012-10-26 22:59:39 UTC (rev 132707)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp 2012-10-26 23:03:27 UTC (rev 132708)
@@ -1760,6 +1760,20 @@
m_linkHighlight->updateGeometry();
}
+void WebViewImpl::enterForceCompositingMode(bool enter)
+{
+ TRACE_EVENT1("webkit", "WebViewImpl::enterForceCompositingMode", "enter", enter);
+ settingsImpl()->setForceCompositingMode(enter);
+ if (enter) {
+ if (!m_page)
+ return;
+ Frame* mainFrame = m_page->mainFrame();
+ if (!mainFrame)
+ return;
+ mainFrame->view()->updateCompositingLayersAfterStyleChange();
+ }
+}
+
#if USE(ACCELERATED_COMPOSITING)
void WebViewImpl::doPixelReadbackToCanvas(WebCanvas* canvas, const IntRect& rect)
{
Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.h (132707 => 132708)
--- trunk/Source/WebKit/chromium/src/WebViewImpl.h 2012-10-26 22:59:39 UTC (rev 132707)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.h 2012-10-26 23:03:27 UTC (rev 132708)
@@ -145,6 +145,7 @@
virtual void setCompositorSurfaceReady();
virtual void animate(double);
virtual void layout(); // Also implements WebLayerTreeViewClient::layout()
+ virtual void enterForceCompositingMode(bool enable) OVERRIDE;
virtual void paint(WebCanvas*, const WebRect&, PaintOptions = ReadbackFromCompositorIfAvailable);
virtual void themeChanged();
virtual void composite(bool finish);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes