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

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

Issue 2081913002: Use correct scale factor value to scale drag image (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use correct scale factor value to scale drag image Created 4 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 STACK_ALLOCATED(); 102 STACK_ALLOCATED();
103 public: 103 public:
104 DragImageBuilder(const LocalFrame* localFrame, const FloatRect& bounds, Node * draggedNode, float opacity = 1) 104 DragImageBuilder(const LocalFrame* localFrame, const FloatRect& bounds, Node * draggedNode, float opacity = 1)
105 : m_localFrame(localFrame) 105 : m_localFrame(localFrame)
106 , m_draggedNode(draggedNode) 106 , m_draggedNode(draggedNode)
107 , m_bounds(bounds) 107 , m_bounds(bounds)
108 , m_opacity(opacity) 108 , m_opacity(opacity)
109 { 109 {
110 if (m_draggedNode && m_draggedNode->layoutObject()) 110 if (m_draggedNode && m_draggedNode->layoutObject())
111 m_draggedNode->layoutObject()->updateDragState(true); 111 m_draggedNode->layoutObject()->updateDragState(true);
112 float deviceScaleFactor = m_localFrame->host()->chromeClient().screenInf o().deviceScaleFactor; 112 // TODO(oshima): Remove this when all platforms are migrated to use-zoom -for-dsf.
113 113 float deviceScaleFactor = m_localFrame->host()->deviceScaleFactorDepreca ted();
114 m_bounds.setWidth(m_bounds.width() * deviceScaleFactor); 114 m_bounds.setWidth(m_bounds.width() * deviceScaleFactor);
115 m_bounds.setHeight(m_bounds.height() * deviceScaleFactor); 115 m_bounds.setHeight(m_bounds.height() * deviceScaleFactor);
116 m_pictureBuilder = adoptPtr(new SkPictureBuilder(SkRect::MakeIWH(m_bound s.width(), m_bounds.height()))); 116 m_pictureBuilder = adoptPtr(new SkPictureBuilder(SkRect::MakeIWH(m_bound s.width(), m_bounds.height())));
117 117
118 AffineTransform transform; 118 AffineTransform transform;
119 transform.scale(deviceScaleFactor, deviceScaleFactor); 119 transform.scale(deviceScaleFactor, deviceScaleFactor);
120 transform.translate(-m_bounds.x(), -m_bounds.y()); 120 transform.translate(-m_bounds.x(), -m_bounds.y());
121 context().getPaintController().createAndAppend<BeginTransformDisplayItem >(*m_pictureBuilder, transform); 121 context().getPaintController().createAndAppend<BeginTransformDisplayItem >(*m_pictureBuilder, transform);
122 } 122 }
123 123
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 m_frame->client()->frameBlameContext()->Enter(); 817 m_frame->client()->frameBlameContext()->Enter();
818 } 818 }
819 819
820 ScopedFrameBlamer::~ScopedFrameBlamer() 820 ScopedFrameBlamer::~ScopedFrameBlamer()
821 { 821 {
822 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 822 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
823 m_frame->client()->frameBlameContext()->Leave(); 823 m_frame->client()->frameBlameContext()->Leave();
824 } 824 }
825 825
826 } // namespace blink 826 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698