Title: [99252] trunk/Source/WebKit/efl
Revision
99252
Author
[email protected]
Date
2011-11-03 17:27:07 -0700 (Thu, 03 Nov 2011)

Log Message

[EFL] Added ewk_tile_memory_size_get function
https://bugs.webkit.org/show_bug.cgi?id=71213

Patch by Tomasz Morawski <[email protected]> on 2011-11-03
Reviewed by Anders Carlsson.

Added the ewk_tile_memory_size_get function returns size of used memory by given tile. Simplify and cleanup
the code.

* ewk/ewk_tiled_model.cpp:
(ewk_tile_memory_size_get):
(ewk_tile_unused_cache_flush):
(ewk_tile_unused_cache_tile_get):
(ewk_tile_unused_cache_tile_put):
* ewk/ewk_tiled_model.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/efl/ChangeLog (99251 => 99252)


--- trunk/Source/WebKit/efl/ChangeLog	2011-11-04 00:17:48 UTC (rev 99251)
+++ trunk/Source/WebKit/efl/ChangeLog	2011-11-04 00:27:07 UTC (rev 99252)
@@ -1,3 +1,20 @@
+2011-11-03  Tomasz Morawski  <[email protected]>
+
+        [EFL] Added ewk_tile_memory_size_get function
+        https://bugs.webkit.org/show_bug.cgi?id=71213
+
+        Reviewed by Anders Carlsson.
+
+        Added the ewk_tile_memory_size_get function returns size of used memory by given tile. Simplify and cleanup
+        the code.
+
+        * ewk/ewk_tiled_model.cpp:
+        (ewk_tile_memory_size_get):
+        (ewk_tile_unused_cache_flush):
+        (ewk_tile_unused_cache_tile_get):
+        (ewk_tile_unused_cache_tile_put):
+        * ewk/ewk_tiled_model.h:
+
 2011-11-03  Darin Adler  <[email protected]>
 
         Change remaining callers of releaseRef to call leakRef

Modified: trunk/Source/WebKit/efl/ewk/ewk_tiled_model.cpp (99251 => 99252)


--- trunk/Source/WebKit/efl/ewk/ewk_tiled_model.cpp	2011-11-04 00:17:48 UTC (rev 99251)
+++ trunk/Source/WebKit/efl/ewk/ewk_tiled_model.cpp	2011-11-04 00:27:07 UTC (rev 99252)
@@ -337,6 +337,19 @@
 }
 
 /**
+ * @internal
+ * Returns memory size used by given tile
+ *
+ * @param t tile to size check
+ * @return Returns used memory or zero if object is NULL.
+ */
+size_t ewk_tile_memory_size_get(const Ewk_Tile* tile)
+{
+    EINA_SAFETY_ON_NULL_RETURN_VAL(tile, 0);
+    return sizeof(Ewk_Tile) + tile->bytes;
+}
+
+/**
  * Make the tile visible, incrementing its counter.
  */
 void ewk_tile_show(Ewk_Tile* tile)
@@ -684,7 +697,7 @@
             && tile->zoom == tileUnusedCache->locked.zoom) {
             continue;
         }
-        done += sizeof(Ewk_Tile) + itr->tile->bytes;
+        done += ewk_tile_memory_size_get(itr->tile);
         itr->tile_free.callback(itr->tile_free.data, itr->tile);
         tileUnusedCache->entries.list = eina_list_remove_list(tileUnusedCache->entries.list, list);
         free(itr);
@@ -769,7 +782,7 @@
     }
 
     tileUnusedCache->entries.count--;
-    tileUnusedCache->memory.used -= sizeof(Ewk_Tile) + tile->bytes;
+    tileUnusedCache->memory.used -= ewk_tile_memory_size_get(tile);
     tileUnusedCache->entries.list = eina_list_remove_list(tileUnusedCache->entries.list, foundEntry);
     free(item);
 
@@ -823,7 +836,7 @@
     unusedCacheEntry->tile_free.data = ""
 
     tileUnusedCache->entries.count++;
-    tileUnusedCache->memory.used += sizeof(Ewk_Tile) + tile->bytes;
+    tileUnusedCache->memory.used += ewk_tile_memory_size_get(tile);
 
     return EINA_TRUE;
 }

Modified: trunk/Source/WebKit/efl/ewk/ewk_tiled_model.h (99251 => 99252)


--- trunk/Source/WebKit/efl/ewk/ewk_tiled_model.h	2011-11-04 00:17:48 UTC (rev 99251)
+++ trunk/Source/WebKit/efl/ewk/ewk_tiled_model.h	2011-11-04 00:27:07 UTC (rev 99252)
@@ -31,6 +31,7 @@
 void ewk_tile_unused_cache_clear(Ewk_Tile_Unused_Cache* tuc);
 void ewk_tile_show(Ewk_Tile* t);
 void ewk_tile_hide(Ewk_Tile* t);
+size_t ewk_tile_memory_size_get(const Ewk_Tile* t);
 Eina_Bool ewk_tile_visible_get(Ewk_Tile* t);
 void ewk_tile_update_full(Ewk_Tile* t);
 void ewk_tile_update_area(Ewk_Tile* t, const Eina_Rectangle* r);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to