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

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

Issue 2483953002: Separate forced subtree invalidation reasons for location change and SVG resource change (Closed)
Patch Set: rebaseline-cl 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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // TODO(trchen): Currently we don't keep track of paint offset of layout
533 // objects. There are corner cases that the display items need to be 533 // objects. There are corner cases that the display items need to be
534 // invalidated for paint offset mutation, but incurs no pixel difference 534 // invalidated for paint offset mutation, but incurs no pixel difference
535 // (i.e. bounds stay the same) so no rect-based invalidation is issued. 535 // (i.e. bounds stay the same) so no rect-based invalidation is issued.
536 // See crbug.com/508383 and crbug.com/515977. This is a workaround to 536 // See crbug.com/508383 and crbug.com/515977. This is a workaround to
537 // force display items to update paint offset. 537 // force display items to update paint offset. Exclude non-root SVG whose
538 if (m_context.forcedSubtreeInvalidationFlags & 538 // paint offset is always zero.
539 PaintInvalidatorContext::ForcedSubtreeInvalidationChecking) { 539 if ((!m_object.isSVG() || m_object.isSVGRoot()) &&
540 (m_context.forcedSubtreeInvalidationFlags &
541 PaintInvalidatorContext::ForcedSubtreeInvalidationChecking)) {
540 reason = PaintInvalidationLocationChange; 542 reason = PaintInvalidationLocationChange;
541 break; 543 break;
542 } 544 }
545 if (m_object.isSVG() &&
546 (m_context.forcedSubtreeInvalidationFlags &
547 PaintInvalidatorContext::ForcedSubtreeSVGResourceChange)) {
548 reason = PaintInvalidationSVGResourceChange;
549 break;
550 }
543 return PaintInvalidationNone; 551 return PaintInvalidationNone;
544 case PaintInvalidationDelayedFull: 552 case PaintInvalidationDelayedFull:
545 return PaintInvalidationDelayedFull; 553 return PaintInvalidationDelayedFull;
546 default: 554 default:
547 DCHECK(isImmediateFullPaintInvalidationReason(reason)); 555 DCHECK(isImmediateFullPaintInvalidationReason(reason));
548 fullyInvalidatePaint(reason, m_context.oldVisualRect, 556 fullyInvalidatePaint(reason, m_context.oldVisualRect,
549 m_context.newVisualRect); 557 m_context.newVisualRect);
550 } 558 }
551 559
552 m_context.paintingLayer->setNeedsRepaint(); 560 m_context.paintingLayer->setNeedsRepaint();
553 m_object.invalidateDisplayItemClients(reason); 561 m_object.invalidateDisplayItemClients(reason);
554 return reason; 562 return reason;
555 } 563 }
556 564
557 DisablePaintInvalidationStateAsserts::DisablePaintInvalidationStateAsserts() 565 DisablePaintInvalidationStateAsserts::DisablePaintInvalidationStateAsserts()
558 : m_disabler(&gDisablePaintInvalidationStateAsserts, true) {} 566 : m_disabler(&gDisablePaintInvalidationStateAsserts, true) {}
559 567
560 } // namespace blink 568 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698