Title: [154418] trunk/Source/WebCore
Revision
154418
Author
[email protected]
Date
2013-08-21 14:36:50 -0700 (Wed, 21 Aug 2013)

Log Message

<https://webkit.org/b/120123> [BlackBerry] Incorrect origin of indexOfTile in LayerTiler can cause unnecessary texture jobs and waste memory

Patch by Jacky Jiang <[email protected]> on 2013-08-21
Reviewed by Yong Li.
Internally reviewed by Arvid Nilsson.

JIRA 481356
The origin of indexOfTile(origin) is incorrect in these two places. For
example, if the maxXMaxYCorner of the rect is (768, 768), there can be
three other redundant indexOfTile (0, 1), (1, 0), (1, 1) which can cause
unnecessary texture jobs and waste memory.
The origin should be the top left of the bottom right pixel of a rect.

* platform/graphics/blackberry/LayerTiler.cpp:
(WebCore::LayerTiler::updateTextureContentsIfNeeded):
(WebCore::LayerTiler::processTextureJob):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (154417 => 154418)


--- trunk/Source/WebCore/ChangeLog	2013-08-21 21:32:41 UTC (rev 154417)
+++ trunk/Source/WebCore/ChangeLog	2013-08-21 21:36:50 UTC (rev 154418)
@@ -1,3 +1,21 @@
+2013-08-21  Jacky Jiang  <[email protected]>
+
+        <https://webkit.org/b/120123> [BlackBerry] Incorrect origin of indexOfTile in LayerTiler can cause unnecessary texture jobs and waste memory
+
+        Reviewed by Yong Li.
+        Internally reviewed by Arvid Nilsson.
+
+        JIRA 481356
+        The origin of indexOfTile(origin) is incorrect in these two places. For
+        example, if the maxXMaxYCorner of the rect is (768, 768), there can be
+        three other redundant indexOfTile (0, 1), (1, 0), (1, 1) which can cause
+        unnecessary texture jobs and waste memory.
+        The origin should be the top left of the bottom right pixel of a rect.
+
+        * platform/graphics/blackberry/LayerTiler.cpp:
+        (WebCore::LayerTiler::updateTextureContentsIfNeeded):
+        (WebCore::LayerTiler::processTextureJob):
+
 2013-08-21  Simon Fraser  <[email protected]>
 
         <https://webkit.org/b/116901> ASSERTION FAILED: !m_visibleDescendantStatusDirty on twitter

Modified: trunk/Source/WebCore/platform/graphics/blackberry/LayerTiler.cpp (154417 => 154418)


--- trunk/Source/WebCore/platform/graphics/blackberry/LayerTiler.cpp	2013-08-21 21:32:41 UTC (rev 154417)
+++ trunk/Source/WebCore/platform/graphics/blackberry/LayerTiler.cpp	2013-08-21 21:36:50 UTC (rev 154418)
@@ -254,7 +254,7 @@
         first = last = TileIndex(0, 0);
     } else {
         first = indexOfTile(flooredIntPoint(visibleRect.minXMinYCorner()));
-        last = indexOfTile(ceiledIntPoint(visibleRect.maxXMaxYCorner()));
+        last = indexOfTile(ceiledIntPoint(visibleRect.maxXMaxYCorner()) + IntPoint(-1, -1)); // The origin should be the top left of the bottom right pixel.
     }
     for (unsigned i = first.i(); i <= last.i(); ++i) {
         for (unsigned j = first.j(); j <= last.j(); ++j) {
@@ -412,7 +412,7 @@
         return;
     } else if (job.m_type == TextureJob::DirtyContents) {
         TileIndex first = indexOfTile(job.m_dirtyRect.minXMinYCorner());
-        TileIndex last = indexOfTile(job.m_dirtyRect.maxXMaxYCorner());
+        TileIndex last = indexOfTile(job.m_dirtyRect.maxXMaxYCorner() + IntPoint(-1, -1)); // The origin should be the top left of the bottom right pixel.
         for (TileMap::iterator it = m_tiles.begin(); it != m_tiles.end(); ++it) {
             TileIndex index = (*it).key;
             if (index.i() >= first.i() && index.j() >= first.j() && index.i() <= last.i() && index.j() <= last.j())
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to