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

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

Issue 1909033003: Add FrameView::updateAllLifecyclePhasesExceptPaint and use it in a few cases. (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
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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 if (!m_host) 612 if (!m_host)
613 return 0; 613 return 0;
614 614
615 double ratio = m_host->deviceScaleFactor(); 615 double ratio = m_host->deviceScaleFactor();
616 ratio *= pageZoomFactor(); 616 ratio *= pageZoomFactor();
617 return ratio; 617 return ratio;
618 } 618 }
619 619
620 PassOwnPtr<DragImage> LocalFrame::nodeImage(Node& node) 620 PassOwnPtr<DragImage> LocalFrame::nodeImage(Node& node)
621 { 621 {
622 // TODO(crbug.com/603230): Synchronized painting is unnecessary in this life cycle update. 622 m_view->updateAllLifecyclePhasesExceptPaint();
623 m_view->updateAllLifecyclePhases();
624 LayoutObject* layoutObject = node.layoutObject(); 623 LayoutObject* layoutObject = node.layoutObject();
625 if (!layoutObject) 624 if (!layoutObject)
626 return nullptr; 625 return nullptr;
627 626
628 // Paint starting at the nearest self painting layer, clipped to the object itself. 627 // Paint starting at the nearest self painting layer, clipped to the object itself.
629 // TODO(pdr): This will also paint the content behind the object if the obje ct contains 628 // TODO(pdr): This will also paint the content behind the object if the obje ct contains
630 // transparency but the layer is opaque. We could directly call layoutObject ->paint(...) 629 // transparency but the layer is opaque. We could directly call layoutObject ->paint(...)
631 // (see ObjectPainter::paintAllPhasesAtomically) but this would skip self-pa inting children. 630 // (see ObjectPainter::paintAllPhasesAtomically) but this would skip self-pa inting children.
632 PaintLayer* layer = layoutObject->enclosingLayer()->enclosingSelfPaintingLay er(); 631 PaintLayer* layer = layoutObject->enclosingLayer()->enclosingSelfPaintingLay er();
633 IntRect absoluteBoundingBox = layoutObject->absoluteBoundingBoxRectIncluding Descendants(); 632 IntRect absoluteBoundingBox = layoutObject->absoluteBoundingBoxRectIncluding Descendants();
634 FloatRect boundingBox = layer->layoutObject()->absoluteToLocalQuad(FloatQuad (absoluteBoundingBox), UseTransforms).boundingBox(); 633 FloatRect boundingBox = layer->layoutObject()->absoluteToLocalQuad(FloatQuad (absoluteBoundingBox), UseTransforms).boundingBox();
635 DragImageBuilder dragImageBuilder(this, boundingBox, &node); 634 DragImageBuilder dragImageBuilder(this, boundingBox, &node);
636 { 635 {
637 PaintLayerPaintingInfo paintingInfo(layer, LayoutRect(boundingBox), Glob alPaintFlattenCompositingLayers, LayoutSize(), 0); 636 PaintLayerPaintingInfo paintingInfo(layer, LayoutRect(boundingBox), Glob alPaintFlattenCompositingLayers, LayoutSize(), 0);
638 PaintLayerFlags flags = PaintLayerHaveTransparency | PaintLayerAppliedTr ansform | PaintLayerUncachedClipRects; 637 PaintLayerFlags flags = PaintLayerHaveTransparency | PaintLayerAppliedTr ansform | PaintLayerUncachedClipRects;
639 PaintLayerPainter(*layer).paintLayer(dragImageBuilder.context(), paintin gInfo, flags); 638 PaintLayerPainter(*layer).paintLayer(dragImageBuilder.context(), paintin gInfo, flags);
640 } 639 }
641 return dragImageBuilder.createImage(); 640 return dragImageBuilder.createImage();
642 } 641 }
643 642
644 PassOwnPtr<DragImage> LocalFrame::dragImageForSelection(float opacity) 643 PassOwnPtr<DragImage> LocalFrame::dragImageForSelection(float opacity)
645 { 644 {
646 if (!selection().isRange()) 645 if (!selection().isRange())
647 return nullptr; 646 return nullptr;
648 647
649 // TODO(crbug.com/603230): Synchronized painting is unnecessary in the lifec ycle update. 648 m_view->updateAllLifecyclePhasesExceptPaint();
650 m_view->updateAllLifecyclePhases();
651 ASSERT(document()->isActive()); 649 ASSERT(document()->isActive());
652 650
653 FloatRect paintingRect = FloatRect(selection().bounds()); 651 FloatRect paintingRect = FloatRect(selection().bounds());
654 DragImageBuilder dragImageBuilder(this, paintingRect, nullptr, opacity); 652 DragImageBuilder dragImageBuilder(this, paintingRect, nullptr, opacity);
655 GlobalPaintFlags paintFlags = GlobalPaintSelectionOnly | GlobalPaintFlattenC ompositingLayers; 653 GlobalPaintFlags paintFlags = GlobalPaintSelectionOnly | GlobalPaintFlattenC ompositingLayers;
656 m_view->paintContents(dragImageBuilder.context(), paintFlags, enclosingIntRe ct(paintingRect)); 654 m_view->paintContents(dragImageBuilder.context(), paintFlags, enclosingIntRe ct(paintingRect));
657 return dragImageBuilder.createImage(); 655 return dragImageBuilder.createImage();
658 } 656 }
659 657
660 String LocalFrame::selectedText() const 658 String LocalFrame::selectedText() const
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 { 814 {
817 m_frame->disableNavigation(); 815 m_frame->disableNavigation();
818 } 816 }
819 817
820 FrameNavigationDisabler::~FrameNavigationDisabler() 818 FrameNavigationDisabler::~FrameNavigationDisabler()
821 { 819 {
822 m_frame->enableNavigation(); 820 m_frame->enableNavigation();
823 } 821 }
824 822
825 } // namespace blink 823 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | third_party/WebKit/Source/core/paint/PaintControllerPaintTest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698