Title: [104160] trunk/Source/WebKit/efl
Revision
104160
Author
[email protected]
Date
2012-01-05 07:01:35 -0800 (Thu, 05 Jan 2012)

Log Message

[EFL] Invalidation request for ewk_view can be discarded without rendering.
https://bugs.webkit.org/show_bug.cgi?id=71564

Patch by KwangHyuk Kim <[email protected]> on 2012-01-05
Reviewed by Hajime Morita.

As ewk_view discards a queue for invalidation requests
as soon as it proceeds the repaint step, the newly produced invalidation requests
from ewk_view_layout_if_needed_recursive API can be discarded
and unpainted dirty area can occur.
As this issue is just caused by use of flush API in repaint step,
(internal API) ewk_view_repaints_get is replaced with ewk_view_repaints_pop
in order to make sure that old invalidation requests are removed from queue.
And in addition to that, ewk_view_repaint_add is modified
in order to let queue of invalidation requests keep a proper size.
As a result flush API won't be used for the repaint step.

* ewk/ewk_private.h:
* ewk/ewk_view.cpp:
(_ewk_view_repaint_add):
(_ewk_view_smart_calculate):
(ewk_view_repaints_pop):
* ewk/ewk_view_single.cpp:
(_ewk_view_single_smart_repaints_process):
* ewk/ewk_view_tiled.cpp:
(_ewk_view_tiled_smart_repaints_process):

Modified Paths

Diff

Modified: trunk/Source/WebKit/efl/ChangeLog (104159 => 104160)


--- trunk/Source/WebKit/efl/ChangeLog	2012-01-05 15:01:11 UTC (rev 104159)
+++ trunk/Source/WebKit/efl/ChangeLog	2012-01-05 15:01:35 UTC (rev 104160)
@@ -1,3 +1,31 @@
+2012-01-05  KwangHyuk Kim  <[email protected]>
+
+        [EFL] Invalidation request for ewk_view can be discarded without rendering.
+        https://bugs.webkit.org/show_bug.cgi?id=71564
+
+        Reviewed by Hajime Morita.
+
+        As ewk_view discards a queue for invalidation requests
+        as soon as it proceeds the repaint step, the newly produced invalidation requests
+        from ewk_view_layout_if_needed_recursive API can be discarded
+        and unpainted dirty area can occur.
+        As this issue is just caused by use of flush API in repaint step,
+        (internal API) ewk_view_repaints_get is replaced with ewk_view_repaints_pop
+        in order to make sure that old invalidation requests are removed from queue.
+        And in addition to that, ewk_view_repaint_add is modified
+        in order to let queue of invalidation requests keep a proper size.
+        As a result flush API won't be used for the repaint step.
+
+        * ewk/ewk_private.h:
+        * ewk/ewk_view.cpp:
+        (_ewk_view_repaint_add):
+        (_ewk_view_smart_calculate):
+        (ewk_view_repaints_pop):
+        * ewk/ewk_view_single.cpp:
+        (_ewk_view_single_smart_repaints_process):
+        * ewk/ewk_view_tiled.cpp:
+        (_ewk_view_tiled_smart_repaints_process):
+
 2012-01-04  KwangHyuk Kim  <[email protected]>
 
         [EFL] Refactor the way using cairo in ewk_tiled_backing_store.

Modified: trunk/Source/WebKit/efl/ewk/ewk_private.h (104159 => 104160)


--- trunk/Source/WebKit/efl/ewk/ewk_private.h	2012-01-05 15:01:11 UTC (rev 104159)
+++ trunk/Source/WebKit/efl/ewk/ewk_private.h	2012-01-05 15:01:35 UTC (rev 104160)
@@ -170,7 +170,7 @@
 void ewk_context_menu_show(Ewk_Context_Menu* menu);
 #endif
 
-const Eina_Rectangle* ewk_view_repaints_get(const Ewk_View_Private_Data* priv, size_t* count);
+const Eina_Rectangle* ewk_view_repaints_pop(Ewk_View_Private_Data* priv, size_t* count);
 const Ewk_Scroll_Request* ewk_view_scroll_requests_get(const Ewk_View_Private_Data* priv, size_t* count);
 
 void ewk_view_repaint_add(Ewk_View_Private_Data* priv, Evas_Coord x, Evas_Coord y, Evas_Coord width, Evas_Coord height);

Modified: trunk/Source/WebKit/efl/ewk/ewk_view.cpp (104159 => 104160)


--- trunk/Source/WebKit/efl/ewk/ewk_view.cpp	2012-01-05 15:01:11 UTC (rev 104159)
+++ trunk/Source/WebKit/efl/ewk/ewk_view.cpp	2012-01-05 15:01:35 UTC (rev 104160)
@@ -293,20 +293,19 @@
 
 static void _ewk_view_repaint_add(Ewk_View_Private_Data* priv, Evas_Coord x, Evas_Coord y, Evas_Coord width, Evas_Coord height)
 {
-    Eina_Rectangle* rect;
+    size_t newSize = 0;
 
-    // fprintf(stderr, ">>> repaint requested: %d,%d+%dx%d\n", x, y, w, h);
-    if (priv->repaints.allocated == priv->repaints.count) {
-        size_t size;
-        if (!priv->repaints.allocated)
-            size = EWK_VIEW_REPAINTS_SIZE_INITIAL;
-        else
-            size = priv->repaints.allocated + EWK_VIEW_REPAINTS_SIZE_STEP;
-        if (!_ewk_view_repaints_resize(priv, size))
+    if (priv->repaints.allocated == priv->repaints.count)
+        newSize = priv->repaints.allocated + EWK_VIEW_REPAINTS_SIZE_STEP;
+    else if (!priv->repaints.count && priv->repaints.allocated > EWK_VIEW_REPAINTS_SIZE_INITIAL)
+        newSize = EWK_VIEW_REPAINTS_SIZE_INITIAL;
+
+    if (newSize) {
+        if (!_ewk_view_repaints_resize(priv, newSize))
             return;
     }
 
-    rect = priv->repaints.array + priv->repaints.count;
+    Eina_Rectangle* rect = priv->repaints.array + priv->repaints.count;
     priv->repaints.count++;
 
     rect->x = x;
@@ -927,7 +926,6 @@
 
     if (!smartData->api->repaints_process(smartData))
         ERR("failed to process repaints.");
-    _ewk_view_repaints_flush(priv);
 
     if (smartData->changed.frame_rect) {
         WebCore::FrameView* view = priv->mainFrame->view();
@@ -2451,13 +2449,16 @@
  * @note this is not for general use but just for subclasses that want
  *       to define their own backing store.
  */
-const Eina_Rectangle* ewk_view_repaints_get(const Ewk_View_Private_Data* priv, size_t* count)
+const Eina_Rectangle* ewk_view_repaints_pop(Ewk_View_Private_Data* priv, size_t* count)
 {
     if (count)
         *count = 0;
     EINA_SAFETY_ON_NULL_RETURN_VAL(priv, 0);
     if (count)
         *count = priv->repaints.count;
+
+    priv->repaints.count = 0;
+
     return priv->repaints.array;
 }
 

Modified: trunk/Source/WebKit/efl/ewk/ewk_view_single.cpp (104159 => 104160)


--- trunk/Source/WebKit/efl/ewk/ewk_view_single.cpp	2012-01-05 15:01:11 UTC (rev 104159)
+++ trunk/Source/WebKit/efl/ewk/ewk_view_single.cpp	2012-01-05 15:01:35 UTC (rev 104160)
@@ -435,7 +435,7 @@
 
     ewk_view_layout_if_needed_recursive(smartData->_priv);
 
-    pr = ewk_view_repaints_get(smartData->_priv, &count);
+    pr = ewk_view_repaints_pop(smartData->_priv, &count);
     pr_end = pr + count;
     for (; pr < pr_end; pr++)
         eina_tiler_rect_add(tiler, pr);

Modified: trunk/Source/WebKit/efl/ewk/ewk_view_tiled.cpp (104159 => 104160)


--- trunk/Source/WebKit/efl/ewk/ewk_view_tiled.cpp	2012-01-05 15:01:11 UTC (rev 104159)
+++ trunk/Source/WebKit/efl/ewk/ewk_view_tiled.cpp	2012-01-05 15:01:35 UTC (rev 104160)
@@ -135,7 +135,7 @@
 
     ewk_frame_scroll_pos_get(smartData->main_frame, &scrollX, &scrollY);
 
-    paintRect = ewk_view_repaints_get(smartData->_priv, &count);
+    paintRect = ewk_view_repaints_pop(smartData->_priv, &count);
     endOfpaintRect = paintRect + count;
     for (; paintRect < endOfpaintRect; paintRect++) {
         Eina_Rectangle rect;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to