Title: [171889] trunk/Source/WebCore
Revision
171889
Author
[email protected]
Date
2014-07-31 15:06:10 -0700 (Thu, 31 Jul 2014)

Log Message

DOM::renderedImageForcingBlackText returns an image with the wrong logical size on 2x displays
https://bugs.webkit.org/show_bug.cgi?id=135442
<rdar://problem/17614632>

Reviewed by Simon Fraser.

* bindings/objc/DOM.mm:
(-[DOMRange renderedImageForcingBlackText:renderedImageForcingBlackText:]):
Scale the NSImage size by the device scale factor,
similar to what we did for drag images in r167403.
Ideally this scaling would happen in the code that
generates the images, but this is a much larger change
with much more regression potential.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (171888 => 171889)


--- trunk/Source/WebCore/ChangeLog	2014-07-31 21:56:38 UTC (rev 171888)
+++ trunk/Source/WebCore/ChangeLog	2014-07-31 22:06:10 UTC (rev 171889)
@@ -1,3 +1,19 @@
+2014-07-31  Tim Horton  <[email protected]>
+
+        DOM::renderedImageForcingBlackText returns an image with the wrong logical size on 2x displays
+        https://bugs.webkit.org/show_bug.cgi?id=135442
+        <rdar://problem/17614632>
+
+        Reviewed by Simon Fraser.
+
+        * bindings/objc/DOM.mm:
+        (-[DOMRange renderedImageForcingBlackText:renderedImageForcingBlackText:]):
+        Scale the NSImage size by the device scale factor,
+        similar to what we did for drag images in r167403.
+        Ideally this scaling would happen in the code that
+        generates the images, but this is a much larger change
+        with much more regression potential.
+
 2014-07-31  Bear Travis  <[email protected]>
 
         [CSS Font Loading] Rename document.fontloader to document.fonts

Modified: trunk/Source/WebCore/bindings/objc/DOM.mm (171888 => 171889)


--- trunk/Source/WebCore/bindings/objc/DOM.mm	2014-07-31 21:56:38 UTC (rev 171888)
+++ trunk/Source/WebCore/bindings/objc/DOM.mm	2014-07-31 22:06:10 UTC (rev 171889)
@@ -46,6 +46,7 @@
 #import "Image.h"
 #import "JSNode.h"
 #import "NodeFilter.h"
+#import "Page.h"
 #import "Range.h"
 #import "RenderImage.h"
 #import "ScriptController.h"
@@ -609,7 +610,13 @@
     if (!frame)
         return nil;
 
-    return createDragImageForRange(*frame, *range, forceBlackText).autorelease();
+    RetainPtr<NSImage> renderedImage = createDragImageForRange(*frame, *range, forceBlackText);
+
+    IntSize size([renderedImage size]);
+    size.scale(1 / frame->page()->deviceScaleFactor());
+    [renderedImage setSize:size];
+
+    return renderedImage.autorelease();
 }
 
 - (NSArray *)textRects
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to