Title: [98892] trunk/Source
Revision
98892
Author
ander...@apple.com
Date
2011-10-31 15:51:19 -0700 (Mon, 31 Oct 2011)

Log Message

More work on making plug-ins work better with transforms
https://bugs.webkit.org/show_bug.cgi?id=71241

Reviewed by Darin Adler.

Source/WebCore:

Export symbols used by WebKit2.

* WebCore.exp.in:

Source/WebKit2:

* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::geometryDidChange):
Implement NetscapePlugin::geometryDidChange and store the plug-in size,
the clip rect and the root view transform. Use the transform to compute the window
relative frame and clip rects.

* WebProcess/Plugins/Netscape/NetscapePlugin.h:
Add new member variables.

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::viewGeometryDidChange):
Always call the new Plugin::geometryDidChange.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (98891 => 98892)


--- trunk/Source/WebCore/ChangeLog	2011-10-31 22:38:06 UTC (rev 98891)
+++ trunk/Source/WebCore/ChangeLog	2011-10-31 22:51:19 UTC (rev 98892)
@@ -1,3 +1,14 @@
+2011-10-31  Anders Carlsson  <ander...@apple.com>
+
+        More work on making plug-ins work better with transforms
+        https://bugs.webkit.org/show_bug.cgi?id=71241
+
+        Reviewed by Darin Adler.
+
+        Export symbols used by WebKit2.
+
+        * WebCore.exp.in:
+
 2011-10-31  Mark Hahnenberg  <mhahnenb...@apple.com>
 
         De-virtualize JSObject::defineGetter

Modified: trunk/Source/WebCore/WebCore.exp.in (98891 => 98892)


--- trunk/Source/WebCore/WebCore.exp.in	2011-10-31 22:38:06 UTC (rev 98891)
+++ trunk/Source/WebCore/WebCore.exp.in	2011-10-31 22:51:19 UTC (rev 98892)
@@ -402,6 +402,7 @@
 __ZN7WebCore14StorageTracker32syncFileSystemAndTrackerDatabaseEv
 __ZN7WebCore14endOfParagraphERKNS_15VisiblePositionENS_27EditingBoundaryCrossingRuleE
 __ZN7WebCore15AffineTransformC1Edddddd
+__ZN7WebCore15AffineTransformC1Ev
 __ZN7WebCore15ArchiveResource6createEN3WTF10PassRefPtrINS_12SharedBufferEEERKNS_4KURLERKNS1_6StringESA_SA_RKNS_16ResourceResponseE
 __ZN7WebCore15DOMWrapperWorld13clearWrappersEv
 __ZN7WebCore15DOMWrapperWorldD1Ev
@@ -1221,6 +1222,7 @@
 __ZNK7WebCore14SecurityOrigin10canDisplayERKNS_4KURLE
 __ZNK7WebCore14SecurityOrigin18databaseIdentifierEv
 __ZNK7WebCore14SecurityOrigin5equalEPKS0_
+__ZNK7WebCore15AffineTransform8mapPointERKNS_8IntPointE
 __ZNK7WebCore15FocusController18focusedOrMainFrameEv
 __ZNK7WebCore15GraphicsContext15platformContextEv
 __ZNK7WebCore15GraphicsContext16paintingDisabledEv

Modified: trunk/Source/WebKit2/ChangeLog (98891 => 98892)


--- trunk/Source/WebKit2/ChangeLog	2011-10-31 22:38:06 UTC (rev 98891)
+++ trunk/Source/WebKit2/ChangeLog	2011-10-31 22:51:19 UTC (rev 98892)
@@ -1,3 +1,23 @@
+2011-10-31  Anders Carlsson  <ander...@apple.com>
+
+        More work on making plug-ins work better with transforms
+        https://bugs.webkit.org/show_bug.cgi?id=71241
+
+        Reviewed by Darin Adler.
+
+        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
+        (WebKit::NetscapePlugin::geometryDidChange):
+        Implement NetscapePlugin::geometryDidChange and store the plug-in size,
+        the clip rect and the root view transform. Use the transform to compute the window
+        relative frame and clip rects.
+
+        * WebProcess/Plugins/Netscape/NetscapePlugin.h:
+        Add new member variables.
+
+        * WebProcess/Plugins/PluginView.cpp:
+        (WebKit::PluginView::viewGeometryDidChange):
+        Always call the new Plugin::geometryDidChange.
+
 2011-10-27  Anders Carlsson  <ander...@apple.com>
 
         Rename a couple of NetscapePlugin and PluginProxy member variables

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


--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp	2011-10-31 22:38:06 UTC (rev 98891)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp	2011-10-31 22:51:19 UTC (rev 98892)
@@ -678,8 +678,25 @@
 
 void NetscapePlugin::geometryDidChange(const IntSize& pluginSize, const IntRect& clipRect, const AffineTransform& pluginToRootViewTransform)
 {
-    // FIXME: This isn't called yet.
-    ASSERT_NOT_REACHED();
+    ASSERT(m_isStarted);
+
+    if (pluginSize == m_pluginSize && m_clipRect == clipRect && m_pluginToRootViewTransform == pluginToRootViewTransform) {
+        // Nothing to do.
+        return;
+    }
+
+    m_pluginSize = pluginSize;
+    m_clipRect = clipRect;
+    m_pluginToRootViewTransform = pluginToRootViewTransform;
+
+    IntPoint frameRectLocationInWindowCoordinates = m_pluginToRootViewTransform.mapPoint(IntPoint());
+    m_frameRectInWindowCoordinates = IntRect(frameRectLocationInWindowCoordinates, m_pluginSize);
+
+    IntPoint clipRectLocationInWindowCoordinates = m_pluginToRootViewTransform.mapPoint(clipRect.location());
+    m_clipRectInWindowCoordinates = IntRect(clipRectLocationInWindowCoordinates, m_clipRect.size());
+
+    platformGeometryDidChange();
+    callSetWindow();
 }
 
 void NetscapePlugin::visibilityDidChange()

Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h (98891 => 98892)


--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h	2011-10-31 22:38:06 UTC (rev 98891)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h	2011-10-31 22:51:19 UTC (rev 98892)
@@ -29,6 +29,7 @@
 #include "NetscapePluginModule.h"
 #include "Plugin.h"
 #include "RunLoop.h"
+#include <WebCore/AffineTransform.h>
 #include <WebCore/GraphicsLayer.h>
 #include <WebCore/IntRect.h>
 #include <wtf/HashMap.h>
@@ -233,6 +234,14 @@
     NPP_t m_npp;
     NPWindow m_npWindow;
 
+    WebCore::IntSize m_pluginSize;
+
+    // The clip rect in plug-in coordinates.
+    WebCore::IntRect m_clipRect;
+
+    // A transform that can be used to convert from root view coordinates to plug-in coordinates.
+    WebCore::AffineTransform m_pluginToRootViewTransform;
+
     // FIXME: Get rid of these.
     WebCore::IntRect m_frameRectInWindowCoordinates;
     WebCore::IntRect m_clipRectInWindowCoordinates;

Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp (98891 => 98892)


--- trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp	2011-10-31 22:38:06 UTC (rev 98891)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp	2011-10-31 22:51:19 UTC (rev 98892)
@@ -720,7 +720,6 @@
         // Get the frame rect in window coordinates.
         IntRect rect = parent()->contentsToWindow(frameRect());
         m_plugin->deprecatedGeometryDidChange(rect, clipRectInWindowCoordinates());
-        return;
     }
 
     // FIXME: Just passing a translation matrix isn't good enough.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to