| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 , m_containerForAbsolutePosition(layoutView) | 45 , m_containerForAbsolutePosition(layoutView) |
| 46 , m_pendingDelayedPaintInvalidations(pendingDelayedPaintInvalidations) | 46 , m_pendingDelayedPaintInvalidations(pendingDelayedPaintInvalidations) |
| 47 , m_paintingLayer(*layoutView.layer()) | 47 , m_paintingLayer(*layoutView.layer()) |
| 48 #if ENABLE(ASSERT) | 48 #if ENABLE(ASSERT) |
| 49 , m_didUpdateForChildren(false) | 49 , m_didUpdateForChildren(false) |
| 50 #endif | 50 #endif |
| 51 #ifdef CHECK_FAST_PATH_SLOW_PATH_EQUALITY | 51 #ifdef CHECK_FAST_PATH_SLOW_PATH_EQUALITY |
| 52 , m_canCheckFastPathSlowPathEquality(layoutView == m_paintInvalidationContai
ner) | 52 , m_canCheckFastPathSlowPathEquality(layoutView == m_paintInvalidationContai
ner) |
| 53 #endif | 53 #endif |
| 54 { | 54 { |
| 55 DCHECK(!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); |
| 56 |
| 55 if (!supportsCachedOffsets(layoutView)) { | 57 if (!supportsCachedOffsets(layoutView)) { |
| 56 m_cachedOffsetsEnabled = false; | 58 m_cachedOffsetsEnabled = false; |
| 57 return; | 59 return; |
| 58 } | 60 } |
| 59 | 61 |
| 60 FloatPoint point = layoutView.localToAncestorPoint(FloatPoint(), m_paintInva
lidationContainer, TraverseDocumentBoundaries | InputIsInFrameCoordinates); | 62 FloatPoint point = layoutView.localToAncestorPoint(FloatPoint(), m_paintInva
lidationContainer, TraverseDocumentBoundaries | InputIsInFrameCoordinates); |
| 61 m_paintOffset = LayoutSize(point.x(), point.y()); | 63 m_paintOffset = LayoutSize(point.x(), point.y()); |
| 62 m_paintOffsetForAbsolutePosition = m_paintOffset; | 64 m_paintOffsetForAbsolutePosition = m_paintOffset; |
| 63 } | 65 } |
| 64 | 66 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 79 , m_svgTransform(parentState.m_svgTransform) | 81 , m_svgTransform(parentState.m_svgTransform) |
| 80 , m_pendingDelayedPaintInvalidations(parentState.m_pendingDelayedPaintInvali
dations) | 82 , m_pendingDelayedPaintInvalidations(parentState.m_pendingDelayedPaintInvali
dations) |
| 81 , m_paintingLayer(currentObject.hasLayer() && toLayoutBoxModelObject(current
Object).hasSelfPaintingLayer() ? *toLayoutBoxModelObject(currentObject).layer()
: parentState.m_paintingLayer) | 83 , m_paintingLayer(currentObject.hasLayer() && toLayoutBoxModelObject(current
Object).hasSelfPaintingLayer() ? *toLayoutBoxModelObject(currentObject).layer()
: parentState.m_paintingLayer) |
| 82 #if ENABLE(ASSERT) | 84 #if ENABLE(ASSERT) |
| 83 , m_didUpdateForChildren(false) | 85 , m_didUpdateForChildren(false) |
| 84 #endif | 86 #endif |
| 85 #ifdef CHECK_FAST_PATH_SLOW_PATH_EQUALITY | 87 #ifdef CHECK_FAST_PATH_SLOW_PATH_EQUALITY |
| 86 , m_canCheckFastPathSlowPathEquality(parentState.m_canCheckFastPathSlowPathE
quality) | 88 , m_canCheckFastPathSlowPathEquality(parentState.m_canCheckFastPathSlowPathE
quality) |
| 87 #endif | 89 #endif |
| 88 { | 90 { |
| 91 DCHECK(!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); |
| 89 DCHECK(&m_paintingLayer == currentObject.paintingLayer()); | 92 DCHECK(&m_paintingLayer == currentObject.paintingLayer()); |
| 90 | 93 |
| 91 if (currentObject == parentState.m_currentObject) { | 94 if (currentObject == parentState.m_currentObject) { |
| 92 // Sometimes we create a new PaintInvalidationState from parentState on
the same object | 95 // Sometimes we create a new PaintInvalidationState from parentState on
the same object |
| 93 // (e.g. LayoutView, and the HorriblySlowRectMapping cases in LayoutBloc
k::invalidatePaintOfSubtreesIfNeeded()). | 96 // (e.g. LayoutView, and the HorriblySlowRectMapping cases in LayoutBloc
k::invalidatePaintOfSubtreesIfNeeded()). |
| 94 // TODO(wangxianzhu): Avoid this for RuntimeEnabledFeatures::slimmingPai
ntInvalidationEnabled(). | 97 // TODO(wangxianzhu): Avoid this for RuntimeEnabledFeatures::slimmingPai
ntInvalidationEnabled(). |
| 95 #if ENABLE(ASSERT) | 98 #if ENABLE(ASSERT) |
| 96 m_didUpdateForChildren = parentState.m_didUpdateForChildren; | 99 m_didUpdateForChildren = parentState.m_didUpdateForChildren; |
| 97 #endif | 100 #endif |
| 98 return; | 101 return; |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 } | 547 } |
| 545 | 548 |
| 546 | 549 |
| 547 void PaintInvalidatorContextAdapter::mapLocalRectToPaintInvalidationBacking(cons
t LayoutObject& object, LayoutRect& rect) const | 550 void PaintInvalidatorContextAdapter::mapLocalRectToPaintInvalidationBacking(cons
t LayoutObject& object, LayoutRect& rect) const |
| 548 { | 551 { |
| 549 DCHECK(&object == &m_paintInvalidationState.currentObject()); | 552 DCHECK(&object == &m_paintInvalidationState.currentObject()); |
| 550 m_paintInvalidationState.mapLocalRectToPaintInvalidationBacking(rect); | 553 m_paintInvalidationState.mapLocalRectToPaintInvalidationBacking(rect); |
| 551 } | 554 } |
| 552 | 555 |
| 553 } // namespace blink | 556 } // namespace blink |
| OLD | NEW |