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

Side by Side Diff: third_party/WebKit/Source/core/frame/LocalFrame.cpp

Issue 1860273003: Downgrade some lifecycle update calls to not include paint if not necessary. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/input/EventHandler.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 if (!m_host) 617 if (!m_host)
618 return 0; 618 return 0;
619 619
620 double ratio = m_host->deviceScaleFactor(); 620 double ratio = m_host->deviceScaleFactor();
621 ratio *= pageZoomFactor(); 621 ratio *= pageZoomFactor();
622 return ratio; 622 return ratio;
623 } 623 }
624 624
625 PassOwnPtr<DragImage> LocalFrame::nodeImage(Node& node) 625 PassOwnPtr<DragImage> LocalFrame::nodeImage(Node& node)
626 { 626 {
627 m_view->updateAllLifecyclePhases(); 627 m_view->updateLifecycleToCompositingCleanPlusScrolling();
628 LayoutObject* layoutObject = node.layoutObject(); 628 LayoutObject* layoutObject = node.layoutObject();
629 if (!layoutObject) 629 if (!layoutObject)
630 return nullptr; 630 return nullptr;
631 631
632 // Paint starting at the nearest self painting layer, clipped to the object itself. 632 // Paint starting at the nearest self painting layer, clipped to the object itself.
633 // TODO(pdr): This will also paint the content behind the object if the obje ct contains 633 // TODO(pdr): This will also paint the content behind the object if the obje ct contains
634 // transparency but the layer is opaque. We could directly call layoutObject ->paint(...) 634 // transparency but the layer is opaque. We could directly call layoutObject ->paint(...)
635 // (see ObjectPainter::paintAllPhasesAtomically) but this would skip self-pa inting children. 635 // (see ObjectPainter::paintAllPhasesAtomically) but this would skip self-pa inting children.
636 PaintLayer* layer = layoutObject->enclosingLayer()->enclosingSelfPaintingLay er(); 636 PaintLayer* layer = layoutObject->enclosingLayer()->enclosingSelfPaintingLay er();
637 IntRect absoluteBoundingBox = layoutObject->absoluteBoundingBoxRectIncluding Descendants(); 637 IntRect absoluteBoundingBox = layoutObject->absoluteBoundingBoxRectIncluding Descendants();
638 FloatRect boundingBox = layer->layoutObject()->absoluteToLocalQuad(FloatQuad (absoluteBoundingBox), UseTransforms).boundingBox(); 638 FloatRect boundingBox = layer->layoutObject()->absoluteToLocalQuad(FloatQuad (absoluteBoundingBox), UseTransforms).boundingBox();
639 DragImageBuilder dragImageBuilder(this, boundingBox, &node); 639 DragImageBuilder dragImageBuilder(this, boundingBox, &node);
640 { 640 {
641 PaintLayerPaintingInfo paintingInfo(layer, LayoutRect(boundingBox), Glob alPaintFlattenCompositingLayers, LayoutSize(), 0); 641 PaintLayerPaintingInfo paintingInfo(layer, LayoutRect(boundingBox), Glob alPaintFlattenCompositingLayers, LayoutSize(), 0);
642 PaintLayerFlags flags = PaintLayerHaveTransparency | PaintLayerAppliedTr ansform | PaintLayerUncachedClipRects; 642 PaintLayerFlags flags = PaintLayerHaveTransparency | PaintLayerAppliedTr ansform | PaintLayerUncachedClipRects;
643 PaintLayerPainter(*layer).paintLayer(dragImageBuilder.context(), paintin gInfo, flags); 643 PaintLayerPainter(*layer).paintLayer(dragImageBuilder.context(), paintin gInfo, flags);
644 } 644 }
645 return dragImageBuilder.createImage(); 645 return dragImageBuilder.createImage();
646 } 646 }
647 647
648 PassOwnPtr<DragImage> LocalFrame::dragImageForSelection(float opacity) 648 PassOwnPtr<DragImage> LocalFrame::dragImageForSelection(float opacity)
649 { 649 {
650 if (!selection().isRange()) 650 if (!selection().isRange())
651 return nullptr; 651 return nullptr;
652 652
653 m_view->updateAllLifecyclePhases(); 653 m_view->updateLifecycleToCompositingCleanPlusScrolling();
654 ASSERT(document()->isActive()); 654 ASSERT(document()->isActive());
655 655
656 FloatRect paintingRect = FloatRect(selection().bounds()); 656 FloatRect paintingRect = FloatRect(selection().bounds());
657 DragImageBuilder dragImageBuilder(this, paintingRect, nullptr, opacity); 657 DragImageBuilder dragImageBuilder(this, paintingRect, nullptr, opacity);
658 GlobalPaintFlags paintFlags = GlobalPaintSelectionOnly | GlobalPaintFlattenC ompositingLayers; 658 GlobalPaintFlags paintFlags = GlobalPaintSelectionOnly | GlobalPaintFlattenC ompositingLayers;
659 m_view->paintContents(dragImageBuilder.context(), paintFlags, enclosingIntRe ct(paintingRect)); 659 m_view->paintContents(dragImageBuilder.context(), paintFlags, enclosingIntRe ct(paintingRect));
660 return dragImageBuilder.createImage(); 660 return dragImageBuilder.createImage();
661 } 661 }
662 662
663 String LocalFrame::selectedText() const 663 String LocalFrame::selectedText() const
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 { 868 {
869 m_frame->disableNavigation(); 869 m_frame->disableNavigation();
870 } 870 }
871 871
872 FrameNavigationDisabler::~FrameNavigationDisabler() 872 FrameNavigationDisabler::~FrameNavigationDisabler()
873 { 873 {
874 m_frame->enableNavigation(); 874 m_frame->enableNavigation();
875 } 875 }
876 876
877 } // namespace blink 877 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/input/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698