Title: [98928] trunk/Source/WebKit2
Revision
98928
Author
ander...@apple.com
Date
2011-10-31 17:59:34 -0700 (Mon, 31 Oct 2011)

Log Message

PluginProxy::Update should pass the painted rect in plug-in coordinates
https://bugs.webkit.org/show_bug.cgi?id=71257

Reviewed by Adam Roben.

This is one step in the process of migrating away from window relative coordinates
and use plug-in relative coordinates instead, since window relative coordinates won't work
with transforms.

* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::paint):
Convert the dirty rect back to plug-in coordinates.

* WebProcess/Plugins/PluginProxy.cpp:
(WebKit::PluginProxy::update):
No need to convert the painted rect back to plug-in coordinates anymore.

* WebProcess/Plugins/PluginProxy.messages.in:
Document that the painted rect is in plug-in coordinates.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (98927 => 98928)


--- trunk/Source/WebKit2/ChangeLog	2011-11-01 00:50:44 UTC (rev 98927)
+++ trunk/Source/WebKit2/ChangeLog	2011-11-01 00:59:34 UTC (rev 98928)
@@ -1,5 +1,27 @@
 2011-10-31  Anders Carlsson  <ander...@apple.com>
 
+        PluginProxy::Update should pass the painted rect in plug-in coordinates
+        https://bugs.webkit.org/show_bug.cgi?id=71257
+
+        Reviewed by Adam Roben.
+
+        This is one step in the process of migrating away from window relative coordinates
+        and use plug-in relative coordinates instead, since window relative coordinates won't work
+        with transforms.
+
+        * PluginProcess/PluginControllerProxy.cpp:
+        (WebKit::PluginControllerProxy::paint):
+        Convert the dirty rect back to plug-in coordinates.
+
+        * WebProcess/Plugins/PluginProxy.cpp:
+        (WebKit::PluginProxy::update):
+        No need to convert the painted rect back to plug-in coordinates anymore.
+
+        * WebProcess/Plugins/PluginProxy.messages.in:
+        Document that the painted rect is in plug-in coordinates.
+
+2011-10-31  Anders Carlsson  <ander...@apple.com>
+
         PluginControllerProxy should call Plugin::geometryDidChange
         https://bugs.webkit.org/show_bug.cgi?id=71255
 

Modified: trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp (98927 => 98928)


--- trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp	2011-11-01 00:50:44 UTC (rev 98927)
+++ trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp	2011-11-01 00:59:34 UTC (rev 98928)
@@ -176,6 +176,8 @@
 
     m_plugin->paint(graphicsContext.get(), dirtyRect);
 
+    // Convert the dirty rect back to plug-in coordinates.
+    dirtyRect.move(-m_frameRectInWindowCoordinates.x(), -m_frameRectInWindowCoordinates.y());
     m_connection->connection()->send(Messages::PluginProxy::Update(dirtyRect), m_pluginInstanceID);
 }
 

Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp (98927 => 98928)


--- trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp	2011-11-01 00:50:44 UTC (rev 98927)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp	2011-11-01 00:59:34 UTC (rev 98928)
@@ -551,24 +551,20 @@
 
 void PluginProxy::update(const IntRect& paintedRect)
 {
-    if (paintedRect == m_frameRectInWindowCoordinates)
+    if (paintedRect == pluginBounds())
         m_pluginBackingStoreContainsValidData = true;
 
-    IntRect paintedRectPluginCoordinates = paintedRect;
-    paintedRectPluginCoordinates.move(-m_frameRectInWindowCoordinates.x(), -m_frameRectInWindowCoordinates.y());
-
     if (m_backingStore) {
         // Blit the plug-in backing store into our own backing store.
         OwnPtr<GraphicsContext> graphicsContext = m_backingStore->createGraphicsContext();
         graphicsContext->applyDeviceScaleFactor(contentsScaleFactor());
         graphicsContext->setCompositeOperation(CompositeCopy);
-        m_pluginBackingStore->paint(*graphicsContext, contentsScaleFactor(), paintedRectPluginCoordinates.location(), 
-                                    paintedRectPluginCoordinates);
+        m_pluginBackingStore->paint(*graphicsContext, contentsScaleFactor(), paintedRect.location(), paintedRect);
     }
 
     // Ask the controller to invalidate the rect for us.
     m_waitingForPaintInResponseToUpdate = true;
-    controller()->invalidate(paintedRectPluginCoordinates);
+    controller()->invalidate(paintedRect);
 }
 
 } // namespace WebKit

Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.messages.in (98927 => 98928)


--- trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.messages.in	2011-11-01 00:50:44 UTC (rev 98927)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.messages.in	2011-11-01 00:59:34 UTC (rev 98928)
@@ -26,7 +26,7 @@
     # Asks the web process to load a URL.
     LoadURL(uint64_t requestID, WTF::String method, WTF::String urlString, WTF::String target, WebCore::HTTPHeaderMap headerFields, Vector<uint8_t> httpBody, bool allowPopups);
 
-    # Called when the plug-in has painted into its backing store.
+    # Called when the plug-in has painted into its backing store. The painted rect is in plug-in coordinates.
     Update(WebCore::IntRect paintedRect)
 
     # Returns a PAC style string with proxies for the given URL.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to