OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/paint/ObjectPaintInvalidator.h" | 5 #include "core/paint/ObjectPaintInvalidator.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/layout/LayoutView.h" | 9 #include "core/layout/LayoutView.h" |
10 #include "core/layout/api/LayoutPartItem.h" | 10 #include "core/layout/api/LayoutPartItem.h" |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 // doing a full invalidation. This is because we need to update the previous | 539 // doing a full invalidation. This is because we need to update the previous |
540 // selection rect regardless. | 540 // selection rect regardless. |
541 invalidateSelectionIfNeeded(reason); | 541 invalidateSelectionIfNeeded(reason); |
542 | 542 |
543 switch (reason) { | 543 switch (reason) { |
544 case PaintInvalidationNone: | 544 case PaintInvalidationNone: |
545 // There are corner cases that the display items need to be invalidated | 545 // There are corner cases that the display items need to be invalidated |
546 // for paint offset mutation, but incurs no pixel difference (i.e. bounds | 546 // for paint offset mutation, but incurs no pixel difference (i.e. bounds |
547 // stay the same) so no rect-based invalidation is issued. See | 547 // stay the same) so no rect-based invalidation is issued. See |
548 // crbug.com/508383 and crbug.com/515977. | 548 // crbug.com/508383 and crbug.com/515977. |
549 if (m_context.forcedSubtreeInvalidationFlags & | 549 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() && |
550 PaintInvalidatorContext::ForcedSubtreeInvalidationChecking) { | 550 (m_context.forcedSubtreeInvalidationFlags & |
551 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 551 PaintInvalidatorContext::ForcedSubtreeInvalidationChecking) && |
552 if (m_context.oldPaintOffset != m_context.newPaintOffset) { | 552 !m_object.isSVGChild()) { |
553 reason = PaintInvalidationLocationChange; | 553 // For SPv1, we conservatively assume the object changed paint offset |
554 break; | 554 // except for non-root SVG whose paint offset is always zero. |
555 } | 555 reason = PaintInvalidationLocationChange; |
556 } else { | 556 break; |
557 // For SPv1, we conservatively assume the object changed paint offset | |
558 // except for non-root SVG whose paint offset is always zero. | |
559 if (!m_object.isSVGChild()) { | |
560 reason = PaintInvalidationLocationChange; | |
561 break; | |
562 } | |
563 } | |
564 } | 557 } |
565 | 558 |
566 if (m_object.isSVG() && | 559 if (m_object.isSVG() && |
567 (m_context.forcedSubtreeInvalidationFlags & | 560 (m_context.forcedSubtreeInvalidationFlags & |
568 PaintInvalidatorContext::ForcedSubtreeSVGResourceChange)) { | 561 PaintInvalidatorContext::ForcedSubtreeSVGResourceChange)) { |
569 reason = PaintInvalidationSVGResourceChange; | 562 reason = PaintInvalidationSVGResourceChange; |
570 break; | 563 break; |
571 } | 564 } |
572 return PaintInvalidationNone; | 565 return PaintInvalidationNone; |
573 case PaintInvalidationDelayedFull: | 566 case PaintInvalidationDelayedFull: |
574 return PaintInvalidationDelayedFull; | 567 return PaintInvalidationDelayedFull; |
575 default: | 568 default: |
576 DCHECK(isImmediateFullPaintInvalidationReason(reason)); | 569 DCHECK(isImmediateFullPaintInvalidationReason(reason)); |
577 fullyInvalidatePaint(reason, m_context.oldVisualRect, | 570 fullyInvalidatePaint(reason, m_context.oldVisualRect, |
578 m_context.newVisualRect); | 571 m_context.newVisualRect); |
579 } | 572 } |
580 | 573 |
581 m_context.paintingLayer->setNeedsRepaint(); | 574 m_context.paintingLayer->setNeedsRepaint(); |
582 m_object.invalidateDisplayItemClients(reason); | 575 m_object.invalidateDisplayItemClients(reason); |
583 return reason; | 576 return reason; |
584 } | 577 } |
585 | 578 |
586 DisablePaintInvalidationStateAsserts::DisablePaintInvalidationStateAsserts() | 579 DisablePaintInvalidationStateAsserts::DisablePaintInvalidationStateAsserts() |
587 : m_disabler(&gDisablePaintInvalidationStateAsserts, true) {} | 580 : m_disabler(&gDisablePaintInvalidationStateAsserts, true) {} |
588 | 581 |
589 } // namespace blink | 582 } // namespace blink |
OLD | NEW |