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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/LocalFrameTest.cpp » ('j') | 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 30 matching lines...) Expand all
41 #include "core/editing/serializers/Serialization.h" 41 #include "core/editing/serializers/Serialization.h"
42 #include "core/editing/spellcheck/SpellChecker.h" 42 #include "core/editing/spellcheck/SpellChecker.h"
43 #include "core/events/Event.h" 43 #include "core/events/Event.h"
44 #include "core/fetch/ResourceFetcher.h" 44 #include "core/fetch/ResourceFetcher.h"
45 #include "core/frame/EventHandlerRegistry.h" 45 #include "core/frame/EventHandlerRegistry.h"
46 #include "core/frame/FrameConsole.h" 46 #include "core/frame/FrameConsole.h"
47 #include "core/frame/FrameHost.h" 47 #include "core/frame/FrameHost.h"
48 #include "core/frame/FrameView.h" 48 #include "core/frame/FrameView.h"
49 #include "core/frame/LocalDOMWindow.h" 49 #include "core/frame/LocalDOMWindow.h"
50 #include "core/frame/Settings.h" 50 #include "core/frame/Settings.h"
51 #include "core/frame/VisualViewport.h"
51 #include "core/html/HTMLFrameElementBase.h" 52 #include "core/html/HTMLFrameElementBase.h"
52 #include "core/html/HTMLPlugInElement.h" 53 #include "core/html/HTMLPlugInElement.h"
53 #include "core/input/EventHandler.h" 54 #include "core/input/EventHandler.h"
54 #include "core/inspector/InspectorInstrumentation.h" 55 #include "core/inspector/InspectorInstrumentation.h"
55 #include "core/layout/HitTestResult.h" 56 #include "core/layout/HitTestResult.h"
56 #include "core/layout/LayoutView.h" 57 #include "core/layout/LayoutView.h"
57 #include "core/layout/api/LayoutPartItem.h" 58 #include "core/layout/api/LayoutPartItem.h"
58 #include "core/layout/api/LayoutViewItem.h" 59 #include "core/layout/api/LayoutViewItem.h"
59 #include "core/layout/compositing/PaintLayerCompositor.h" 60 #include "core/layout/compositing/PaintLayerCompositor.h"
60 #include "core/loader/FrameLoadRequest.h" 61 #include "core/loader/FrameLoadRequest.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 // factor included. 104 // factor included.
104 class DragImageBuilder { 105 class DragImageBuilder {
105 STACK_ALLOCATED(); 106 STACK_ALLOCATED();
106 public: 107 public:
107 DragImageBuilder(const LocalFrame& localFrame, const FloatRect& bounds) 108 DragImageBuilder(const LocalFrame& localFrame, const FloatRect& bounds)
108 : m_localFrame(&localFrame) 109 : m_localFrame(&localFrame)
109 , m_bounds(bounds) 110 , m_bounds(bounds)
110 { 111 {
111 // TODO(oshima): Remove this when all platforms are migrated to use-zoom -for-dsf. 112 // TODO(oshima): Remove this when all platforms are migrated to use-zoom -for-dsf.
112 float deviceScaleFactor = m_localFrame->host()->deviceScaleFactorDepreca ted(); 113 float deviceScaleFactor = m_localFrame->host()->deviceScaleFactorDepreca ted();
113 m_bounds.setWidth(m_bounds.width() * deviceScaleFactor); 114 float pageScaleFactor = m_localFrame->host()->visualViewport().scale();
114 m_bounds.setHeight(m_bounds.height() * deviceScaleFactor); 115 m_bounds.setWidth(m_bounds.width() * deviceScaleFactor * pageScaleFactor );
116 m_bounds.setHeight(m_bounds.height() * deviceScaleFactor * pageScaleFact or);
115 m_pictureBuilder = wrapUnique(new SkPictureBuilder(SkRect::MakeIWH(m_bou nds.width(), m_bounds.height()))); 117 m_pictureBuilder = wrapUnique(new SkPictureBuilder(SkRect::MakeIWH(m_bou nds.width(), m_bounds.height())));
116 118
117 AffineTransform transform; 119 AffineTransform transform;
118 transform.scale(deviceScaleFactor, deviceScaleFactor); 120 transform.scale(deviceScaleFactor * pageScaleFactor, deviceScaleFactor * pageScaleFactor);
119 transform.translate(-m_bounds.x(), -m_bounds.y()); 121 transform.translate(-m_bounds.x(), -m_bounds.y());
120 context().getPaintController().createAndAppend<BeginTransformDisplayItem >(*m_pictureBuilder, transform); 122 context().getPaintController().createAndAppend<BeginTransformDisplayItem >(*m_pictureBuilder, transform);
121 } 123 }
122 124
123 GraphicsContext& context() { return m_pictureBuilder->context(); } 125 GraphicsContext& context() { return m_pictureBuilder->context(); }
124 126
125 std::unique_ptr<DragImage> createImage( 127 std::unique_ptr<DragImage> createImage(
126 float opacity, 128 float opacity,
127 RespectImageOrientationEnum imageOrientation = DoNotRespectImageOrientat ion) 129 RespectImageOrientationEnum imageOrientation = DoNotRespectImageOrientat ion)
128 { 130 {
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 m_frame->client()->frameBlameContext()->Enter(); 865 m_frame->client()->frameBlameContext()->Enter();
864 } 866 }
865 867
866 ScopedFrameBlamer::~ScopedFrameBlamer() 868 ScopedFrameBlamer::~ScopedFrameBlamer()
867 { 869 {
868 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 870 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
869 m_frame->client()->frameBlameContext()->Leave(); 871 m_frame->client()->frameBlameContext()->Leave();
870 } 872 }
871 873
872 } // namespace blink 874 } // namespace blink
OLDNEW
« 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