OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1279 // it does not need paint invalidation just to scroll. | 1279 // it does not need paint invalidation just to scroll. |
1280 if (layer->compositingState() == PaintsIntoOwnBacking) | 1280 if (layer->compositingState() == PaintsIntoOwnBacking) |
1281 continue; | 1281 continue; |
1282 | 1282 |
1283 if (layer->hasAncestorWithFilterOutsets()) { | 1283 if (layer->hasAncestorWithFilterOutsets()) { |
1284 // If the fixed layer has a blur/drop-shadow filter applied on at le
ast one of its parents, we cannot | 1284 // If the fixed layer has a blur/drop-shadow filter applied on at le
ast one of its parents, we cannot |
1285 // scroll using the fast path, otherwise the outsets of the filter w
ill be moved around the page. | 1285 // scroll using the fast path, otherwise the outsets of the filter w
ill be moved around the page. |
1286 return false; | 1286 return false; |
1287 } | 1287 } |
1288 | 1288 |
1289 IntRect updateRect = pixelSnappedIntRect(layer->repainter().repaintRectI
ncludingNonCompositingDescendants()); | 1289 IntRect updateRect = pixelSnappedIntRect(layer->paintInvalidator().repai
ntRectIncludingNonCompositingDescendants()); |
1290 | 1290 |
1291 const RenderLayerModelObject* repaintContainer = layer->renderer()->cont
ainerForPaintInvalidation(); | 1291 const RenderLayerModelObject* repaintContainer = layer->renderer()->cont
ainerForPaintInvalidation(); |
1292 if (repaintContainer && !repaintContainer->isRenderView()) { | 1292 if (repaintContainer && !repaintContainer->isRenderView()) { |
1293 // Invalidate the old and new locations of fixed position elements t
hat are not drawn into the RenderView. | 1293 // Invalidate the old and new locations of fixed position elements t
hat are not drawn into the RenderView. |
1294 updateRect.moveBy(scrollPosition()); | 1294 updateRect.moveBy(scrollPosition()); |
1295 IntRect previousRect = updateRect; | 1295 IntRect previousRect = updateRect; |
1296 previousRect.move(scrollDelta); | 1296 previousRect.move(scrollDelta); |
1297 // FIXME: Rather than uniting the rects, we should just issue both i
nvalidations. | 1297 // FIXME: Rather than uniting the rects, we should just issue both i
nvalidations. |
1298 updateRect.unite(previousRect); | 1298 updateRect.unite(previousRect); |
1299 layer->renderer()->invalidatePaintUsingContainer(repaintContainer, u
pdateRect, InvalidationScroll); | 1299 layer->renderer()->invalidatePaintUsingContainer(repaintContainer, u
pdateRect, InvalidationScroll); |
1300 } else { | 1300 } else { |
1301 // Coalesce the paint invalidations that will be issued to the rende
rView. | 1301 // Coalesce the paint invalidations that will be issued to the rende
rView. |
1302 updateRect = contentsToRootView(updateRect); | 1302 updateRect = contentsToRootView(updateRect); |
1303 if (!updateRect.isEmpty()) | 1303 if (!updateRect.isEmpty()) |
1304 regionToUpdate.unite(updateRect); | 1304 regionToUpdate.unite(updateRect); |
1305 } | 1305 } |
1306 } | 1306 } |
1307 | 1307 |
1308 hostWindow()->scroll(); | 1308 hostWindow()->scroll(); |
1309 | 1309 |
1310 // Invalidate the old and new locations of fixed position elements that are
drawn into the RenderView. | 1310 // Invalidate the old and new locations of fixed position elements that are
drawn into the RenderView. |
1311 Vector<IntRect> subRectsToUpdate = regionToUpdate.rects(); | 1311 Vector<IntRect> subRectsToUpdate = regionToUpdate.rects(); |
1312 size_t viewportConstrainedObjectsCount = subRectsToUpdate.size(); | 1312 size_t viewportConstrainedObjectsCount = subRectsToUpdate.size(); |
1313 for (size_t i = 0; i < viewportConstrainedObjectsCount; ++i) { | 1313 for (size_t i = 0; i < viewportConstrainedObjectsCount; ++i) { |
1314 IntRect updateRect = subRectsToUpdate[i]; | 1314 IntRect updateRect = subRectsToUpdate[i]; |
1315 IntRect scrolledRect = updateRect; | 1315 IntRect scrolledRect = updateRect; |
1316 scrolledRect.move(-scrollDelta); | 1316 scrolledRect.move(-scrollDelta); |
1317 updateRect.unite(scrolledRect); | 1317 updateRect.unite(scrolledRect); |
1318 // FIXME: We should be able to issue these invalidations separately and
before we actually scroll. | 1318 // FIXME: We should be able to issue these invalidations separately and
before we actually scroll. |
1319 renderView()->layer()->repainter().setBackingNeedsRepaintInRect(rootView
ToContents(updateRect)); | 1319 renderView()->layer()->paintInvalidator().setBackingNeedsRepaintInRect(r
ootViewToContents(updateRect)); |
1320 } | 1320 } |
1321 | 1321 |
1322 return true; | 1322 return true; |
1323 } | 1323 } |
1324 | 1324 |
1325 void FrameView::scrollContentsSlowPath(const IntRect& updateRect) | 1325 void FrameView::scrollContentsSlowPath(const IntRect& updateRect) |
1326 { | 1326 { |
1327 if (contentsInCompositedLayer()) { | 1327 if (contentsInCompositedLayer()) { |
1328 IntRect updateRect = visibleContentRect(); | 1328 IntRect updateRect = visibleContentRect(); |
1329 ASSERT(renderView()); | 1329 ASSERT(renderView()); |
1330 renderView()->layer()->repainter().setBackingNeedsRepaintInRect(updateRe
ct); | 1330 renderView()->layer()->paintInvalidator().setBackingNeedsRepaintInRect(u
pdateRect); |
1331 } | 1331 } |
1332 if (RenderPart* frameRenderer = m_frame->ownerRenderer()) { | 1332 if (RenderPart* frameRenderer = m_frame->ownerRenderer()) { |
1333 if (isEnclosedInCompositingLayer()) { | 1333 if (isEnclosedInCompositingLayer()) { |
1334 LayoutRect rect(frameRenderer->borderLeft() + frameRenderer->padding
Left(), | 1334 LayoutRect rect(frameRenderer->borderLeft() + frameRenderer->padding
Left(), |
1335 frameRenderer->borderTop() + frameRenderer->paddingT
op(), | 1335 frameRenderer->borderTop() + frameRenderer->paddingT
op(), |
1336 visibleWidth(), visibleHeight()); | 1336 visibleWidth(), visibleHeight()); |
1337 frameRenderer->invalidatePaintRectangle(rect); | 1337 frameRenderer->invalidatePaintRectangle(rect); |
1338 return; | 1338 return; |
1339 } | 1339 } |
1340 } | 1340 } |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1563 | 1563 |
1564 // Fixed items should always have layers. | 1564 // Fixed items should always have layers. |
1565 ASSERT(renderer->hasLayer()); | 1565 ASSERT(renderer->hasLayer()); |
1566 | 1566 |
1567 RenderLayer* layer = toRenderBoxModelObject(renderer)->layer(); | 1567 RenderLayer* layer = toRenderBoxModelObject(renderer)->layer(); |
1568 | 1568 |
1569 // Don't need to do this for composited fixed items. | 1569 // Don't need to do this for composited fixed items. |
1570 if (layer->compositingState() == PaintsIntoOwnBacking) | 1570 if (layer->compositingState() == PaintsIntoOwnBacking) |
1571 continue; | 1571 continue; |
1572 | 1572 |
1573 layer->repainter().computeRepaintRectsIncludingNonCompositingDescendants
(); | 1573 layer->paintInvalidator().computePaintInvalidationRectsIncludingNonCompo
sitingDescendants(); |
1574 } | 1574 } |
1575 } | 1575 } |
1576 | 1576 |
1577 void FrameView::updateCompositedSelectionBoundsIfNeeded() | 1577 void FrameView::updateCompositedSelectionBoundsIfNeeded() |
1578 { | 1578 { |
1579 if (!RuntimeEnabledFeatures::compositedSelectionUpdatesEnabled()) | 1579 if (!RuntimeEnabledFeatures::compositedSelectionUpdatesEnabled()) |
1580 return; | 1580 return; |
1581 | 1581 |
1582 Page* page = frame().page(); | 1582 Page* page = frame().page(); |
1583 ASSERT(page); | 1583 ASSERT(page); |
(...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2967 | 2967 |
2968 void FrameView::setTracksPaintInvalidations(bool trackPaintInvalidations) | 2968 void FrameView::setTracksPaintInvalidations(bool trackPaintInvalidations) |
2969 { | 2969 { |
2970 if (trackPaintInvalidations == m_isTrackingPaintInvalidations) | 2970 if (trackPaintInvalidations == m_isTrackingPaintInvalidations) |
2971 return; | 2971 return; |
2972 | 2972 |
2973 for (Frame* frame = m_frame->tree().top(); frame; frame = frame->tree().trav
erseNext()) { | 2973 for (Frame* frame = m_frame->tree().top(); frame; frame = frame->tree().trav
erseNext()) { |
2974 if (!frame->isLocalFrame()) | 2974 if (!frame->isLocalFrame()) |
2975 continue; | 2975 continue; |
2976 if (RenderView* renderView = toLocalFrame(frame)->contentRenderer()) | 2976 if (RenderView* renderView = toLocalFrame(frame)->contentRenderer()) |
2977 renderView->compositor()->setTracksRepaints(trackPaintInvalidations)
; | 2977 renderView->compositor()->setTracksPaintInvalidations(trackPaintInva
lidations); |
2978 } | 2978 } |
2979 | 2979 |
2980 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), | 2980 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), |
2981 "FrameView::setTracksPaintInvalidations", "enabled", trackPaintInvalidat
ions); | 2981 "FrameView::setTracksPaintInvalidations", "enabled", trackPaintInvalidat
ions); |
2982 | 2982 |
2983 resetTrackedPaintInvalidations(); | 2983 resetTrackedPaintInvalidations(); |
2984 m_isTrackingPaintInvalidations = trackPaintInvalidations; | 2984 m_isTrackingPaintInvalidations = trackPaintInvalidations; |
2985 } | 2985 } |
2986 | 2986 |
2987 void FrameView::resetTrackedPaintInvalidations() | 2987 void FrameView::resetTrackedPaintInvalidations() |
2988 { | 2988 { |
2989 m_trackedPaintInvalidationRects.clear(); | 2989 m_trackedPaintInvalidationRects.clear(); |
2990 if (RenderView* renderView = this->renderView()) | 2990 if (RenderView* renderView = this->renderView()) |
2991 renderView->compositor()->resetTrackedRepaintRects(); | 2991 renderView->compositor()->resetTrackedPaintInvalidationRects(); |
2992 } | 2992 } |
2993 | 2993 |
2994 String FrameView::trackedPaintInvalidationRectsAsText() const | 2994 String FrameView::trackedPaintInvalidationRectsAsText() const |
2995 { | 2995 { |
2996 TextStream ts; | 2996 TextStream ts; |
2997 if (!m_trackedPaintInvalidationRects.isEmpty()) { | 2997 if (!m_trackedPaintInvalidationRects.isEmpty()) { |
2998 ts << "(repaint rects\n"; | 2998 ts << "(repaint rects\n"; |
2999 for (size_t i = 0; i < m_trackedPaintInvalidationRects.size(); ++i) | 2999 for (size_t i = 0; i < m_trackedPaintInvalidationRects.size(); ++i) |
3000 ts << " (rect " << m_trackedPaintInvalidationRects[i].x() << " " <<
m_trackedPaintInvalidationRects[i].y() << " " << m_trackedPaintInvalidationRect
s[i].width() << " " << m_trackedPaintInvalidationRects[i].height() << ")\n"; | 3000 ts << " (rect " << m_trackedPaintInvalidationRects[i].x() << " " <<
m_trackedPaintInvalidationRects[i].y() << " " << m_trackedPaintInvalidationRect
s[i].width() << " " << m_trackedPaintInvalidationRects[i].height() << ")\n"; |
3001 ts << ")\n"; | 3001 ts << ")\n"; |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3131 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o
rientation) | 3131 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o
rientation) |
3132 { | 3132 { |
3133 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); | 3133 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); |
3134 if (AXObjectCache* cache = axObjectCache()) { | 3134 if (AXObjectCache* cache = axObjectCache()) { |
3135 cache->remove(scrollbar); | 3135 cache->remove(scrollbar); |
3136 cache->handleScrollbarUpdate(this); | 3136 cache->handleScrollbarUpdate(this); |
3137 } | 3137 } |
3138 } | 3138 } |
3139 | 3139 |
3140 } // namespace blink | 3140 } // namespace blink |
OLD | NEW |