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

Unified Diff: third_party/WebKit/Source/core/frame/LocalFrame.cpp

Issue 2352773003: Fix the scale of Drag and Drop shadow image. (Closed)
Patch Set: space Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/LocalFrameTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/frame/LocalFrame.cpp
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
index 602b58a0855b4a8d8542475a60e638bc07c97c57..09873ac14062de9ca96c57d6be999c0bab9a5602 100644
--- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -48,6 +48,7 @@
#include "core/frame/FrameView.h"
#include "core/frame/LocalDOMWindow.h"
#include "core/frame/Settings.h"
+#include "core/frame/VisualViewport.h"
#include "core/html/HTMLFrameElementBase.h"
#include "core/html/HTMLPlugInElement.h"
#include "core/input/EventHandler.h"
@@ -110,12 +111,13 @@ public:
{
// TODO(oshima): Remove this when all platforms are migrated to use-zoom-for-dsf.
float deviceScaleFactor = m_localFrame->host()->deviceScaleFactorDeprecated();
- m_bounds.setWidth(m_bounds.width() * deviceScaleFactor);
- m_bounds.setHeight(m_bounds.height() * deviceScaleFactor);
+ float pageScaleFactor = m_localFrame->host()->visualViewport().scale();
+ m_bounds.setWidth(m_bounds.width() * deviceScaleFactor * pageScaleFactor);
+ m_bounds.setHeight(m_bounds.height() * deviceScaleFactor * pageScaleFactor);
m_pictureBuilder = wrapUnique(new SkPictureBuilder(SkRect::MakeIWH(m_bounds.width(), m_bounds.height())));
AffineTransform transform;
- transform.scale(deviceScaleFactor, deviceScaleFactor);
+ transform.scale(deviceScaleFactor * pageScaleFactor, deviceScaleFactor * pageScaleFactor);
transform.translate(-m_bounds.x(), -m_bounds.y());
context().getPaintController().createAndAppend<BeginTransformDisplayItem>(*m_pictureBuilder, transform);
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/LocalFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698