Title: [109812] trunk/Source
- Revision
- 109812
- Author
- [email protected]
- Date
- 2012-03-05 16:13:55 -0800 (Mon, 05 Mar 2012)
Log Message
Be more aggressive about repainting page overlays
https://bugs.webkit.org/show_bug.cgi?id=80336
<rdar://problem/10965943>
Reviewed by Simon Fraser.
Source/WebCore:
Add a way to find out if a given GraphicsLayer is going to be repainted.
* WebCore.exp.in:
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::needsDisplay):
(GraphicsLayer):
* platform/graphics/ca/GraphicsLayerCA.h:
Source/WebKit2:
Whenever we're flushing layers and we have a page overlay, check if the main frame
has scrolled or if the main frame root content layer needs to be repainted and force the
overlay layer to be repainted if either of those conditions are true.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
(TiledCoreAnimationDrawingArea):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::shouldRepaintPageOverlayLayer):
(WebKit):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (109811 => 109812)
--- trunk/Source/WebCore/ChangeLog 2012-03-06 00:13:51 UTC (rev 109811)
+++ trunk/Source/WebCore/ChangeLog 2012-03-06 00:13:55 UTC (rev 109812)
@@ -1,3 +1,19 @@
+2012-03-05 Anders Carlsson <[email protected]>
+
+ Be more aggressive about repainting page overlays
+ https://bugs.webkit.org/show_bug.cgi?id=80336
+ <rdar://problem/10965943>
+
+ Reviewed by Simon Fraser.
+
+ Add a way to find out if a given GraphicsLayer is going to be repainted.
+
+ * WebCore.exp.in:
+ * platform/graphics/GraphicsLayer.h:
+ (WebCore::GraphicsLayer::needsDisplay):
+ (GraphicsLayer):
+ * platform/graphics/ca/GraphicsLayerCA.h:
+
2012-03-05 Robin Cao <[email protected]>
[BlackBerry] Upstream LayerRendererSurface.{cpp, h}
Modified: trunk/Source/WebCore/WebCore.exp.in (109811 => 109812)
--- trunk/Source/WebCore/WebCore.exp.in 2012-03-06 00:13:51 UTC (rev 109811)
+++ trunk/Source/WebCore/WebCore.exp.in 2012-03-06 00:13:55 UTC (rev 109812)
@@ -143,6 +143,7 @@
__ZN7WebCore10JSDocument6s_infoE
__ZN7WebCore10MouseEvent6createERKN3WTF12AtomicStringENS1_10PassRefPtrINS_9DOMWindowEEERKNS_18PlatformMouseEventEiNS5_INS_4NodeEEE
__ZN7WebCore10MouseEventC1ERKN3WTF12AtomicStringEbbNS1_10PassRefPtrINS_9DOMWindowEEEiiiiibbbbtNS5_INS_11EventTargetEEENS5_INS_9ClipboardEEEb
+__ZN7WebCore10RenderView10compositorEv
__ZN7WebCore10ShadowTree20removeAllShadowRootsEv
__ZN7WebCore10ScrollView17setUseFixedLayoutEb
__ZN7WebCore10ScrollView18setFixedLayoutSizeERKNS_7IntSizeE
@@ -1329,6 +1330,8 @@
__ZNK7WebCore21BackForwardController12forwardCountEv
__ZNK7WebCore21BackForwardController9backCountEv
__ZNK7WebCore21UserContentURLPattern7matchesERKNS_4KURLE
+__ZNK7WebCore21RenderLayerCompositor11scrollLayerEv
+__ZNK7WebCore21RenderLayerCompositor15rootRenderLayerEv
__ZNK7WebCore23AuthenticationChallenge20authenticationClientEv
__ZNK7WebCore23FrameLoaderStateMachine15firstLayoutDoneEv
__ZNK7WebCore23FrameLoaderStateMachine23committingFirstRealLoadEv
Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.h (109811 => 109812)
--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.h 2012-03-06 00:13:51 UTC (rev 109811)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.h 2012-03-06 00:13:55 UTC (rev 109812)
@@ -343,7 +343,8 @@
virtual void setNeedsDisplay() = 0;
// mark the given rect (in layer coords) as needing dispay. Never goes deep.
virtual void setNeedsDisplayInRect(const FloatRect&) = 0;
-
+ virtual bool needsDisplay() const { return false; }
+
virtual void setContentsNeedsDisplay() { };
// Set that the position/size of the contents (image or video).
Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (109811 => 109812)
--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h 2012-03-06 00:13:51 UTC (rev 109811)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h 2012-03-06 00:13:55 UTC (rev 109812)
@@ -103,6 +103,7 @@
virtual void setNeedsDisplay();
virtual void setNeedsDisplayInRect(const FloatRect&);
+ virtual bool needsDisplay() const OVERRIDE { return !m_dirtyRects.isEmpty(); }
virtual void setContentsNeedsDisplay();
virtual void setContentsRect(const IntRect&);
Modified: trunk/Source/WebKit2/ChangeLog (109811 => 109812)
--- trunk/Source/WebKit2/ChangeLog 2012-03-06 00:13:51 UTC (rev 109811)
+++ trunk/Source/WebKit2/ChangeLog 2012-03-06 00:13:55 UTC (rev 109812)
@@ -1,3 +1,22 @@
+2012-03-05 Anders Carlsson <[email protected]>
+
+ Be more aggressive about repainting page overlays
+ https://bugs.webkit.org/show_bug.cgi?id=80336
+ <rdar://problem/10965943>
+
+ Reviewed by Simon Fraser.
+
+ Whenever we're flushing layers and we have a page overlay, check if the main frame
+ has scrolled or if the main frame root content layer needs to be repainted and force the
+ overlay layer to be repainted if either of those conditions are true.
+
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
+ (TiledCoreAnimationDrawingArea):
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+ (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
+ (WebKit::TiledCoreAnimationDrawingArea::shouldRepaintPageOverlayLayer):
+ (WebKit):
+
2012-03-05 Sam Weinig <[email protected]>
Add support for hosting layers in the window server in WebKit2
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h (109811 => 109812)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h 2012-03-06 00:13:51 UTC (rev 109811)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h 2012-03-06 00:13:55 UTC (rev 109812)
@@ -83,6 +83,8 @@
void createPageOverlayLayer();
void destroyPageOverlayLayer();
+ bool shouldRepaintPageOverlayLayer();
+
bool m_layerTreeStateIsFrozen;
WebCore::LayerFlushScheduler m_layerFlushScheduler;
@@ -93,6 +95,7 @@
RetainPtr<CALayer> m_pendingRootCompositingLayer;
OwnPtr<WebCore::GraphicsLayer> m_pageOverlayLayer;
+ WebCore::FloatPoint m_mainFrameScrollLayerPosition;
};
} // namespace WebKit
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (109811 => 109812)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2012-03-06 00:13:51 UTC (rev 109811)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2012-03-06 00:13:55 UTC (rev 109812)
@@ -37,6 +37,8 @@
#import <WebCore/FrameView.h>
#import <WebCore/GraphicsContext.h>
#import <WebCore/Page.h>
+#import <WebCore/RenderLayerCompositor.h>
+#import <WebCore/RenderView.h>
#import <WebCore/ScrollingCoordinator.h>
#import <WebCore/Settings.h>
@@ -216,8 +218,12 @@
m_pendingRootCompositingLayer = nullptr;
}
- if (m_pageOverlayLayer)
+ if (m_pageOverlayLayer) {
+ if (shouldRepaintPageOverlayLayer())
+ m_pageOverlayLayer->setNeedsDisplay();
+
m_pageOverlayLayer->syncCompositingStateForThisLayerOnly();
+ }
bool returnValue = m_webPage->corePage()->mainFrame()->view()->syncCompositingStateIncludingSubframes();
@@ -327,4 +333,20 @@
m_pageOverlayLayer = nullptr;
}
+bool TiledCoreAnimationDrawingArea::shouldRepaintPageOverlayLayer()
+{
+ RenderLayerCompositor* renderLayerCompositor = m_webPage->corePage()->mainFrame()->contentRenderer()->compositor();
+ GraphicsLayer* scrollLayer = renderLayerCompositor->scrollLayer();
+ if (m_mainFrameScrollLayerPosition != scrollLayer->position()) {
+ m_mainFrameScrollLayerPosition = scrollLayer->position();
+ return true;
+ }
+
+ GraphicsLayer* rootGraphicsLayer = renderLayerCompositor->rootRenderLayer()->backing()->graphicsLayer();
+ if (rootGraphicsLayer->needsDisplay())
+ return true;
+
+ return false;
+}
+
} // namespace WebKit
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes