Title: [99240] trunk/Source/WebKit2
Revision
99240
Author
[email protected]
Date
2011-11-03 16:17:27 -0700 (Thu, 03 Nov 2011)

Log Message

NetscapePlugin::wantsWindowRelativeCoordinates should return false for all ports
https://bugs.webkit.org/show_bug.cgi?id=71501

Reviewed by Darin Adler.

* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::wantsWindowRelativeCoordinates):
Return false.

* WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
(WebKit::NetscapePlugin::platformGeometryDidChange):
Use m_pluginSize instead of m_frameRectInWindowCoordinates.size().

(WebKit::NetscapePlugin::platformPaint):
No need to translate back and forth between window and plug-in relative coordinates anymore.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (99239 => 99240)


--- trunk/Source/WebKit2/ChangeLog	2011-11-03 23:04:46 UTC (rev 99239)
+++ trunk/Source/WebKit2/ChangeLog	2011-11-03 23:17:27 UTC (rev 99240)
@@ -1,3 +1,21 @@
+2011-11-03  Anders Carlsson  <[email protected]>
+
+        NetscapePlugin::wantsWindowRelativeCoordinates should return false for all ports
+        https://bugs.webkit.org/show_bug.cgi?id=71501
+
+        Reviewed by Darin Adler.
+
+        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
+        (WebKit::NetscapePlugin::wantsWindowRelativeCoordinates):
+        Return false.
+
+        * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
+        (WebKit::NetscapePlugin::platformGeometryDidChange):
+        Use m_pluginSize instead of m_frameRectInWindowCoordinates.size().
+
+        (WebKit::NetscapePlugin::platformPaint):
+        No need to translate back and forth between window and plug-in relative coordinates anymore.
+
 2011-11-03  Darin Adler  <[email protected]>
 
         Change remaining callers of releaseRef to call leakRef

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


--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp	2011-11-03 23:04:46 UTC (rev 99239)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp	2011-11-03 23:17:27 UTC (rev 99240)
@@ -935,11 +935,7 @@
 
 bool NetscapePlugin::wantsWindowRelativeCoordinates()
 {
-#if PLUGIN_ARCHITECTURE(MAC)
     return false;
-#else
-    return true;
-#endif
 }
 
 Scrollbar* NetscapePlugin::horizontalScrollbar()

Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp (99239 => 99240)


--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp	2011-11-03 23:04:46 UTC (rev 99239)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp	2011-11-03 23:17:27 UTC (rev 99240)
@@ -213,12 +213,12 @@
     if (m_drawable)
         XFreePixmap(display, m_drawable);
 
-    if (m_frameRectInWindowCoordinates.isEmpty()) {
+    if (m_pluginSize.isEmpty()) {
         m_drawable = 0;
         return;
     }
 
-    m_drawable = XCreatePixmap(display, rootWindowID(), m_frameRectInWindowCoordinates.width(), m_frameRectInWindowCoordinates.height(), displayDepth());
+    m_drawable = XCreatePixmap(display, rootWindowID(), m_pluginSize.width(), m_pluginSize.height(), displayDepth());
 
     XSync(display, false); // Make sure that the server knows about the Drawable.
 }
@@ -244,8 +244,6 @@
         return;
 
 #if PLATFORM(QT)
-    QPainter* painter = context->platformContext();
-    painter->translate(m_frameRectInWindowCoordinates.x(), m_frameRectInWindowCoordinates.y());
 #elif !PLATFORM(GTK)
     notImplemented();
     return;
@@ -259,8 +257,6 @@
     exposeEvent.drawable = m_drawable;
 
     IntRect exposedRect(dirtyRect);
-    exposedRect.intersect(m_frameRectInWindowCoordinates);
-    exposedRect.move(-m_frameRectInWindowCoordinates.x(), -m_frameRectInWindowCoordinates.y());
     exposeEvent.x = exposedRect.x();
     exposeEvent.y = exposedRect.y();
 
@@ -277,9 +273,8 @@
 #if PLATFORM(QT)
     QPixmap qtDrawable = QPixmap::fromX11Pixmap(m_drawable, QPixmap::ExplicitlyShared);
     ASSERT(qtDrawable.depth() == static_cast<NPSetWindowCallbackStruct*>(m_npWindow.ws_info)->depth);
+    QPainter* painter = context->platformContext();
     painter->drawPixmap(QPoint(exposedRect.x(), exposedRect.y()), qtDrawable, exposedRect);
-
-    painter->translate(-m_frameRectInWindowCoordinates.x(), -m_frameRectInWindowCoordinates.y());
 #elif PLATFORM(GTK)
     RefPtr<cairo_surface_t> drawableSurface = adoptRef(cairo_xlib_surface_create(m_pluginDisplay,
                                                                                  m_drawable,
@@ -289,9 +284,9 @@
     cairo_t* cr = context->platformContext()->cr();
     cairo_save(cr);
 
-    cairo_set_source_surface(cr, drawableSurface.get(), m_frameRectInWindowCoordinates.x(), m_frameRectInWindowCoordinates.y());
+    cairo_set_source_surface(cr, drawableSurface.get(), 0, 0);
 
-    cairo_rectangle(cr, m_frameRectInWindowCoordinates.x() + exposedRect.x(), m_frameRectInWindowCoordinates.y() + exposedRect.y(), exposedRect.width(), exposedRect.height());
+    cairo_rectangle(cr, exposedRect.x(), exposedRect.y(), exposedRect.width(), exposedRect.height());
     cairo_clip(cr);
     cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
     cairo_paint(cr);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to