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

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

Issue 2792863002: Revert of Skip paint property update and visual rect update if no geometry change (Closed)
Patch Set: Created 3 years, 8 months 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"
11 #include "core/layout/compositing/CompositedLayerMapping.h" 11 #include "core/layout/compositing/CompositedLayerMapping.h"
12 #include "core/paint/FindPaintOffsetAndVisualRectNeedingUpdate.h"
13 #include "core/paint/PaintInvalidator.h" 12 #include "core/paint/PaintInvalidator.h"
14 #include "core/paint/PaintLayer.h" 13 #include "core/paint/PaintLayer.h"
15 #include "platform/HostWindow.h" 14 #include "platform/HostWindow.h"
16 #include "platform/graphics/GraphicsLayer.h" 15 #include "platform/graphics/GraphicsLayer.h"
17 16
18 namespace blink { 17 namespace blink {
19 18
20 static bool gDisablePaintInvalidationStateAsserts = false; 19 static bool gDisablePaintInvalidationStateAsserts = false;
21 20
22 typedef HashMap<const LayoutObject*, LayoutRect> SelectionVisualRectMap; 21 typedef HashMap<const LayoutObject*, LayoutRect> SelectionVisualRectMap;
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 572
574 if (m_context.oldVisualRect != m_object.visualRect()) 573 if (m_context.oldVisualRect != m_object.visualRect())
575 return PaintInvalidationBoundsChange; 574 return PaintInvalidationBoundsChange;
576 575
577 return PaintInvalidationNone; 576 return PaintInvalidationNone;
578 } 577 }
579 578
580 DISABLE_CFI_PERF 579 DISABLE_CFI_PERF
581 void ObjectPaintInvalidatorWithContext::invalidateSelectionIfNeeded( 580 void ObjectPaintInvalidatorWithContext::invalidateSelectionIfNeeded(
582 PaintInvalidationReason reason) { 581 PaintInvalidationReason reason) {
583 // Update selection rect when we are doing full invalidation with geometry 582 // Update selection rect when we are doing full invalidation (in case that the
584 // change (in case that the object is moved, composite status changed, etc.) 583 // object is moved, composite status changed, etc.) or
585 // or shouldInvalidationSelection is set (in case that the selection itself 584 // shouldInvalidationSelection is set (in case that the selection itself
586 // changed). 585 // changed).
587 bool fullInvalidation = isImmediateFullPaintInvalidationReason(reason); 586 bool fullInvalidation = isImmediateFullPaintInvalidationReason(reason);
588 if (!fullInvalidation && !m_object.shouldInvalidateSelection()) 587 if (!fullInvalidation && !m_object.shouldInvalidateSelection())
589 return; 588 return;
590 589
591 DCHECK(m_object.hasSelectionVisualRect() == 590 DCHECK(m_object.hasSelectionVisualRect() ==
592 selectionVisualRectMap().contains(&m_object)); 591 selectionVisualRectMap().contains(&m_object));
593 LayoutRect oldSelectionRect; 592 LayoutRect oldSelectionRect;
594 if (m_object.hasSelectionVisualRect()) 593 if (m_object.hasSelectionVisualRect())
595 oldSelectionRect = selectionVisualRectMap().at(&m_object); 594 oldSelectionRect = selectionVisualRectMap().at(&m_object);
596 595 LayoutRect newSelectionRect = m_object.localSelectionRect();
597 LayoutRect newSelectionRect; 596 m_context.mapLocalRectToVisualRectInBacking(m_object, newSelectionRect);
598 #if DCHECK_IS_ON()
599 FindVisualRectNeedingUpdateScope finder(m_object, m_context, oldSelectionRect,
600 newSelectionRect);
601 #endif
602 if (m_context.needsVisualRectUpdate(m_object)) {
603 newSelectionRect = m_object.localSelectionRect();
604 m_context.mapLocalRectToVisualRectInBacking(m_object, newSelectionRect);
605 } else {
606 newSelectionRect = oldSelectionRect;
607 }
608 597
609 setSelectionVisualRect(m_object, newSelectionRect); 598 setSelectionVisualRect(m_object, newSelectionRect);
610 599
611 if (!fullInvalidation) { 600 if (!fullInvalidation) {
612 fullyInvalidatePaint(PaintInvalidationSelection, oldSelectionRect, 601 fullyInvalidatePaint(PaintInvalidationSelection, oldSelectionRect,
613 newSelectionRect); 602 newSelectionRect);
614 m_context.paintingLayer->setNeedsRepaint(); 603 m_context.paintingLayer->setNeedsRepaint();
615 m_object.invalidateDisplayItemClients(PaintInvalidationSelection); 604 m_object.invalidateDisplayItemClients(PaintInvalidationSelection);
616 } 605 }
617 } 606 }
(...skipping 29 matching lines...) Expand all
647 reason = PaintInvalidationSVGResourceChange; 636 reason = PaintInvalidationSVGResourceChange;
648 break; 637 break;
649 } 638 }
650 return PaintInvalidationNone; 639 return PaintInvalidationNone;
651 case PaintInvalidationDelayedFull: 640 case PaintInvalidationDelayedFull:
652 return PaintInvalidationDelayedFull; 641 return PaintInvalidationDelayedFull;
653 default: 642 default:
654 DCHECK(isImmediateFullPaintInvalidationReason(reason)); 643 DCHECK(isImmediateFullPaintInvalidationReason(reason));
655 // This allows descendants to know the computed reason if it's different 644 // This allows descendants to know the computed reason if it's different
656 // from the original reason before paint invalidation. 645 // from the original reason before paint invalidation.
657 m_object.getMutableForPainting() 646 m_object.getMutableForPainting().setShouldDoFullPaintInvalidation(reason);
658 .setShouldDoFullPaintInvalidationWithoutGeometryChange(reason);
659 fullyInvalidatePaint(reason, m_context.oldVisualRect, 647 fullyInvalidatePaint(reason, m_context.oldVisualRect,
660 m_object.visualRect()); 648 m_object.visualRect());
661 } 649 }
662 650
663 m_context.paintingLayer->setNeedsRepaint(); 651 m_context.paintingLayer->setNeedsRepaint();
664 m_object.invalidateDisplayItemClients(reason); 652 m_object.invalidateDisplayItemClients(reason);
665 return reason; 653 return reason;
666 } 654 }
667 655
668 DisablePaintInvalidationStateAsserts::DisablePaintInvalidationStateAsserts() 656 DisablePaintInvalidationStateAsserts::DisablePaintInvalidationStateAsserts()
669 : m_disabler(&gDisablePaintInvalidationStateAsserts, true) {} 657 : m_disabler(&gDisablePaintInvalidationStateAsserts, true) {}
670 658
671 } // namespace blink 659 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698