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

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

Issue 1331533002: [poc] curve-filter Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix CanvasRenderingContext2D::createPattern crash for #40 Created 4 years, 11 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 #include "core/paint/ObjectPainter.h" 63 #include "core/paint/ObjectPainter.h"
64 #include "core/paint/PaintInfo.h" 64 #include "core/paint/PaintInfo.h"
65 #include "core/paint/PaintLayer.h" 65 #include "core/paint/PaintLayer.h"
66 #include "core/paint/TransformRecorder.h" 66 #include "core/paint/TransformRecorder.h"
67 #include "core/svg/SVGDocumentExtensions.h" 67 #include "core/svg/SVGDocumentExtensions.h"
68 #include "platform/DragImage.h" 68 #include "platform/DragImage.h"
69 #include "platform/PluginScriptForbiddenScope.h" 69 #include "platform/PluginScriptForbiddenScope.h"
70 #include "platform/RuntimeEnabledFeatures.h" 70 #include "platform/RuntimeEnabledFeatures.h"
71 #include "platform/ScriptForbiddenScope.h" 71 #include "platform/ScriptForbiddenScope.h"
72 #include "platform/graphics/GraphicsContext.h" 72 #include "platform/graphics/GraphicsContext.h"
73 #include "platform/graphics/GraphicsScreen.h"
73 #include "platform/graphics/StaticBitmapImage.h" 74 #include "platform/graphics/StaticBitmapImage.h"
74 #include "platform/graphics/paint/ClipRecorder.h" 75 #include "platform/graphics/paint/ClipRecorder.h"
75 #include "platform/graphics/paint/SkPictureBuilder.h" 76 #include "platform/graphics/paint/SkPictureBuilder.h"
76 #include "platform/graphics/paint/TransformDisplayItem.h" 77 #include "platform/graphics/paint/TransformDisplayItem.h"
77 #include "platform/text/TextStream.h" 78 #include "platform/text/TextStream.h"
78 #include "public/platform/WebFrameScheduler.h" 79 #include "public/platform/WebFrameScheduler.h"
79 #include "public/platform/WebSecurityOrigin.h" 80 #include "public/platform/WebSecurityOrigin.h"
80 #include "public/platform/WebViewScheduler.h" 81 #include "public/platform/WebViewScheduler.h"
81 #include "third_party/skia/include/core/SkImage.h" 82 #include "third_party/skia/include/core/SkImage.h"
82 #include "wtf/PassOwnPtr.h" 83 #include "wtf/PassOwnPtr.h"
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 return dragImageBuilder.createImage(); 654 return dragImageBuilder.createImage();
654 } 655 }
655 656
656 PassOwnPtr<DragImage> LocalFrame::nodeImage(Node& node) 657 PassOwnPtr<DragImage> LocalFrame::nodeImage(Node& node)
657 { 658 {
658 m_view->updateAllLifecyclePhases(); 659 m_view->updateAllLifecyclePhases();
659 LayoutObject* layoutObject = node.layoutObject(); 660 LayoutObject* layoutObject = node.layoutObject();
660 if (!layoutObject) 661 if (!layoutObject)
661 return nullptr; 662 return nullptr;
662 663
664 WillPaintForDevice device(Page::screenId(page()));
665
663 // Directly paint boxes as if they are a stacking context. 666 // Directly paint boxes as if they are a stacking context.
664 if (layoutObject->isBox() && layoutObject->container()) { 667 if (layoutObject->isBox() && layoutObject->container()) {
665 IntRect boundingBox = layoutObject->absoluteBoundingBoxRectIncludingDesc endants(); 668 IntRect boundingBox = layoutObject->absoluteBoundingBoxRectIncludingDesc endants();
666 LayoutPoint paintOffset = boundingBox.location() - layoutObject->offsetF romContainer(layoutObject->container(), LayoutPoint()); 669 LayoutPoint paintOffset = boundingBox.location() - layoutObject->offsetF romContainer(layoutObject->container(), LayoutPoint());
667 670
668 DragImageBuilder dragImageBuilder(this, boundingBox, &node); 671 DragImageBuilder dragImageBuilder(this, boundingBox, &node);
669 { 672 {
670 PaintInfo paintInfo(dragImageBuilder.context(), boundingBox, PaintPh ase::PaintPhaseForeground, GlobalPaintFlattenCompositingLayers, 0); 673 PaintInfo paintInfo(dragImageBuilder.context(), boundingBox, PaintPh ase::PaintPhaseForeground, GlobalPaintFlattenCompositingLayers, 0);
671 ObjectPainter(*layoutObject).paintAsPseudoStackingContext(paintInfo, LayoutPoint(paintOffset)); 674 ObjectPainter(*layoutObject).paintAsPseudoStackingContext(paintInfo, LayoutPoint(paintOffset));
672 } 675 }
673 return dragImageBuilder.createImage(); 676 return dragImageBuilder.createImage();
674 } 677 }
675 678
676 // TODO(pdr): This will also paint the background if the object contains tra nsparency. We can 679 // TODO(pdr): This will also paint the background if the object contains tra nsparency. We can
677 // directly call layoutObject->paint(...) (see: ObjectPainter::paintAsPseudo StackingContext) but 680 // directly call layoutObject->paint(...) (see: ObjectPainter::paintAsPseudo StackingContext) but
678 // painters are inconsistent about which transform space they expect (see: s vg, inlines, etc.) 681 // painters are inconsistent about which transform space they expect (see: s vg, inlines, etc.)
679 // TODO(pdr): SVG and inlines are painted offset (crbug.com/579153, crbug.co m/579158). 682 // TODO(pdr): SVG and inlines are painted offset (crbug.com/579153, crbug.co m/579158).
680 return paintIntoDragImage(GlobalPaintFlattenCompositingLayers, layoutObject- >absoluteBoundingBoxRectIncludingDescendants(), &node); 683 return paintIntoDragImage(GlobalPaintFlattenCompositingLayers, layoutObject- >absoluteBoundingBoxRectIncludingDescendants(), &node);
681 } 684 }
682 685
683 PassOwnPtr<DragImage> LocalFrame::dragImageForSelection(float opacity) 686 PassOwnPtr<DragImage> LocalFrame::dragImageForSelection(float opacity)
684 { 687 {
685 if (!selection().isRange()) 688 if (!selection().isRange())
686 return nullptr; 689 return nullptr;
687 690
691 WillPaintForDevice device(Page::screenId(page()));
692
688 m_view->updateAllLifecyclePhases(); 693 m_view->updateAllLifecyclePhases();
689 694
690 return paintIntoDragImage(GlobalPaintSelectionOnly | GlobalPaintFlattenCompo sitingLayers, 695 return paintIntoDragImage(GlobalPaintSelectionOnly | GlobalPaintFlattenCompo sitingLayers,
691 enclosingIntRect(selection().bounds()), nullptr, opacity); 696 enclosingIntRect(selection().bounds()), nullptr, opacity);
692 } 697 }
693 698
694 String LocalFrame::selectedText() const 699 String LocalFrame::selectedText() const
695 { 700 {
696 return selection().selectedText(); 701 return selection().selectedText();
697 } 702 }
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
899 { 904 {
900 m_frame->disableNavigation(); 905 m_frame->disableNavigation();
901 } 906 }
902 907
903 FrameNavigationDisabler::~FrameNavigationDisabler() 908 FrameNavigationDisabler::~FrameNavigationDisabler()
904 { 909 {
905 m_frame->enableNavigation(); 910 m_frame->enableNavigation();
906 } 911 }
907 912
908 } // namespace blink 913 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/ImageBitmap.cpp ('k') | third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698