Title: [115402] trunk/Source/WebKit2
Revision
115402
Author
[email protected]
Date
2012-04-26 20:16:32 -0700 (Thu, 26 Apr 2012)

Log Message

[Qt][WK2] A GraphicsSurface instance is created with every update
https://bugs.webkit.org/show_bug.cgi?id=85014

Reviewed by Kenneth Rohde Christiansen.

Keep a copy of the GraphicsSurface in the UI process, and reuse it for
subsequent updates. This ensure that the texture and other data associated
with the GraphicsSurface does not need to be reconstructed.

* Shared/ShareableSurface.h:
(Handle):
(WebKit::ShareableSurface::Handle::graphicsSurfaceToken):
* UIProcess/LayerTreeHostProxy.cpp:
(WebKit::LayerTreeHostProxy::updateTileForLayer):
* UIProcess/LayerTreeHostProxy.h:
(LayerTreeHostProxy):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (115401 => 115402)


--- trunk/Source/WebKit2/ChangeLog	2012-04-27 03:08:47 UTC (rev 115401)
+++ trunk/Source/WebKit2/ChangeLog	2012-04-27 03:16:32 UTC (rev 115402)
@@ -1,3 +1,22 @@
+2012-04-26  No'am Rosenthal  <[email protected]>
+
+        [Qt][WK2] A GraphicsSurface instance is created with every update
+        https://bugs.webkit.org/show_bug.cgi?id=85014
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Keep a copy of the GraphicsSurface in the UI process, and reuse it for
+        subsequent updates. This ensure that the texture and other data associated
+        with the GraphicsSurface does not need to be reconstructed.
+
+        * Shared/ShareableSurface.h:
+        (Handle):
+        (WebKit::ShareableSurface::Handle::graphicsSurfaceToken):
+        * UIProcess/LayerTreeHostProxy.cpp:
+        (WebKit::LayerTreeHostProxy::updateTileForLayer):
+        * UIProcess/LayerTreeHostProxy.h:
+        (LayerTreeHostProxy):
+
 2012-04-26  Martin Robinson  <[email protected]>
 
         [Cairo] Wrap cairo surfaces in a class when storing native images

Modified: trunk/Source/WebKit2/Shared/ShareableSurface.h (115401 => 115402)


--- trunk/Source/WebKit2/Shared/ShareableSurface.h	2012-04-27 03:08:47 UTC (rev 115401)
+++ trunk/Source/WebKit2/Shared/ShareableSurface.h	2012-04-27 03:16:32 UTC (rev 115402)
@@ -52,6 +52,10 @@
         void encode(CoreIPC::ArgumentEncoder*) const;
         static bool decode(CoreIPC::ArgumentDecoder*, Handle&);
 
+#if USE(GRAPHICS_SURFACE)
+        uint32_t graphicsSurfaceToken() const { return m_graphicsSurfaceToken; }
+#endif
+
     private:
         friend class ShareableSurface;
         mutable ShareableBitmap::Handle m_bitmapHandle;

Modified: trunk/Source/WebKit2/UIProcess/LayerTreeHostProxy.cpp (115401 => 115402)


--- trunk/Source/WebKit2/UIProcess/LayerTreeHostProxy.cpp	2012-04-27 03:08:47 UTC (rev 115401)
+++ trunk/Source/WebKit2/UIProcess/LayerTreeHostProxy.cpp	2012-04-27 03:16:32 UTC (rev 115402)
@@ -63,7 +63,18 @@
 
 void LayerTreeHostProxy::updateTileForLayer(int layerID, int tileID, const IntRect& targetRect, const WebKit::SurfaceUpdateInfo& updateInfo)
 {
-    RefPtr<ShareableSurface> surface = ShareableSurface::create(updateInfo.surfaceHandle);
+    RefPtr<ShareableSurface> surface;
+#if USE(GRAPHICS_SURFACE)
+    uint32_t token = updateInfo.surfaceHandle.graphicsSurfaceToken();
+    HashMap<uint32_t, RefPtr<ShareableSurface> >::iterator it = m_surfaces.find(token);
+    if (it == m_surfaces.end()) {
+        surface = ShareableSurface::create(updateInfo.surfaceHandle);
+        m_surfaces.add(token, surface);
+    } else
+        surface = it->second;
+#else
+    surface = ShareableSurface::create(updateInfo.surfaceHandle);
+#endif
     dispatchUpdate(bind(&WebLayerTreeRenderer::updateTile, m_renderer.get(), layerID, tileID, WebLayerTreeRenderer::TileUpdate(updateInfo.updateRect, targetRect, surface, updateInfo.surfaceOffset)));
 }
 

Modified: trunk/Source/WebKit2/UIProcess/LayerTreeHostProxy.h (115401 => 115402)


--- trunk/Source/WebKit2/UIProcess/LayerTreeHostProxy.h	2012-04-27 03:08:47 UTC (rev 115401)
+++ trunk/Source/WebKit2/UIProcess/LayerTreeHostProxy.h	2012-04-27 03:16:32 UTC (rev 115402)
@@ -74,6 +74,9 @@
 
     DrawingAreaProxy* m_drawingAreaProxy;
     RefPtr<WebLayerTreeRenderer> m_renderer;
+#if USE(GRAPHICS_SURFACE)
+    HashMap<uint32_t, RefPtr<ShareableSurface> > m_surfaces;
+#endif
 };
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to