summaryrefslogtreecommitdiffstats
path: root/cc/TiledLayerChromium.cpp
diff options
context:
space:
mode:
authorccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-17 04:13:31 +0000
committerccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-17 04:13:31 +0000
commit9d39e17c16886632b0be01475034e7c9a201068d (patch)
tree48f68c79de5bf0438e265976ee02fad47d5ee36a /cc/TiledLayerChromium.cpp
parente0658bcde3e33be5f5c50f6c6aeef693bf5c2a99 (diff)
downloadchromium_src-9d39e17c16886632b0be01475034e7c9a201068d.zip
chromium_src-9d39e17c16886632b0be01475034e7c9a201068d.tar.gz
chromium_src-9d39e17c16886632b0be01475034e7c9a201068d.tar.bz2
Adjust texture priorities in preparation of impl-thread eviction of only some textures
This came from the already-reviewed WebKit bug https://bugs.webkit.org/show_bug.cgi?id=95758 I forgot to cq? that bug, so it didn't land. Review URL: https://chromiumcodereview.appspot.com/10917281 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157075 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/TiledLayerChromium.cpp')
-rw-r--r--cc/TiledLayerChromium.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/cc/TiledLayerChromium.cpp b/cc/TiledLayerChromium.cpp
index 62c9202..914e211 100644
--- a/cc/TiledLayerChromium.cpp
+++ b/cc/TiledLayerChromium.cpp
@@ -548,8 +548,7 @@ bool isSmallAnimatedLayer(TiledLayerChromium* layer)
// FIXME: Remove this and make this based on distance once distance can be calculated
// for offscreen layers. For now, prioritize all small animated layers after 512
// pixels of pre-painting.
-void setPriorityForTexture(const CCPriorityCalculator& priorityCalc,
- const IntRect& visibleRect,
+void setPriorityForTexture(const IntRect& visibleRect,
const IntRect& tileRect,
bool drawsToRoot,
bool isSmallAnimatedLayer,
@@ -557,9 +556,9 @@ void setPriorityForTexture(const CCPriorityCalculator& priorityCalc,
{
int priority = CCPriorityCalculator::lowestPriority();
if (!visibleRect.isEmpty())
- priority = priorityCalc.priorityFromDistance(visibleRect, tileRect, drawsToRoot);
+ priority = CCPriorityCalculator::priorityFromDistance(visibleRect, tileRect, drawsToRoot);
if (isSmallAnimatedLayer)
- priority = CCPriorityCalculator::maxPriority(priority, priorityCalc.priorityFromDistance(512, drawsToRoot));
+ priority = CCPriorityCalculator::maxPriority(priority, CCPriorityCalculator::smallAnimatedLayerMinPriority());
if (priority != CCPriorityCalculator::lowestPriority())
texture->setRequestPriority(priority);
}
@@ -620,7 +619,7 @@ void TiledLayerChromium::setTexturePriorities(const CCPriorityCalculator& priori
IntRect tileRect = m_tiler->tileRect(tile);
tile->dirtyRect = tileRect;
LayerTextureUpdater::Texture* backBuffer = tile->texture();
- setPriorityForTexture(priorityCalc, visibleContentRect(), tile->dirtyRect, drawsToRoot, smallAnimatedLayer, backBuffer->texture());
+ setPriorityForTexture(visibleContentRect(), tile->dirtyRect, drawsToRoot, smallAnimatedLayer, backBuffer->texture());
OwnPtr<CCPrioritizedTexture> frontBuffer = CCPrioritizedTexture::create(backBuffer->texture()->textureManager(),
backBuffer->texture()->size(),
backBuffer->texture()->format());
@@ -638,7 +637,7 @@ void TiledLayerChromium::setTexturePriorities(const CCPriorityCalculator& priori
if (!tile)
continue;
IntRect tileRect = m_tiler->tileRect(tile);
- setPriorityForTexture(priorityCalc, visibleContentRect(), tileRect, drawsToRoot, smallAnimatedLayer, tile->managedTexture());
+ setPriorityForTexture(visibleContentRect(), tileRect, drawsToRoot, smallAnimatedLayer, tile->managedTexture());
}
}