| OLD | NEW | 
|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "core/layout/PaintInvalidationState.h" | 5 #include "core/layout/PaintInvalidationState.h" | 
| 6 | 6 | 
| 7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" | 
| 8 #include "core/frame/LocalFrame.h" | 8 #include "core/frame/LocalFrame.h" | 
| 9 #include "core/frame/Settings.h" | 9 #include "core/frame/Settings.h" | 
| 10 #include "core/layout/LayoutInline.h" | 10 #include "core/layout/LayoutInline.h" | 
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 300     } else if (m_currentObject.isTableRow()) { | 300     } else if (m_currentObject.isTableRow()) { | 
| 301         // Child table cell's locationOffset() includes its row's locationOffset
     (). | 301         // Child table cell's locationOffset() includes its row's locationOffset
     (). | 
| 302         m_paintOffset -= toLayoutBox(m_currentObject).locationOffset(); | 302         m_paintOffset -= toLayoutBox(m_currentObject).locationOffset(); | 
| 303     } | 303     } | 
| 304 | 304 | 
| 305     if (!m_currentObject.hasOverflowClip()) | 305     if (!m_currentObject.hasOverflowClip()) | 
| 306         return; | 306         return; | 
| 307 | 307 | 
| 308     const LayoutBox& box = toLayoutBox(m_currentObject); | 308     const LayoutBox& box = toLayoutBox(m_currentObject); | 
| 309 | 309 | 
| 310     // Do not clip scroll layer contents because the compositor expects the whol
     e layer | 310     // Do not clip or scroll for the paint invalidation container, if it scrolls
      overflow, because it will always use composited | 
| 311     // to be always invalidated in-time. | 311     // scrolling in this case. | 
| 312     if (box == m_paintInvalidationContainer && box.scrollsOverflow()) | 312     if (box == m_paintInvalidationContainer && box.scrollsOverflow()) { | 
| 313         ASSERT(!m_clipped); // The box establishes paint invalidation container,
      so no m_clipped inherited. | 313         ASSERT(!m_clipped); // The box establishes paint invalidation container,
      so no m_clipped inherited. | 
| 314     else | 314     } else { | 
| 315         addClipRectRelativeToPaintOffset(box.overflowClipRect(LayoutPoint())); | 315         addClipRectRelativeToPaintOffset(box.overflowClipRect(LayoutPoint())); | 
| 316 | 316         m_paintOffset -= box.scrolledContentOffset(); | 
| 317     m_paintOffset -= box.scrolledContentOffset(); | 317     } | 
| 318 | 318 | 
| 319     // FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip 
     if present. | 319     // FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip 
     if present. | 
| 320 } | 320 } | 
| 321 | 321 | 
| 322 static FloatPoint slowLocalToAncestorPoint(const LayoutObject& object, const Lay
     outBoxModelObject& ancestor, const FloatPoint& point) | 322 static FloatPoint slowLocalToAncestorPoint(const LayoutObject& object, const Lay
     outBoxModelObject& ancestor, const FloatPoint& point) | 
| 323 { | 323 { | 
| 324     if (object.isLayoutView()) | 324     if (object.isLayoutView()) | 
| 325         return toLayoutView(object).localToAncestorPoint(point, &ancestor, Trave
     rseDocumentBoundaries | InputIsInFrameCoordinates); | 325         return toLayoutView(object).localToAncestorPoint(point, &ancestor, Trave
     rseDocumentBoundaries | InputIsInFrameCoordinates); | 
| 326     return object.localToAncestorPoint(point, &ancestor, TraverseDocumentBoundar
     ies); | 326     FloatPoint result = object.localToAncestorPoint(point, &ancestor, TraverseDo
     cumentBoundaries); | 
|  | 327     // Paint invalidation does not include scroll of the ancestor. | 
|  | 328     if (ancestor.isBox()) | 
|  | 329         result.move(toLayoutBox(&ancestor)->scrolledContentOffset()); | 
|  | 330     return result; | 
| 327 } | 331 } | 
| 328 | 332 | 
| 329 LayoutPoint PaintInvalidationState::computePositionFromPaintInvalidationBacking(
     ) const | 333 LayoutPoint PaintInvalidationState::computePositionFromPaintInvalidationBacking(
     ) const | 
| 330 { | 334 { | 
| 331     ASSERT(!m_didUpdateForChildren); | 335     ASSERT(!m_didUpdateForChildren); | 
| 332 | 336 | 
| 333     FloatPoint point; | 337     FloatPoint point; | 
| 334     if (m_paintInvalidationContainer != &m_currentObject) { | 338     if (m_paintInvalidationContainer != &m_currentObject) { | 
| 335         if (m_cachedOffsetsEnabled) { | 339         if (m_cachedOffsetsEnabled) { | 
| 336             if (m_currentObject.isSVG() && !m_currentObject.isSVGRoot()) | 340             if (m_currentObject.isSVG() && !m_currentObject.isSVGRoot()) | 
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 494     WTFLogAlways("Fast path paint invalidation rect differs from slow path: fast
     : %s vs slow: %s", | 498     WTFLogAlways("Fast path paint invalidation rect differs from slow path: fast
     : %s vs slow: %s", | 
| 495         fastPathRect.toString().ascii().data(), slowPathRect.toString().ascii().
     data()); | 499         fastPathRect.toString().ascii().data(), slowPathRect.toString().ascii().
     data()); | 
| 496     showLayoutTree(&m_currentObject); | 500     showLayoutTree(&m_currentObject); | 
| 497 | 501 | 
| 498     ASSERT_NOT_REACHED(); | 502     ASSERT_NOT_REACHED(); | 
| 499 } | 503 } | 
| 500 | 504 | 
| 501 #endif // CHECK_FAST_PATH_SLOW_PATH_EQUALITY | 505 #endif // CHECK_FAST_PATH_SLOW_PATH_EQUALITY | 
| 502 | 506 | 
| 503 } // namespace blink | 507 } // namespace blink | 
| OLD | NEW | 
|---|