1. 05 Dec, 2013 1 commit
    • commit-queue@webkit.org's avatar
      Consolidate various frame snapshot capabilities. · 2dd8bf0d
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=124325
      
      Patch by Brian J. Burg <burg@cs.washington.edu> on 2013-12-04
      Reviewed by Darin Adler.
      
      Source/WebCore:
      
      Various snapshot creation methods had duplicated code and were split
      between Frame, DragImage, and platform-specific implementationss.
      This patch puts WebCore snapshot methods into FrameSnapshotting
      and removes platform implementations where possible.
      
      DragImage methods reuse snapshot methods where possible. Inspector
      will be able to take snapshots without using drag images.
      
      No new tests, this is a refactoring.
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * WebCore.exp.in:
      * WebCore.vcxproj/WebCore.vcxproj:
      * WebCore.vcxproj/WebCore.vcxproj.filters:
      * WebCore.xcodeproj/project.pbxproj:
      * bindings/objc/DOM.mm:
      (-[DOMNode renderedImage]):
      (-[DOMRange renderedImageForcingBlackText:]):
      * dom/Clipboard.cpp:
      (WebCore::Clipboard::createDragImage):
      * dom/ClipboardMac.mm:
      (WebCore::Clipboard::createDragImage):
      * page/DragController.cpp:
      (WebCore::DragController::startDrag):
      * page/Frame.cpp:
      * page/Frame.h:
      * page/FrameSnapshotting.cpp: Added.
      (WebCore::ScopedFramePaintingState::ScopedFramePaintingState):
      (WebCore::ScopedFramePaintingState::~ScopedFramePaintingState):
      (WebCore::snapshotFrameRect): Move most buffer logic to here.
      (WebCore::snapshotSelection): Moved from Frame.
      (WebCore::snapshotNode): Moved from Frame.
      * page/FrameSnapshotting.h: Added.
      * page/mac/FrameMac.mm: Removed.
      * page/mac/FrameSnapshottingMac.h: Removed.
      * page/mac/FrameSnapshottingMac.mm: Removed.
      * page/win/FrameWin.cpp: remove duplicate implementation.
      * page/win/FrameWin.h: Fix an incorrect parameter name.
      * platform/DragImage.cpp:
      (WebCore::ScopedNodeDragState::ScopedNodeDragState):
      (WebCore::ScopedNodeDragState::~ScopedNodeDragState):
      (WebCore::createDragImageFromSnapshot): Boilerplate buffer conversion.
      (WebCore::createDragImageForNode):
      (WebCore::createDragImageForSelection):
      (WebCore::ScopedFrameSelectionState::ScopedFrameSelectionState):
      (WebCore::ScopedFrameSelectionState::~ScopedFrameSelectionState):
      (WebCore::createDragImageForRange): Moved from Frame.
      (WebCore::createDragImageForImage): Moved from FrameSnapshottingMac.
      (WebCore::createDragImageForLink): use nullptr.
      
      Source/WebKit/ios:
      
      * WebCoreSupport/WebFrameIOS.mm: use new header file.
      
      Source/WebKit/mac:
      
      Use new platform-independent methods instead of Mac methods.
      
      * WebView/WebHTMLView.mm:
      (-[WebHTMLView _selectionDraggingImage]):
      (-[WebHTMLView selectionImageForcingBlackText:]):
      
      Source/WebKit/win:
      
      * DOMCoreClasses.cpp:
      (DOMElement::renderedImage): use createDragImageForNode.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160152 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2dd8bf0d
  2. 19 Nov, 2013 1 commit
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r159455. · dd9a046c
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/159455
      https://bugs.webkit.org/show_bug.cgi?id=124568
      
      broke two api tests (see bug 124564) (Requested by thorton on
      #webkit).
      
      Source/WebCore:
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * WebCore.exp.in:
      * WebCore.vcxproj/WebCore.vcxproj:
      * WebCore.vcxproj/WebCore.vcxproj.filters:
      * WebCore.xcodeproj/project.pbxproj:
      * bindings/objc/DOM.mm:
      (-[DOMNode renderedImage]):
      (-[DOMRange renderedImageForcingBlackText:]):
      * dom/Clipboard.cpp:
      (WebCore::Clipboard::createDragImage):
      * dom/ClipboardMac.mm:
      (WebCore::Clipboard::createDragImage):
      * page/DragController.cpp:
      (WebCore::DragController::startDrag):
      * page/Frame.cpp:
      (WebCore::ScopedFramePaintingState::ScopedFramePaintingState):
      (WebCore::ScopedFramePaintingState::~ScopedFramePaintingState):
      (WebCore::Frame::nodeImage):
      (WebCore::Frame::dragImageForSelection):
      * page/Frame.h:
      * page/FrameSnapshotting.cpp: Removed.
      * page/FrameSnapshotting.h: Removed.
      * page/mac/FrameMac.mm: Copied from Source/WebCore/page/win/FrameWin.h.
      (WebCore::Frame::nodeImage):
      (WebCore::Frame::dragImageForSelection):
      * page/mac/FrameSnapshottingMac.h: Copied from Source/WebCore/page/win/FrameWin.h.
      * page/mac/FrameSnapshottingMac.mm: Added.
      (WebCore::imageFromRect):
      (WebCore::selectionImage):
      (WebCore::rangeImage):
      (WebCore::snapshotDragImage):
      * page/win/FrameWin.cpp:
      (WebCore::Frame::dragImageForSelection):
      (WebCore::Frame::nodeImage):
      * page/win/FrameWin.h:
      * platform/DragImage.cpp:
      (WebCore::fitDragImageToMaxSize):
      (WebCore::createDragImageForLink):
      * platform/DragImage.h:
      
      Source/WebKit/ios:
      
      * WebCoreSupport/WebFrameIOS.mm:
      
      Source/WebKit/mac:
      
      * WebView/WebHTMLView.mm:
      (-[WebHTMLView _selectionDraggingImage]):
      (-[WebHTMLView selectionImageForcingBlackText:]):
      
      Source/WebKit/win:
      
      * DOMCoreClasses.cpp:
      (DOMElement::renderedImage):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159487 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      dd9a046c
  3. 18 Nov, 2013 1 commit
    • commit-queue@webkit.org's avatar
      Consolidate various frame snapshot capabilities. · 6978d8ed
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=124325
      
      Patch by Brian J. Burg <burg@cs.washington.edu> on 2013-11-18
      Reviewed by Timothy Hatcher.
      
      Source/WebCore:
      
      Various snapshot creation methods had duplicated code and were split
      between Frame, DragImage, and platform-specific implementationss.
      This patch puts WebCore snapshot methods into FrameSnapshotting
      and removes platform implementations where possible.
      
      DragImage methods reuse snapshot methods where possible. Inspector
      will be able to take snapshots without using drag images.
      
      No new tests, this is a refactoring.
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * WebCore.exp.in:
      * WebCore.vcxproj/WebCore.vcxproj:
      * WebCore.vcxproj/WebCore.vcxproj.filters:
      * WebCore.xcodeproj/project.pbxproj:
      * bindings/objc/DOM.mm:
      (-[DOMNode renderedImage]):
      (-[DOMRange renderedImageForcingBlackText:]):
      * dom/Clipboard.cpp:
      (WebCore::Clipboard::createDragImage):
      * dom/ClipboardMac.mm:
      (WebCore::Clipboard::createDragImage):
      * page/DragController.cpp:
      (WebCore::DragController::startDrag):
      * page/Frame.cpp:
      * page/Frame.h:
      * page/FrameSnapshotting.cpp: Added.
      (WebCore::ScopedFramePaintingState::ScopedFramePaintingState):
      (WebCore::ScopedFramePaintingState::~ScopedFramePaintingState):
      (WebCore::snapshotFrameRect): Move most buffer logic to here.
      (WebCore::snapshotSelection): Moved from Frame.
      (WebCore::snapshotNode): Moved from Frame.
      * page/FrameSnapshotting.h: Added.
      * page/mac/FrameMac.mm: Removed.
      * page/mac/FrameSnapshottingMac.h: Removed.
      * page/mac/FrameSnapshottingMac.mm: Removed.
      * page/win/FrameWin.cpp: remove duplicate implementation.
      * page/win/FrameWin.h: Fix an incorrect parameter name.
      * platform/DragImage.cpp:
      (WebCore::ScopedNodeDragState::ScopedNodeDragState):
      (WebCore::ScopedNodeDragState::~ScopedNodeDragState):
      (WebCore::createDragImageFromSnapshot): Boilerplate buffer conversion.
      (WebCore::createDragImageForNode):
      (WebCore::createDragImageForSelection):
      (WebCore::ScopedFrameSelectionState::ScopedFrameSelectionState):
      (WebCore::ScopedFrameSelectionState::~ScopedFrameSelectionState):
      (WebCore::createDragImageForRange): Moved from Frame.
      (WebCore::createDragImageForImage): Moved from FrameSnapshottingMac.
      (WebCore::createDragImageForLink): use nullptr.
      
      Source/WebKit/ios:
      
      * WebCoreSupport/WebFrameIOS.mm: use new header file.
      
      Source/WebKit/mac:
      
      Use new platform-independent methods instead of Mac methods.
      
      * WebView/WebHTMLView.mm:
      (-[WebHTMLView _selectionDraggingImage]):
      (-[WebHTMLView selectionImageForcingBlackText:]):
      
      Source/WebKit/win:
      
      * DOMCoreClasses.cpp:
      (DOMElement::renderedImage): use createDragImageForNode.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159455 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6978d8ed