summaryrefslogtreecommitdiff
path: root/Source/WebCore/page/Frame.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-06-25 13:35:59 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-06-25 13:35:59 +0200
commit79ad030d505ccf79cf10aa9f8189ca3e2f61f6f4 (patch)
tree0287b1a69d84492c901e8bc820e635e7133809a0 /Source/WebCore/page/Frame.cpp
parent682ab87480e7757346802ce7f54cfdbdfeb2339e (diff)
downloadqtwebkit-79ad030d505ccf79cf10aa9f8189ca3e2f61f6f4.tar.gz
Imported WebKit commit c4b613825abd39ac739a47d7b4410468fcef66dc (http://svn.webkit.org/repository/webkit/trunk@121147)
New snapshot that includes Win32 debug build fix (use SVGAllInOne)
Diffstat (limited to 'Source/WebCore/page/Frame.cpp')
-rw-r--r--Source/WebCore/page/Frame.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/WebCore/page/Frame.cpp b/Source/WebCore/page/Frame.cpp
index 91d31e3bf..ea57bb4f1 100644
--- a/Source/WebCore/page/Frame.cpp
+++ b/Source/WebCore/page/Frame.cpp
@@ -1089,9 +1089,16 @@ DragImageRef Frame::nodeImage(Node* node)
LayoutRect topLevelRect;
IntRect paintingRect = pixelSnappedIntRect(renderer->paintingRootRect(topLevelRect));
+ float deviceScaleFactor = 1;
+ if (m_page)
+ deviceScaleFactor = m_page->deviceScaleFactor();
+ paintingRect.setWidth(paintingRect.width() * deviceScaleFactor);
+ paintingRect.setHeight(paintingRect.height() * deviceScaleFactor);
+
OwnPtr<ImageBuffer> buffer(ImageBuffer::create(paintingRect.size(), 1, ColorSpaceDeviceRGB));
if (!buffer)
return 0;
+ buffer->context()->scale(FloatSize(deviceScaleFactor, deviceScaleFactor));
buffer->context()->translate(-paintingRect.x(), -paintingRect.y());
buffer->context()->clip(FloatRect(0, 0, paintingRect.maxX(), paintingRect.maxY()));
@@ -1112,9 +1119,16 @@ DragImageRef Frame::dragImageForSelection()
IntRect paintingRect = enclosingIntRect(selection()->bounds());
+ float deviceScaleFactor = 1;
+ if (m_page)
+ deviceScaleFactor = m_page->deviceScaleFactor();
+ paintingRect.setWidth(paintingRect.width() * deviceScaleFactor);
+ paintingRect.setHeight(paintingRect.height() * deviceScaleFactor);
+
OwnPtr<ImageBuffer> buffer(ImageBuffer::create(paintingRect.size(), 1, ColorSpaceDeviceRGB));
if (!buffer)
return 0;
+ buffer->context()->scale(FloatSize(deviceScaleFactor, deviceScaleFactor));
buffer->context()->translate(-paintingRect.x(), -paintingRect.y());
buffer->context()->clip(FloatRect(0, 0, paintingRect.maxX(), paintingRect.maxY()));