| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 m_draggedNode->layoutObject()->updateDragState(true); | 108 m_draggedNode->layoutObject()->updateDragState(true); |
| 109 | 109 |
| 110 float deviceScaleFactor = m_localFrame->host()->deviceScaleFactor(); | 110 float deviceScaleFactor = m_localFrame->host()->deviceScaleFactor(); |
| 111 m_bounds.setWidth(m_bounds.width() * deviceScaleFactor); | 111 m_bounds.setWidth(m_bounds.width() * deviceScaleFactor); |
| 112 m_bounds.setHeight(m_bounds.height() * deviceScaleFactor); | 112 m_bounds.setHeight(m_bounds.height() * deviceScaleFactor); |
| 113 m_pictureBuilder = adoptPtr(new SkPictureBuilder(SkRect::MakeIWH(m_bound
s.width(), m_bounds.height()))); | 113 m_pictureBuilder = adoptPtr(new SkPictureBuilder(SkRect::MakeIWH(m_bound
s.width(), m_bounds.height()))); |
| 114 | 114 |
| 115 AffineTransform transform; | 115 AffineTransform transform; |
| 116 transform.scale(deviceScaleFactor, deviceScaleFactor); | 116 transform.scale(deviceScaleFactor, deviceScaleFactor); |
| 117 transform.translate(-m_bounds.x(), -m_bounds.y()); | 117 transform.translate(-m_bounds.x(), -m_bounds.y()); |
| 118 context().paintController().createAndAppend<BeginTransformDisplayItem>(*
m_localFrame, transform); | 118 context().getPaintController().createAndAppend<BeginTransformDisplayItem
>(*m_localFrame, transform); |
| 119 } | 119 } |
| 120 | 120 |
| 121 GraphicsContext& context() { return m_pictureBuilder->context(); } | 121 GraphicsContext& context() { return m_pictureBuilder->context(); } |
| 122 | 122 |
| 123 PassOwnPtr<DragImage> createImage() | 123 PassOwnPtr<DragImage> createImage() |
| 124 { | 124 { |
| 125 if (m_draggedNode && m_draggedNode->layoutObject()) | 125 if (m_draggedNode && m_draggedNode->layoutObject()) |
| 126 m_draggedNode->layoutObject()->updateDragState(false); | 126 m_draggedNode->layoutObject()->updateDragState(false); |
| 127 context().paintController().endItem<EndTransformDisplayItem>(*m_localFra
me); | 127 context().getPaintController().endItem<EndTransformDisplayItem>(*m_local
Frame); |
| 128 RefPtr<const SkPicture> recording = m_pictureBuilder->endRecording(); | 128 RefPtr<const SkPicture> recording = m_pictureBuilder->endRecording(); |
| 129 RefPtr<SkImage> skImage = adoptRef(SkImage::NewFromPicture(recording.get
(), | 129 RefPtr<SkImage> skImage = adoptRef(SkImage::NewFromPicture(recording.get
(), |
| 130 SkISize::Make(m_bounds.width(), m_bounds.height()), nullptr, nullptr
)); | 130 SkISize::Make(m_bounds.width(), m_bounds.height()), nullptr, nullptr
)); |
| 131 RefPtr<Image> image = StaticBitmapImage::create(skImage.release()); | 131 RefPtr<Image> image = StaticBitmapImage::create(skImage.release()); |
| 132 RespectImageOrientationEnum imageOrientation = DoNotRespectImageOrientat
ion; | 132 RespectImageOrientationEnum imageOrientation = DoNotRespectImageOrientat
ion; |
| 133 if (m_draggedNode && m_draggedNode->layoutObject()) | 133 if (m_draggedNode && m_draggedNode->layoutObject()) |
| 134 imageOrientation = LayoutObject::shouldRespectImageOrientation(m_dra
ggedNode->layoutObject()); | 134 imageOrientation = LayoutObject::shouldRespectImageOrientation(m_dra
ggedNode->layoutObject()); |
| 135 | 135 |
| 136 float screenDeviceScaleFactor = m_localFrame->page()->chromeClient().scr
eenInfo().deviceScaleFactor; | 136 float screenDeviceScaleFactor = m_localFrame->page()->chromeClient().scr
eenInfo().deviceScaleFactor; |
| 137 | 137 |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 | 771 |
| 772 FloatSize remainingDelta = delta; | 772 FloatSize remainingDelta = delta; |
| 773 | 773 |
| 774 // If this is main frame, allow top controls to scroll first. | 774 // If this is main frame, allow top controls to scroll first. |
| 775 if (shouldScrollTopControls(granularity, delta)) | 775 if (shouldScrollTopControls(granularity, delta)) |
| 776 remainingDelta = host()->topControls().scrollBy(remainingDelta); | 776 remainingDelta = host()->topControls().scrollBy(remainingDelta); |
| 777 | 777 |
| 778 if (remainingDelta.isZero()) | 778 if (remainingDelta.isZero()) |
| 779 return ScrollResult(delta.width(), delta.height(), 0.0f, 0.0f); | 779 return ScrollResult(delta.width(), delta.height(), 0.0f, 0.0f); |
| 780 | 780 |
| 781 ScrollResult result = view()->scrollableArea()->userScroll(granularity, rema
iningDelta); | 781 ScrollResult result = view()->getScrollableArea()->userScroll(granularity, r
emainingDelta); |
| 782 result.didScrollX = result.didScrollX || (remainingDelta.width() != delta.wi
dth()); | 782 result.didScrollX = result.didScrollX || (remainingDelta.width() != delta.wi
dth()); |
| 783 result.didScrollY = result.didScrollY || (remainingDelta.height() != delta.h
eight()); | 783 result.didScrollY = result.didScrollY || (remainingDelta.height() != delta.h
eight()); |
| 784 | 784 |
| 785 return result; | 785 return result; |
| 786 } | 786 } |
| 787 | 787 |
| 788 bool LocalFrame::shouldScrollTopControls(ScrollGranularity granularity, const Fl
oatSize& delta) const | 788 bool LocalFrame::shouldScrollTopControls(ScrollGranularity granularity, const Fl
oatSize& delta) const |
| 789 { | 789 { |
| 790 if (!isMainFrame()) | 790 if (!isMainFrame()) |
| 791 return false; | 791 return false; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 { | 869 { |
| 870 m_frame->disableNavigation(); | 870 m_frame->disableNavigation(); |
| 871 } | 871 } |
| 872 | 872 |
| 873 FrameNavigationDisabler::~FrameNavigationDisabler() | 873 FrameNavigationDisabler::~FrameNavigationDisabler() |
| 874 { | 874 { |
| 875 m_frame->enableNavigation(); | 875 m_frame->enableNavigation(); |
| 876 } | 876 } |
| 877 | 877 |
| 878 } // namespace blink | 878 } // namespace blink |
| OLD | NEW |