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

Unified Diff: cc/output/managed_memory_policy.cc

Issue 1057283003: Remove parts of //cc we aren't using (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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/output/managed_memory_policy.h ('k') | cc/output/output_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/managed_memory_policy.cc
diff --git a/cc/output/managed_memory_policy.cc b/cc/output/managed_memory_policy.cc
deleted file mode 100644
index 049d2b03f9fcd14768e830c1c931d9a90ffc74da..0000000000000000000000000000000000000000
--- a/cc/output/managed_memory_policy.cc
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "cc/output/managed_memory_policy.h"
-
-#include "base/logging.h"
-#include "cc/resources/priority_calculator.h"
-
-namespace cc {
-
-const size_t ManagedMemoryPolicy::kDefaultNumResourcesLimit = 10 * 1000 * 1000;
-
-using gpu::MemoryAllocation;
-
-ManagedMemoryPolicy::ManagedMemoryPolicy(size_t bytes_limit_when_visible)
- : bytes_limit_when_visible(bytes_limit_when_visible),
- priority_cutoff_when_visible(MemoryAllocation::CUTOFF_ALLOW_EVERYTHING),
- num_resources_limit(kDefaultNumResourcesLimit) {}
-
-ManagedMemoryPolicy::ManagedMemoryPolicy(
- const gpu::MemoryAllocation& allocation)
- : bytes_limit_when_visible(allocation.bytes_limit_when_visible),
- priority_cutoff_when_visible(allocation.priority_cutoff_when_visible),
- num_resources_limit(kDefaultNumResourcesLimit) {}
-
-ManagedMemoryPolicy::ManagedMemoryPolicy(
- size_t bytes_limit_when_visible,
- MemoryAllocation::PriorityCutoff priority_cutoff_when_visible,
- size_t num_resources_limit)
- : bytes_limit_when_visible(bytes_limit_when_visible),
- priority_cutoff_when_visible(priority_cutoff_when_visible),
- num_resources_limit(num_resources_limit) {}
-
-bool ManagedMemoryPolicy::operator==(const ManagedMemoryPolicy& other) const {
- return bytes_limit_when_visible == other.bytes_limit_when_visible &&
- priority_cutoff_when_visible == other.priority_cutoff_when_visible &&
- num_resources_limit == other.num_resources_limit;
-}
-
-bool ManagedMemoryPolicy::operator!=(const ManagedMemoryPolicy& other) const {
- return !(*this == other);
-}
-
-// static
-int ManagedMemoryPolicy::PriorityCutoffToValue(
- MemoryAllocation::PriorityCutoff priority_cutoff) {
- switch (priority_cutoff) {
- case MemoryAllocation::CUTOFF_ALLOW_NOTHING:
- return PriorityCalculator::AllowNothingCutoff();
- case MemoryAllocation::CUTOFF_ALLOW_REQUIRED_ONLY:
- return PriorityCalculator::AllowVisibleOnlyCutoff();
- case MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE:
- return PriorityCalculator::AllowVisibleAndNearbyCutoff();
- case MemoryAllocation::CUTOFF_ALLOW_EVERYTHING:
- return PriorityCalculator::AllowEverythingCutoff();
- }
- NOTREACHED();
- return PriorityCalculator::AllowNothingCutoff();
-}
-
-// static
-TileMemoryLimitPolicy
-ManagedMemoryPolicy::PriorityCutoffToTileMemoryLimitPolicy(
- gpu::MemoryAllocation::PriorityCutoff priority_cutoff) {
- switch (priority_cutoff) {
- case MemoryAllocation::CUTOFF_ALLOW_NOTHING:
- return ALLOW_NOTHING;
- case MemoryAllocation::CUTOFF_ALLOW_REQUIRED_ONLY:
- return ALLOW_ABSOLUTE_MINIMUM;
- case MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE:
- return ALLOW_PREPAINT_ONLY;
- case MemoryAllocation::CUTOFF_ALLOW_EVERYTHING:
- return ALLOW_ANYTHING;
- }
- NOTREACHED();
- return ALLOW_NOTHING;
-}
-
-} // namespace cc
« no previous file with comments | « cc/output/managed_memory_policy.h ('k') | cc/output/output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698