Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2226)

Unified Diff: cc/gl_renderer.cc

Issue 11637022: Send memory management policies to the tile manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix clang build Created 7 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/gl_renderer.h ('k') | cc/layer_tree_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/gl_renderer.cc
diff --git a/cc/gl_renderer.cc b/cc/gl_renderer.cc
index c98b3e0e6f73578ef3acf707932100624e8a8f6e..3491c973dd1c64f06ee1c72631e6ad3965eed50e 100644
--- a/cc/gl_renderer.cc
+++ b/cc/gl_renderer.cc
@@ -1322,9 +1322,9 @@ void GLRenderer::onMemoryAllocationChanged(WebGraphicsMemoryAllocation allocatio
if (allocation.bytesLimitWhenVisible) {
ManagedMemoryPolicy policy(
allocation.bytesLimitWhenVisible,
- priorityCutoffValue(allocation.priorityCutoffWhenVisible),
+ priorityCutoff(allocation.priorityCutoffWhenVisible),
allocation.bytesLimitWhenNotVisible,
- priorityCutoffValue(allocation.priorityCutoffWhenNotVisible));
+ priorityCutoff(allocation.priorityCutoffWhenNotVisible));
if (allocation.enforceButDoNotKeepAsPolicy)
m_client->enforceManagedMemoryPolicy(policy);
@@ -1339,20 +1339,21 @@ void GLRenderer::onMemoryAllocationChanged(WebGraphicsMemoryAllocation allocatio
m_discardBackbufferWhenNotVisible = oldDiscardBackbufferWhenNotVisible;
}
-int GLRenderer::priorityCutoffValue(WebKit::WebGraphicsMemoryAllocation::PriorityCutoff priorityCutoff)
+ManagedMemoryPolicy::PriorityCutoff GLRenderer::priorityCutoff(WebKit::WebGraphicsMemoryAllocation::PriorityCutoff priorityCutoff)
{
+ // This is simple a 1:1 map, the names differ only because the WebKit names should be to match the cc names.
switch (priorityCutoff) {
case WebKit::WebGraphicsMemoryAllocation::PriorityCutoffAllowNothing:
- return PriorityCalculator::allowNothingCutoff();
+ return ManagedMemoryPolicy::CUTOFF_ALLOW_NOTHING;
case WebKit::WebGraphicsMemoryAllocation::PriorityCutoffAllowVisibleOnly:
- return PriorityCalculator::allowVisibleOnlyCutoff();
+ return ManagedMemoryPolicy::CUTOFF_ALLOW_REQUIRED_ONLY;
case WebKit::WebGraphicsMemoryAllocation::PriorityCutoffAllowVisibleAndNearby:
- return PriorityCalculator::allowVisibleAndNearbyCutoff();
+ return ManagedMemoryPolicy::CUTOFF_ALLOW_NICE_TO_HAVE;
case WebKit::WebGraphicsMemoryAllocation::PriorityCutoffAllowEverything:
- return PriorityCalculator::allowEverythingCutoff();
+ return ManagedMemoryPolicy::CUTOFF_ALLOW_EVERYTHING;
}
NOTREACHED();
- return 0;
+ return ManagedMemoryPolicy::CUTOFF_ALLOW_NOTHING;
}
void GLRenderer::enforceMemoryPolicy()
« no previous file with comments | « cc/gl_renderer.h ('k') | cc/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698