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

Side by Side Diff: Source/core/rendering/RenderObject.cpp

Issue 351673007: Move paint invalidation after compositing update (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: New approach that should work, added a test based on Adam's review Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 2687 matching lines...) Expand 10 before | Expand all | Expand 10 after
2698 2698
2699 return o; 2699 return o;
2700 } 2700 }
2701 2701
2702 bool RenderObject::isSelectionBorder() const 2702 bool RenderObject::isSelectionBorder() const
2703 { 2703 {
2704 SelectionState st = selectionState(); 2704 SelectionState st = selectionState();
2705 return st == SelectionStart || st == SelectionEnd || st == SelectionBoth; 2705 return st == SelectionStart || st == SelectionEnd || st == SelectionBoth;
2706 } 2706 }
2707 2707
2708 inline void RenderObject::clearLayoutRootIfNeeded() const
2709 {
2710 if (frame()) {
2711 if (FrameView* view = frame()->view()) {
2712 if (view->layoutRoot() == this) {
2713 if (!documentBeingDestroyed())
2714 ASSERT_NOT_REACHED();
2715 // This indicates a failure to layout the child, which is why
2716 // the layout root is still set to |this|. Make sure to clear it
2717 // since we are getting destroyed.
2718 view->clearLayoutSubtreeRoot();
2719 }
2720 }
2721 }
2722 }
2723
2724 void RenderObject::willBeDestroyed() 2708 void RenderObject::willBeDestroyed()
2725 { 2709 {
2726 // Destroy any leftover anonymous children. 2710 // Destroy any leftover anonymous children.
2727 RenderObjectChildList* children = virtualChildren(); 2711 RenderObjectChildList* children = virtualChildren();
2728 if (children) 2712 if (children)
2729 children->destroyLeftoverChildren(); 2713 children->destroyLeftoverChildren();
2730 2714
2731 // If this renderer is being autoscrolled, stop the autoscrolling.
2732 if (LocalFrame* frame = this->frame()) { 2715 if (LocalFrame* frame = this->frame()) {
2716 // If this renderer is being autoscrolled, stop the autoscrolling.
2733 if (frame->page()) 2717 if (frame->page())
2734 frame->page()->autoscrollController().stopAutoscrollIfNeeded(this); 2718 frame->page()->autoscrollController().stopAutoscrollIfNeeded(this);
2719
2720 // Make sure the FrameView doesn't hang onto stale pointers.
2721 if (FrameView* view = frame->view())
2722 view->rendererWillBeDestroyed(this);
2735 } 2723 }
2736 2724
2737 // For accessibility management, notify the parent of the imminent change to its child set. 2725 // For accessibility management, notify the parent of the imminent change to its child set.
2738 // We do it now, before remove(), while the parent pointer is still availabl e. 2726 // We do it now, before remove(), while the parent pointer is still availabl e.
2739 if (AXObjectCache* cache = document().existingAXObjectCache()) 2727 if (AXObjectCache* cache = document().existingAXObjectCache())
2740 cache->childrenChanged(this->parent()); 2728 cache->childrenChanged(this->parent());
2741 2729
2742 remove(); 2730 remove();
2743 2731
2744 // The remove() call above may invoke axObjectCache()->childrenChanged() on the parent, which may require the AX render 2732 // The remove() call above may invoke axObjectCache()->childrenChanged() on the parent, which may require the AX render
(...skipping 10 matching lines...) Expand all
2755 RenderCounter::destroyCounterNodes(*this); 2743 RenderCounter::destroyCounterNodes(*this);
2756 2744
2757 // Remove the handler if node had touch-action set. Don't call when 2745 // Remove the handler if node had touch-action set. Don't call when
2758 // document is being destroyed as all handlers will have been cleared 2746 // document is being destroyed as all handlers will have been cleared
2759 // previously. Handlers are not added for text nodes so don't try removing 2747 // previously. Handlers are not added for text nodes so don't try removing
2760 // for one too. Need to check if m_style is null in cases of partial constru ction. 2748 // for one too. Need to check if m_style is null in cases of partial constru ction.
2761 if (!documentBeingDestroyed() && node() && !node()->isTextNode() && m_style && m_style->touchAction() != TouchActionAuto) 2749 if (!documentBeingDestroyed() && node() && !node()->isTextNode() && m_style && m_style->touchAction() != TouchActionAuto)
2762 document().didRemoveTouchEventHandler(node()); 2750 document().didRemoveTouchEventHandler(node());
2763 2751
2764 setAncestorLineBoxDirty(false); 2752 setAncestorLineBoxDirty(false);
2765
2766 clearLayoutRootIfNeeded();
2767 } 2753 }
2768 2754
2769 void RenderObject::insertedIntoTree() 2755 void RenderObject::insertedIntoTree()
2770 { 2756 {
2771 // FIXME: We should ASSERT(isRooted()) here but generated content makes some out-of-order insertion. 2757 // FIXME: We should ASSERT(isRooted()) here but generated content makes some out-of-order insertion.
2772 2758
2773 // Keep our layer hierarchy updated. Optimize for the common case where we d on't have any children 2759 // Keep our layer hierarchy updated. Optimize for the common case where we d on't have any children
2774 // and don't have a layer attached to ourselves. 2760 // and don't have a layer attached to ourselves.
2775 RenderLayer* layer = 0; 2761 RenderLayer* layer = 0;
2776 if (slowFirstChild() || hasLayer()) { 2762 if (slowFirstChild() || hasLayer()) {
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
3516 { 3502 {
3517 if (object1) { 3503 if (object1) {
3518 const WebCore::RenderObject* root = object1; 3504 const WebCore::RenderObject* root = object1;
3519 while (root->parent()) 3505 while (root->parent())
3520 root = root->parent(); 3506 root = root->parent();
3521 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 3507 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
3522 } 3508 }
3523 } 3509 }
3524 3510
3525 #endif 3511 #endif
OLDNEW
« Source/core/frame/FrameView.cpp ('K') | « Source/core/rendering/RenderObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698