Title: [99090] trunk/Source/WebKit2
Revision
99090
Author
[email protected]
Date
2011-11-02 13:05:54 -0700 (Wed, 02 Nov 2011)

Log Message

Plug-in snapshots are blurry in HiDPI
https://bugs.webkit.org/show_bug.cgi?id=71387
<rdar://problem/10385393>

Reviewed by Adam Roben.

* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::snapshot):
Create the backing store in the right size and apply the contents scale factor
to the newly created graphics context.

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::paint):
Pass the scale factor to ShareableBitmap::paint.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (99089 => 99090)


--- trunk/Source/WebKit2/ChangeLog	2011-11-02 19:28:48 UTC (rev 99089)
+++ trunk/Source/WebKit2/ChangeLog	2011-11-02 20:05:54 UTC (rev 99090)
@@ -1,3 +1,20 @@
+2011-11-02  Anders Carlsson  <[email protected]>
+
+        Plug-in snapshots are blurry in HiDPI
+        https://bugs.webkit.org/show_bug.cgi?id=71387
+        <rdar://problem/10385393>
+
+        Reviewed by Adam Roben.
+
+        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
+        (WebKit::NetscapePlugin::snapshot):
+        Create the backing store in the right size and apply the contents scale factor
+        to the newly created graphics context.
+
+        * WebProcess/Plugins/PluginView.cpp:
+        (WebKit::PluginView::paint):
+        Pass the scale factor to ShareableBitmap::paint.
+
 2011-11-02  Caio Marcelo de Oliveira Filho  <[email protected]>
 
         [Qt] Implement message exchange between WebView and the web page

Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp (99089 => 99090)


--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp	2011-11-02 19:28:48 UTC (rev 99089)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp	2011-11-02 20:05:54 UTC (rev 99090)
@@ -644,12 +644,20 @@
         return 0;
 
     ASSERT(m_isStarted);
-    
-    RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(m_frameRectInWindowCoordinates.size(), ShareableBitmap::SupportsAlpha);
+
+    IntSize backingStoreSize = m_pluginSize;
+    backingStoreSize.scale(contentsScaleFactor());
+
+    RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(backingStoreSize, ShareableBitmap::SupportsAlpha);
     OwnPtr<GraphicsContext> context = bitmap->createGraphicsContext();
 
+#if PLATFORM(MAC)
+    // FIXME: We should really call applyDeviceScaleFactor instead of scale, but that ends up calling into WKSI
+    // which we currently don't have initiated in the plug-in process.
+    context->scale(FloatSize(contentsScaleFactor(), contentsScaleFactor()));
+#endif
+
     context->translate(-m_frameRectInWindowCoordinates.x(), -m_frameRectInWindowCoordinates.y());
-
     platformPaint(context.get(), m_frameRectInWindowCoordinates, true);
     
     return bitmap.release();

Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp (99089 => 99090)


--- trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp	2011-11-02 19:28:48 UTC (rev 99089)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp	2011-11-02 20:05:54 UTC (rev 99090)
@@ -589,7 +589,7 @@
         return;
 
     if (m_snapshot) {
-        m_snapshot->paint(*context, frameRect().location(), m_snapshot->bounds());
+        m_snapshot->paint(*context, contentsScaleFactor(), frameRect().location(), m_snapshot->bounds());
         return;
     }
     
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to