OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 RefPtrWillBeRawPtr<LocalFrame> frameProtector(frame); | 62 RefPtrWillBeRawPtr<LocalFrame> frameProtector(frame); |
63 | 63 |
64 WebDragData dragData = dataTransfer->dataObject()->toWebDragData(); | 64 WebDragData dragData = dataTransfer->dataObject()->toWebDragData(); |
65 WebDragOperationsMask dragOperationMask = static_cast<WebDragOperationsMask>
(dataTransfer->sourceOperation()); | 65 WebDragOperationsMask dragOperationMask = static_cast<WebDragOperationsMask>
(dataTransfer->sourceOperation()); |
66 WebImage image; | 66 WebImage image; |
67 IntSize offsetSize(eventPos - dragImageOrigin); | 67 IntSize offsetSize(eventPos - dragImageOrigin); |
68 WebPoint offsetPoint(offsetSize.width(), offsetSize.height()); | 68 WebPoint offsetPoint(offsetSize.width(), offsetSize.height()); |
69 | 69 |
70 if (dragImage) { | 70 if (dragImage) { |
71 float resolutionScale = dragImage->resolutionScale(); | 71 float resolutionScale = dragImage->resolutionScale(); |
72 if (m_webView->deviceScaleFactor() != resolutionScale) { | 72 float deviceScaleFactor = |
| 73 m_webView->client()->screenInfo().deviceScaleFactor; |
| 74 if (deviceScaleFactor != resolutionScale) { |
73 ASSERT(resolutionScale > 0); | 75 ASSERT(resolutionScale > 0); |
74 float scale = m_webView->deviceScaleFactor() / resolutionScale; | 76 float scale = deviceScaleFactor / resolutionScale; |
75 dragImage->scale(scale, scale); | 77 dragImage->scale(scale, scale); |
76 } | 78 } |
77 image = dragImage->bitmap(); | 79 image = dragImage->bitmap(); |
78 } | 80 } |
79 | 81 |
80 m_webView->startDragging(frame, dragData, dragOperationMask, image, offsetPo
int); | 82 m_webView->startDragging(frame, dragData, dragOperationMask, image, offsetPo
int); |
81 } | 83 } |
82 | 84 |
83 } // namespace blink | 85 } // namespace blink |
OLD | NEW |