Commit 99b26bb2 authored by zhajiang@rim.com's avatar zhajiang@rim.com
Browse files

<https://webkit.org/b/120123> [BlackBerry] Incorrect origin of indexOfTile in...

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

Patch by Jacky Jiang <zhajiang@blackberry.com> 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):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154418 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 115580e1
2013-08-21 Jacky Jiang <zhajiang@blackberry.com>
<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 <simon.fraser@apple.com> 2013-08-21 Simon Fraser <simon.fraser@apple.com>
   
<https://webkit.org/b/116901> ASSERTION FAILED: !m_visibleDescendantStatusDirty on twitter <https://webkit.org/b/116901> ASSERTION FAILED: !m_visibleDescendantStatusDirty on twitter
...@@ -254,7 +254,7 @@ void LayerTiler::updateTextureContentsIfNeeded(double scale) ...@@ -254,7 +254,7 @@ void LayerTiler::updateTextureContentsIfNeeded(double scale)
first = last = TileIndex(0, 0); first = last = TileIndex(0, 0);
} else { } else {
first = indexOfTile(flooredIntPoint(visibleRect.minXMinYCorner())); 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 i = first.i(); i <= last.i(); ++i) {
for (unsigned j = first.j(); j <= last.j(); ++j) { for (unsigned j = first.j(); j <= last.j(); ++j) {
...@@ -412,7 +412,7 @@ void LayerTiler::processTextureJob(const TextureJob& job, TileJobsMap& tileJobsM ...@@ -412,7 +412,7 @@ void LayerTiler::processTextureJob(const TextureJob& job, TileJobsMap& tileJobsM
return; return;
} else if (job.m_type == TextureJob::DirtyContents) { } else if (job.m_type == TextureJob::DirtyContents) {
TileIndex first = indexOfTile(job.m_dirtyRect.minXMinYCorner()); 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) { for (TileMap::iterator it = m_tiles.begin(); it != m_tiles.end(); ++it) {
TileIndex index = (*it).key; TileIndex index = (*it).key;
if (index.i() >= first.i() && index.j() >= first.j() && index.i() <= last.i() && index.j() <= last.j()) if (index.i() >= first.i() && index.j() >= first.j() && index.i() <= last.i() && index.j() <= last.j())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment