| 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 m_layoutSchedulingEnabled = true; | 244 m_layoutSchedulingEnabled = true; |
| 245 m_inSynchronousPostLayout = false; | 245 m_inSynchronousPostLayout = false; |
| 246 m_layoutCount = 0; | 246 m_layoutCount = 0; |
| 247 m_nestedLayoutCount = 0; | 247 m_nestedLayoutCount = 0; |
| 248 m_postLayoutTasksTimer.stop(); | 248 m_postLayoutTasksTimer.stop(); |
| 249 m_updateWidgetsTimer.stop(); | 249 m_updateWidgetsTimer.stop(); |
| 250 m_firstLayout = true; | 250 m_firstLayout = true; |
| 251 m_safeToPropagateScrollToParent = true; | 251 m_safeToPropagateScrollToParent = true; |
| 252 m_lastViewportSize = IntSize(); | 252 m_lastViewportSize = IntSize(); |
| 253 m_lastZoomFactor = 1.0f; | 253 m_lastZoomFactor = 1.0f; |
| 254 m_trackedObjectPaintInvalidations = wrapUnique( | 254 m_trackedObjectPaintInvalidations = WTF::wrapUnique( |
| 255 s_initialTrackAllPaintInvalidations ? new Vector<ObjectPaintInvalidation> | 255 s_initialTrackAllPaintInvalidations ? new Vector<ObjectPaintInvalidation> |
| 256 : nullptr); | 256 : nullptr); |
| 257 m_visuallyNonEmptyCharacterCount = 0; | 257 m_visuallyNonEmptyCharacterCount = 0; |
| 258 m_visuallyNonEmptyPixelCount = 0; | 258 m_visuallyNonEmptyPixelCount = 0; |
| 259 m_isVisuallyNonEmpty = false; | 259 m_isVisuallyNonEmpty = false; |
| 260 m_layoutObjectCounter.reset(); | 260 m_layoutObjectCounter.reset(); |
| 261 clearFragmentAnchor(); | 261 clearFragmentAnchor(); |
| 262 m_viewportConstrainedObjects.reset(); | 262 m_viewportConstrainedObjects.reset(); |
| 263 m_layoutSubtreeRootList.clear(); | 263 m_layoutSubtreeRootList.clear(); |
| 264 m_orthogonalWritingModeRootList.clear(); | 264 m_orthogonalWritingModeRootList.clear(); |
| (...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 976 | 976 |
| 977 void FrameView::prepareLayoutAnalyzer() { | 977 void FrameView::prepareLayoutAnalyzer() { |
| 978 bool isTracing = false; | 978 bool isTracing = false; |
| 979 TRACE_EVENT_CATEGORY_GROUP_ENABLED( | 979 TRACE_EVENT_CATEGORY_GROUP_ENABLED( |
| 980 TRACE_DISABLED_BY_DEFAULT("blink.debug.layout"), &isTracing); | 980 TRACE_DISABLED_BY_DEFAULT("blink.debug.layout"), &isTracing); |
| 981 if (!isTracing) { | 981 if (!isTracing) { |
| 982 m_analyzer.reset(); | 982 m_analyzer.reset(); |
| 983 return; | 983 return; |
| 984 } | 984 } |
| 985 if (!m_analyzer) | 985 if (!m_analyzer) |
| 986 m_analyzer = makeUnique<LayoutAnalyzer>(); | 986 m_analyzer = WTF::makeUnique<LayoutAnalyzer>(); |
| 987 m_analyzer->reset(); | 987 m_analyzer->reset(); |
| 988 } | 988 } |
| 989 | 989 |
| 990 std::unique_ptr<TracedValue> FrameView::analyzerCounters() { | 990 std::unique_ptr<TracedValue> FrameView::analyzerCounters() { |
| 991 if (!m_analyzer) | 991 if (!m_analyzer) |
| 992 return TracedValue::create(); | 992 return TracedValue::create(); |
| 993 std::unique_ptr<TracedValue> value = m_analyzer->toTracedValue(); | 993 std::unique_ptr<TracedValue> value = m_analyzer->toTracedValue(); |
| 994 value->setString("host", layoutViewItem().document().location()->host()); | 994 value->setString("host", layoutViewItem().document().location()->host()); |
| 995 value->setString("frame", | 995 value->setString("frame", |
| 996 String::format("0x%" PRIxPTR, | 996 String::format("0x%" PRIxPTR, |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1507 | 1507 |
| 1508 // Ensure main thread scrolling reasons are recomputed. | 1508 // Ensure main thread scrolling reasons are recomputed. |
| 1509 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { | 1509 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { |
| 1510 setNeedsPaintPropertyUpdate(); | 1510 setNeedsPaintPropertyUpdate(); |
| 1511 // The object's scroll properties are not affected by its own background. | 1511 // The object's scroll properties are not affected by its own background. |
| 1512 object->setAncestorsNeedPaintPropertyUpdateForMainThreadScrolling(); | 1512 object->setAncestorsNeedPaintPropertyUpdateForMainThreadScrolling(); |
| 1513 } | 1513 } |
| 1514 } | 1514 } |
| 1515 | 1515 |
| 1516 void FrameView::addViewportConstrainedObject(LayoutObject* object) { | 1516 void FrameView::addViewportConstrainedObject(LayoutObject* object) { |
| 1517 if (!m_viewportConstrainedObjects) | 1517 if (!m_viewportConstrainedObjects) { |
| 1518 m_viewportConstrainedObjects = wrapUnique(new ViewportConstrainedObjectSet); | 1518 m_viewportConstrainedObjects = |
| 1519 WTF::wrapUnique(new ViewportConstrainedObjectSet); |
| 1520 } |
| 1519 | 1521 |
| 1520 if (!m_viewportConstrainedObjects->contains(object)) { | 1522 if (!m_viewportConstrainedObjects->contains(object)) { |
| 1521 m_viewportConstrainedObjects->add(object); | 1523 m_viewportConstrainedObjects->add(object); |
| 1522 | 1524 |
| 1523 if (ScrollingCoordinator* scrollingCoordinator = | 1525 if (ScrollingCoordinator* scrollingCoordinator = |
| 1524 this->scrollingCoordinator()) | 1526 this->scrollingCoordinator()) |
| 1525 scrollingCoordinator->frameViewFixedObjectsDidChange(this); | 1527 scrollingCoordinator->frameViewFixedObjectsDidChange(this); |
| 1526 } | 1528 } |
| 1527 } | 1529 } |
| 1528 | 1530 |
| (...skipping 1896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3425 | 3427 |
| 3426 void FrameView::setTracksPaintInvalidations(bool trackPaintInvalidations) { | 3428 void FrameView::setTracksPaintInvalidations(bool trackPaintInvalidations) { |
| 3427 if (trackPaintInvalidations == isTrackingPaintInvalidations()) | 3429 if (trackPaintInvalidations == isTrackingPaintInvalidations()) |
| 3428 return; | 3430 return; |
| 3429 | 3431 |
| 3430 for (Frame* frame = m_frame->tree().top(); frame; | 3432 for (Frame* frame = m_frame->tree().top(); frame; |
| 3431 frame = frame->tree().traverseNext()) { | 3433 frame = frame->tree().traverseNext()) { |
| 3432 if (!frame->isLocalFrame()) | 3434 if (!frame->isLocalFrame()) |
| 3433 continue; | 3435 continue; |
| 3434 if (LayoutViewItem layoutView = toLocalFrame(frame)->contentLayoutItem()) { | 3436 if (LayoutViewItem layoutView = toLocalFrame(frame)->contentLayoutItem()) { |
| 3435 layoutView.frameView()->m_trackedObjectPaintInvalidations = wrapUnique( | 3437 layoutView.frameView()->m_trackedObjectPaintInvalidations = |
| 3436 trackPaintInvalidations ? new Vector<ObjectPaintInvalidation> | 3438 WTF::wrapUnique(trackPaintInvalidations |
| 3437 : nullptr); | 3439 ? new Vector<ObjectPaintInvalidation> |
| 3440 : nullptr); |
| 3438 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 3441 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 3439 m_paintController->setTracksRasterInvalidations( | 3442 m_paintController->setTracksRasterInvalidations( |
| 3440 trackPaintInvalidations); | 3443 trackPaintInvalidations); |
| 3441 m_paintArtifactCompositor->setTracksRasterInvalidations( | 3444 m_paintArtifactCompositor->setTracksRasterInvalidations( |
| 3442 trackPaintInvalidations); | 3445 trackPaintInvalidations); |
| 3443 } else { | 3446 } else { |
| 3444 layoutView.compositor()->setTracksRasterInvalidations( | 3447 layoutView.compositor()->setTracksRasterInvalidations( |
| 3445 trackPaintInvalidations); | 3448 trackPaintInvalidations); |
| 3446 } | 3449 } |
| 3447 } | 3450 } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3483 paintInvalidationReasonToString(item.reason)); | 3486 paintInvalidationReasonToString(item.reason)); |
| 3484 result->pushObject(std::move(itemJSON)); | 3487 result->pushObject(std::move(itemJSON)); |
| 3485 } | 3488 } |
| 3486 } | 3489 } |
| 3487 } | 3490 } |
| 3488 return result; | 3491 return result; |
| 3489 } | 3492 } |
| 3490 | 3493 |
| 3491 void FrameView::addResizerArea(LayoutBox& resizerBox) { | 3494 void FrameView::addResizerArea(LayoutBox& resizerBox) { |
| 3492 if (!m_resizerAreas) | 3495 if (!m_resizerAreas) |
| 3493 m_resizerAreas = wrapUnique(new ResizerAreaSet); | 3496 m_resizerAreas = WTF::wrapUnique(new ResizerAreaSet); |
| 3494 m_resizerAreas->add(&resizerBox); | 3497 m_resizerAreas->add(&resizerBox); |
| 3495 } | 3498 } |
| 3496 | 3499 |
| 3497 void FrameView::removeResizerArea(LayoutBox& resizerBox) { | 3500 void FrameView::removeResizerArea(LayoutBox& resizerBox) { |
| 3498 if (!m_resizerAreas) | 3501 if (!m_resizerAreas) |
| 3499 return; | 3502 return; |
| 3500 | 3503 |
| 3501 ResizerAreaSet::iterator it = m_resizerAreas->find(&resizerBox); | 3504 ResizerAreaSet::iterator it = m_resizerAreas->find(&resizerBox); |
| 3502 if (it != m_resizerAreas->end()) | 3505 if (it != m_resizerAreas->end()) |
| 3503 m_resizerAreas->remove(it); | 3506 m_resizerAreas->remove(it); |
| (...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4672 DCHECK(m_frame->isMainFrame()); | 4675 DCHECK(m_frame->isMainFrame()); |
| 4673 return m_initialViewportSize.width(); | 4676 return m_initialViewportSize.width(); |
| 4674 } | 4677 } |
| 4675 | 4678 |
| 4676 int FrameView::initialViewportHeight() const { | 4679 int FrameView::initialViewportHeight() const { |
| 4677 DCHECK(m_frame->isMainFrame()); | 4680 DCHECK(m_frame->isMainFrame()); |
| 4678 return m_initialViewportSize.height(); | 4681 return m_initialViewportSize.height(); |
| 4679 } | 4682 } |
| 4680 | 4683 |
| 4681 } // namespace blink | 4684 } // namespace blink |
| OLD | NEW |