Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 610 return ratio; | 610 return ratio; |
| 611 } | 611 } |
| 612 | 612 |
| 613 PassOwnPtr<DragImage> LocalFrame::nodeImage(Node& node) | 613 PassOwnPtr<DragImage> LocalFrame::nodeImage(Node& node) |
| 614 { | 614 { |
| 615 m_view->updateAllLifecyclePhasesExceptPaint(); | 615 m_view->updateAllLifecyclePhasesExceptPaint(); |
| 616 LayoutObject* layoutObject = node.layoutObject(); | 616 LayoutObject* layoutObject = node.layoutObject(); |
| 617 if (!layoutObject) | 617 if (!layoutObject) |
| 618 return nullptr; | 618 return nullptr; |
| 619 | 619 |
| 620 // Paint starting at the nearest self painting layer, clipped to the object itself. | 620 // Paint starting at the nearest stacking context, clipped to the object its elf. |
|
chrishtr
2016/05/19 17:45:16
I wonder if we should explicitly clip now, to avoi
trchen
2016/05/23 19:37:53
As discussed offline, it is already clipped.
| |
| 621 // TODO(pdr): This will also paint the content behind the object if the obje ct contains | 621 // TODO(pdr): This will also paint the content behind the object if the obje ct contains |
|
chrishtr
2016/05/19 17:46:52
I'd change this to a note instead of a TODO. There
trchen
2016/05/23 19:37:53
Done.
| |
| 622 // transparency but the layer is opaque. We could directly call layoutObject ->paint(...) | 622 // transparency but the layer is opaque. We could directly call layoutObject ->paint(...) |
| 623 // (see ObjectPainter::paintAllPhasesAtomically) but this would skip self-pa inting children. | 623 // (see ObjectPainter::paintAllPhasesAtomically) but this would skip self-pa inting children. |
| 624 PaintLayer* layer = layoutObject->enclosingLayer()->enclosingSelfPaintingLay er(); | 624 PaintLayer* layer = layoutObject->enclosingLayer(); |
| 625 if (!layer->stackingNode()->isStackingContext()) | |
| 626 layer = layer->stackingNode()->ancestorStackingContextNode()->layer(); | |
| 625 IntRect absoluteBoundingBox = layoutObject->absoluteBoundingBoxRectIncluding Descendants(); | 627 IntRect absoluteBoundingBox = layoutObject->absoluteBoundingBoxRectIncluding Descendants(); |
| 626 FloatRect boundingBox = layer->layoutObject()->absoluteToLocalQuad(FloatQuad (absoluteBoundingBox), UseTransforms).boundingBox(); | 628 FloatRect boundingBox = layer->layoutObject()->absoluteToLocalQuad(FloatQuad (absoluteBoundingBox), UseTransforms).boundingBox(); |
| 627 DragImageBuilder dragImageBuilder(this, boundingBox, &node); | 629 DragImageBuilder dragImageBuilder(this, boundingBox, &node); |
| 628 { | 630 { |
| 629 PaintLayerPaintingInfo paintingInfo(layer, LayoutRect(boundingBox), Glob alPaintFlattenCompositingLayers, LayoutSize(), 0); | 631 PaintLayerPaintingInfo paintingInfo(layer, LayoutRect(boundingBox), Glob alPaintFlattenCompositingLayers, LayoutSize()); |
| 630 PaintLayerFlags flags = PaintLayerHaveTransparency | PaintLayerAppliedTr ansform | PaintLayerUncachedClipRects; | 632 PaintLayerFlags flags = PaintLayerHaveTransparency | PaintLayerAppliedTr ansform | PaintLayerUncachedClipRects; |
| 631 PaintLayerPainter(*layer).paintLayer(dragImageBuilder.context(), paintin gInfo, flags); | 633 PaintLayerPainter(*layer).paintLayer(dragImageBuilder.context(), paintin gInfo, flags); |
| 632 } | 634 } |
| 633 return dragImageBuilder.createImage(); | 635 return dragImageBuilder.createImage(); |
| 634 } | 636 } |
| 635 | 637 |
| 636 PassOwnPtr<DragImage> LocalFrame::dragImageForSelection(float opacity) | 638 PassOwnPtr<DragImage> LocalFrame::dragImageForSelection(float opacity) |
| 637 { | 639 { |
| 638 if (!selection().isRange()) | 640 if (!selection().isRange()) |
| 639 return nullptr; | 641 return nullptr; |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 807 { | 809 { |
| 808 m_frame->disableNavigation(); | 810 m_frame->disableNavigation(); |
| 809 } | 811 } |
| 810 | 812 |
| 811 FrameNavigationDisabler::~FrameNavigationDisabler() | 813 FrameNavigationDisabler::~FrameNavigationDisabler() |
| 812 { | 814 { |
| 813 m_frame->enableNavigation(); | 815 m_frame->enableNavigation(); |
| 814 } | 816 } |
| 815 | 817 |
| 816 } // namespace blink | 818 } // namespace blink |
| OLD | NEW |