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

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

Issue 2719293002: Removed FrameHost::deviceScaleFactorDeprecated() (Closed)
Patch Set: Rebase Created 3 years, 9 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 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
9 * rights reserved. 9 * rights reserved.
10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // content in |bounds| with the appropriate device scale factor included. 113 // content in |bounds| with the appropriate device scale factor included.
114 class DragImageBuilder { 114 class DragImageBuilder {
115 STACK_ALLOCATED(); 115 STACK_ALLOCATED();
116 116
117 public: 117 public:
118 DragImageBuilder(const LocalFrame& localFrame, const FloatRect& bounds) 118 DragImageBuilder(const LocalFrame& localFrame, const FloatRect& bounds)
119 : m_localFrame(&localFrame), m_bounds(bounds) { 119 : m_localFrame(&localFrame), m_bounds(bounds) {
120 // TODO(oshima): Remove this when all platforms are migrated to 120 // TODO(oshima): Remove this when all platforms are migrated to
121 // use-zoom-for-dsf. 121 // use-zoom-for-dsf.
122 float deviceScaleFactor = 122 float deviceScaleFactor =
123 m_localFrame->host()->deviceScaleFactorDeprecated(); 123 m_localFrame->page()->deviceScaleFactorDeprecated();
124 float pageScaleFactor = m_localFrame->host()->visualViewport().scale(); 124 float pageScaleFactor = m_localFrame->host()->visualViewport().scale();
125 m_bounds.setWidth(m_bounds.width() * deviceScaleFactor * pageScaleFactor); 125 m_bounds.setWidth(m_bounds.width() * deviceScaleFactor * pageScaleFactor);
126 m_bounds.setHeight(m_bounds.height() * deviceScaleFactor * pageScaleFactor); 126 m_bounds.setHeight(m_bounds.height() * deviceScaleFactor * pageScaleFactor);
127 m_builder = WTF::wrapUnique(new PaintRecordBuilder( 127 m_builder = WTF::wrapUnique(new PaintRecordBuilder(
128 SkRect::MakeIWH(m_bounds.width(), m_bounds.height()))); 128 SkRect::MakeIWH(m_bounds.width(), m_bounds.height())));
129 129
130 AffineTransform transform; 130 AffineTransform transform;
131 transform.scale(deviceScaleFactor * pageScaleFactor, 131 transform.scale(deviceScaleFactor * pageScaleFactor,
132 deviceScaleFactor * pageScaleFactor); 132 deviceScaleFactor * pageScaleFactor);
133 transform.translate(-m_bounds.x(), -m_bounds.y()); 133 transform.translate(-m_bounds.x(), -m_bounds.y());
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 child = child->tree().nextSibling()) { 707 child = child->tree().nextSibling()) {
708 if (child->isLocalFrame()) 708 if (child->isLocalFrame())
709 toLocalFrame(child)->deviceScaleFactorChanged(); 709 toLocalFrame(child)->deviceScaleFactorChanged();
710 } 710 }
711 } 711 }
712 712
713 double LocalFrame::devicePixelRatio() const { 713 double LocalFrame::devicePixelRatio() const {
714 if (!m_host) 714 if (!m_host)
715 return 0; 715 return 0;
716 716
717 double ratio = m_host->deviceScaleFactorDeprecated(); 717 double ratio = m_host->page().deviceScaleFactorDeprecated();
718 ratio *= pageZoomFactor(); 718 ratio *= pageZoomFactor();
719 return ratio; 719 return ratio;
720 } 720 }
721 721
722 std::unique_ptr<DragImage> LocalFrame::nodeImage(Node& node) { 722 std::unique_ptr<DragImage> LocalFrame::nodeImage(Node& node) {
723 DraggedNodeImageBuilder imageNode(*this, node); 723 DraggedNodeImageBuilder imageNode(*this, node);
724 return imageNode.createImage(); 724 return imageNode.createImage();
725 } 725 }
726 726
727 std::unique_ptr<DragImage> LocalFrame::dragImageForSelection(float opacity) { 727 std::unique_ptr<DragImage> LocalFrame::dragImageForSelection(float opacity) {
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 916 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
917 m_frame->client()->frameBlameContext()->Enter(); 917 m_frame->client()->frameBlameContext()->Enter();
918 } 918 }
919 919
920 ScopedFrameBlamer::~ScopedFrameBlamer() { 920 ScopedFrameBlamer::~ScopedFrameBlamer() {
921 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 921 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
922 m_frame->client()->frameBlameContext()->Leave(); 922 m_frame->client()->frameBlameContext()->Leave();
923 } 923 }
924 924
925 } // namespace blink 925 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameHost.cpp ('k') | third_party/WebKit/Source/core/page/DragController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698