Title: [120705] trunk/Source/WebKit2
Revision
120705
Author
[email protected]
Date
2012-06-19 04:43:37 -0700 (Tue, 19 Jun 2012)

Log Message

[Qt] Create an extra atlas when there is no available buffer space.
https://bugs.webkit.org/show_bug.cgi?id=89012

Reviewed by Noam Rosenthal.

In case of the desktop mode when we scroll the view all the tiles
are updated. It can happen that there no available buffer space for
the currently used atlas(especially when scrolling fast). In that case
we can create a new one. One future improvement could be to make a timer and
delete this extra atlas when it is not used.

* WebProcess/WebPage/qt/LayerTreeHostQt.cpp:
(WebKit::beginContentUpdateInAtlas):
(WebKit::LayerTreeHostQt::beginContentUpdate):
* WebProcess/WebPage/qt/LayerTreeHostQt.h:
(LayerTreeHostQt):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (120704 => 120705)


--- trunk/Source/WebKit2/ChangeLog	2012-06-19 11:34:43 UTC (rev 120704)
+++ trunk/Source/WebKit2/ChangeLog	2012-06-19 11:43:37 UTC (rev 120705)
@@ -1,3 +1,22 @@
+2012-06-19  Alexis Menard  <[email protected]>
+
+        [Qt] Create an extra atlas when there is no available buffer space.
+        https://bugs.webkit.org/show_bug.cgi?id=89012
+
+        Reviewed by Noam Rosenthal.
+
+        In case of the desktop mode when we scroll the view all the tiles
+        are updated. It can happen that there no available buffer space for
+        the currently used atlas(especially when scrolling fast). In that case 
+        we can create a new one. One future improvement could be to make a timer and 
+        delete this extra atlas when it is not used.
+
+        * WebProcess/WebPage/qt/LayerTreeHostQt.cpp:
+        (WebKit::beginContentUpdateInAtlas):
+        (WebKit::LayerTreeHostQt::beginContentUpdate):
+        * WebProcess/WebPage/qt/LayerTreeHostQt.h:
+        (LayerTreeHostQt):
+
 2012-06-19  Csaba Osztrogonác  <[email protected]>
 
         [Qt] Buildfix for newer Qt5, use QPointer instead of the deprecated QWeakPointer.

Modified: trunk/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp (120704 => 120705)


--- trunk/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp	2012-06-19 11:34:43 UTC (rev 120704)
+++ trunk/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp	2012-06-19 11:43:37 UTC (rev 120705)
@@ -552,29 +552,29 @@
     m_updateAtlases.clear();
 }
 
-UpdateAtlas& LayerTreeHostQt::getAtlas(ShareableBitmap::Flags flags)
+static PassOwnPtr<WebCore::GraphicsContext> beginContentUpdateInAtlas(UpdateAtlas& atlas, const WebCore::IntSize& size, ShareableSurface::Handle& handle, WebCore::IntPoint& offset)
 {
-    for (int i = 0; i < m_updateAtlases.size(); ++i) {
-        if (m_updateAtlases[i].flags() == flags)
-            return m_updateAtlases[i];
-    }
-    static const int ScratchBufferDimension = 2000;
-    m_updateAtlases.append(UpdateAtlas(ScratchBufferDimension, flags));
-    return m_updateAtlases.last();
+    if (!atlas.surface()->createHandle(handle))
+        return PassOwnPtr<WebCore::GraphicsContext>();
+    return atlas.beginPaintingOnAvailableBuffer(size, offset);
 }
 
 PassOwnPtr<WebCore::GraphicsContext> LayerTreeHostQt::beginContentUpdate(const WebCore::IntSize& size, ShareableBitmap::Flags flags, ShareableSurface::Handle& handle, WebCore::IntPoint& offset)
 {
-    UpdateAtlas& atlas = getAtlas(flags);
-    if (!atlas.surface()->createHandle(handle))
-        return PassOwnPtr<WebCore::GraphicsContext>();
+    OwnPtr<WebCore::GraphicsContext> graphicsContext;
+    for (int i = 0; i < m_updateAtlases.size(); ++i) {
+        UpdateAtlas& atlas = m_updateAtlases[i];
+        if (atlas.flags() == flags) {
+            // This will return null if there is no available buffer space.
+            graphicsContext = beginContentUpdateInAtlas(atlas, size, handle, offset);
+            if (graphicsContext)
+                return graphicsContext.release();
+        }
+    }
 
-    // This will return null if there is no available buffer.
-    OwnPtr<WebCore::GraphicsContext> graphicsContext = atlas.beginPaintingOnAvailableBuffer(size, offset);
-    if (!graphicsContext)
-        return PassOwnPtr<WebCore::GraphicsContext>();
-
-    return graphicsContext.release();
+    static const int ScratchBufferDimension = 2000;
+    m_updateAtlases.append(UpdateAtlas(ScratchBufferDimension, flags));
+    return beginContentUpdateInAtlas(m_updateAtlases.last(), size, handle, offset);
 }
 
 } // namespace WebKit

Modified: trunk/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.h (120704 => 120705)


--- trunk/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.h	2012-06-19 11:34:43 UTC (rev 120704)
+++ trunk/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.h	2012-06-19 11:43:37 UTC (rev 120705)
@@ -105,8 +105,6 @@
     void performScheduledLayerFlush();
     void sendLayersToUI();
 
-    UpdateAtlas& getAtlas(ShareableBitmap::Flags);
-
     OwnPtr<WebCore::GraphicsLayer> m_rootLayer;
 
     // The layer which contains all non-composited content.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to