summaryrefslogtreecommitdiff
path: root/Source/WebCore/page/FrameView.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-08-12 09:27:39 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-08-12 09:27:39 +0200
commit3749d61e1f7a59f5ec5067e560af1eb610c82015 (patch)
tree73dc228333948738bbe02976cacca8cd382bc978 /Source/WebCore/page/FrameView.cpp
parentb32b4dcd9a51ab8de6afc53d9e17f8707e1f7a5e (diff)
downloadqtwebkit-3749d61e1f7a59f5ec5067e560af1eb610c82015.tar.gz
Imported WebKit commit a77350243e054f3460d1137301d8b3faee3d2052 (http://svn.webkit.org/repository/webkit/trunk@125365)
New snapshot with build fixes for latest API changes in Qt and all WK1 Win MSVC fixes upstream
Diffstat (limited to 'Source/WebCore/page/FrameView.cpp')
-rw-r--r--Source/WebCore/page/FrameView.cpp48
1 files changed, 41 insertions, 7 deletions
diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp
index 931999495..cc53d99b0 100644
--- a/Source/WebCore/page/FrameView.cpp
+++ b/Source/WebCore/page/FrameView.cpp
@@ -1153,7 +1153,7 @@ void FrameView::layout(bool allowSubtree)
if (AXObjectCache::accessibilityEnabled())
root->document()->axObjectCache()->postNotification(root, AXObjectCache::AXLayoutComplete, true);
#endif
-#if ENABLE(DASHBOARD_SUPPORT)
+#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
updateDashboardRegions();
#endif
@@ -1491,10 +1491,6 @@ bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect
regionToUpdate.unite(updateRect);
}
- // The area to be painted by fixed objects exceeds 50% of the area of the view, we cannot use the fast path.
- if (regionToUpdate.totalArea() > (clipRect.width() * clipRect.height() * 0.5))
- return false;
-
// 1) scroll
hostWindow()->scroll(scrollDelta, rectToScroll, clipRect);
@@ -2776,7 +2772,7 @@ bool FrameView::scrollAnimatorEnabled() const
return false;
}
-#if ENABLE(DASHBOARD_SUPPORT)
+#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
void FrameView::updateDashboardRegions()
{
Document* document = m_frame->document();
@@ -3118,7 +3114,7 @@ void FrameView::paintContents(GraphicsContext* p, const IntRect& rect)
m_paintBehavior = oldPaintBehavior;
m_lastPaintTime = currentTime();
-#if ENABLE(DASHBOARD_SUPPORT)
+#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
// Regions may have changed as a result of the visibility/z-index of element changing.
if (document->dashboardRegionsDirty())
updateDashboardRegions();
@@ -3150,6 +3146,36 @@ void FrameView::setNodeToDraw(Node* node)
m_nodeToDraw = node;
}
+void FrameView::paintContentsForSnapshot(GraphicsContext* context, const IntRect& imageRect, SelectionInSnaphot shouldPaintSelection)
+{
+ updateLayoutAndStyleIfNeededRecursive();
+
+ // Cache paint behavior and set a new behavior appropriate for snapshots.
+ PaintBehavior oldBehavior = paintBehavior();
+ setPaintBehavior(oldBehavior | PaintBehaviorFlattenCompositingLayers);
+
+ // If the snapshot should exclude selection, then we'll clear the current selection
+ // in the render tree only. This will allow us to restore the selection from the DOM
+ // after we paint the snapshot.
+ if (shouldPaintSelection == ExcludeSelection) {
+ for (Frame* frame = m_frame.get(); frame; frame = frame->tree()->traverseNext(m_frame.get())) {
+ if (RenderView* root = frame->contentRenderer())
+ root->clearSelection();
+ }
+ }
+
+ paintContents(context, imageRect);
+
+ // Restore selection.
+ if (shouldPaintSelection == ExcludeSelection) {
+ for (Frame* frame = m_frame.get(); frame; frame = frame->tree()->traverseNext(m_frame.get()))
+ frame->selection()->updateAppearance();
+ }
+
+ // Restore cached paint behavior.
+ setPaintBehavior(oldBehavior);
+}
+
void FrameView::paintOverhangAreas(GraphicsContext* context, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect)
{
if (context->paintingDisabled())
@@ -3575,4 +3601,12 @@ AXObjectCache* FrameView::axObjectCache() const
return 0;
}
+void FrameView::setScrollingPerformanceLoggingEnabled(bool flag)
+{
+#if USE(ACCELERATED_COMPOSITING)
+ if (TiledBacking* tiledBacking = this->tiledBacking())
+ tiledBacking->setScrollingPerformanceLoggingEnabled(flag);
+#endif
+}
+
} // namespace WebCore