Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Side by Side Diff: third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp

Issue 2487273002: [No submit][SPInvalidation] Track paint offset change (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 PaintInvalidationReason 522 PaintInvalidationReason
523 ObjectPaintInvalidatorWithContext::invalidatePaintIfNeededWithComputedReason( 523 ObjectPaintInvalidatorWithContext::invalidatePaintIfNeededWithComputedReason(
524 PaintInvalidationReason reason) { 524 PaintInvalidationReason reason) {
525 // We need to invalidate the selection before checking for whether we are 525 // We need to invalidate the selection before checking for whether we are
526 // doing a full invalidation. This is because we need to update the previous 526 // doing a full invalidation. This is because we need to update the previous
527 // selection rect regardless. 527 // selection rect regardless.
528 invalidateSelectionIfNeeded(reason); 528 invalidateSelectionIfNeeded(reason);
529 529
530 switch (reason) { 530 switch (reason) {
531 case PaintInvalidationNone: 531 case PaintInvalidationNone:
532 // TODO(trchen): Currently we don't keep track of paint offset of layout 532 // There are corner cases that the display items need to be invalidated
533 // objects. There are corner cases that the display items need to be 533 // for paint offset mutation, but incurs no pixel difference (i.e. bounds
534 // invalidated for paint offset mutation, but incurs no pixel difference 534 // stay the same) so no rect-based invalidation is issued. See
535 // (i.e. bounds stay the same) so no rect-based invalidation is issued. 535 // crbug.com/508383 and crbug.com/515977.
536 // See crbug.com/508383 and crbug.com/515977. This is a workaround to 536 if (m_context.forcedSubtreeInvalidationFlags &
537 // force display items to update paint offset. Exclude non-root SVG whose 537 PaintInvalidatorContext::ForcedSubtreeInvalidationChecking) {
538 // paint offset is always zero. 538 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) {
539 if ((!m_object.isSVG() || m_object.isSVGRoot()) && 539 if (m_context.oldPaintOffset != m_context.newPaintOffset) {
540 (m_context.forcedSubtreeInvalidationFlags & 540 reason = PaintInvalidationLocationChange;
541 PaintInvalidatorContext::ForcedSubtreeInvalidationChecking)) { 541 break;
542 reason = PaintInvalidationLocationChange; 542 }
543 break; 543 } else {
544 // For non-SlimmingPaintInvalidation, we conservatively assume the
545 // object changed paint offset except for non-root SVG whose paint
546 // offset is always zero.
547 if (!m_object.isSVG() || m_object.isSVGRoot()) {
548 reason = PaintInvalidationLocationChange;
549 break;
550 }
551 }
544 } 552 }
553
545 if (m_object.isSVG() && 554 if (m_object.isSVG() &&
546 (m_context.forcedSubtreeInvalidationFlags & 555 (m_context.forcedSubtreeInvalidationFlags &
547 PaintInvalidatorContext::ForcedSubtreeSVGResourceChange)) { 556 PaintInvalidatorContext::ForcedSubtreeSVGResourceChange)) {
548 reason = PaintInvalidationSVGResourceChange; 557 reason = PaintInvalidationSVGResourceChange;
549 break; 558 break;
550 } 559 }
551 return PaintInvalidationNone; 560 return PaintInvalidationNone;
552 case PaintInvalidationDelayedFull: 561 case PaintInvalidationDelayedFull:
553 return PaintInvalidationDelayedFull; 562 return PaintInvalidationDelayedFull;
554 default: 563 default:
555 DCHECK(isImmediateFullPaintInvalidationReason(reason)); 564 DCHECK(isImmediateFullPaintInvalidationReason(reason));
556 fullyInvalidatePaint(reason, m_context.oldVisualRect, 565 fullyInvalidatePaint(reason, m_context.oldVisualRect,
557 m_context.newVisualRect); 566 m_context.newVisualRect);
558 } 567 }
559 568
560 m_context.paintingLayer->setNeedsRepaint(); 569 m_context.paintingLayer->setNeedsRepaint();
561 m_object.invalidateDisplayItemClients(reason); 570 m_object.invalidateDisplayItemClients(reason);
562 return reason; 571 return reason;
563 } 572 }
564 573
565 DisablePaintInvalidationStateAsserts::DisablePaintInvalidationStateAsserts() 574 DisablePaintInvalidationStateAsserts::DisablePaintInvalidationStateAsserts()
566 : m_disabler(&gDisablePaintInvalidationStateAsserts, true) {} 575 : m_disabler(&gDisablePaintInvalidationStateAsserts, true) {}
567 576
568 } // namespace blink 577 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/InlinePainter.cpp ('k') | third_party/WebKit/Source/core/paint/ObjectPainter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698