summaryrefslogtreecommitdiffstats
path: root/cc/resources
diff options
context:
space:
mode:
authorvmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-01 21:24:02 +0000
committervmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-01 21:24:02 +0000
commit30d9baa8de0a11a5016d984c662f29d2dbd3363d (patch)
tree617a4e7245d56c78dbf87089979d2460d0756008 /cc/resources
parenteb0cf38179a5e427aaaf9d613fca28a105a38233 (diff)
downloadchromium_src-30d9baa8de0a11a5016d984c662f29d2dbd3363d.zip
chromium_src-30d9baa8de0a11a5016d984c662f29d2dbd3363d.tar.gz
chromium_src-30d9baa8de0a11a5016d984c662f29d2dbd3363d.tar.bz2
cc: Ensure flags are correct in MTS tracing.
This patch ensures the "has_resource" flag is correct, and also adds "is_using_gpu_memory" flag which is slightly different. R=nduca@chromium.org Review URL: https://codereview.chromium.org/25082003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226302 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resources')
-rw-r--r--cc/resources/managed_tile_state.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/cc/resources/managed_tile_state.cc b/cc/resources/managed_tile_state.cc
index 8856d4f..7a00e6c 100644
--- a/cc/resources/managed_tile_state.cc
+++ b/cc/resources/managed_tile_state.cc
@@ -89,9 +89,18 @@ ManagedTileState::~ManagedTileState() {
}
scoped_ptr<base::Value> ManagedTileState::AsValue() const {
+ bool has_resource = false;
+ bool has_active_task = false;
+ for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) {
+ has_resource |= (tile_versions[mode].resource_.get() != 0);
+ has_active_task |= !tile_versions[mode].raster_task_.is_null();
+ }
+
+ bool is_using_gpu_memory = has_resource || has_active_task;
+
scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
- state->SetBoolean("has_resource",
- tile_versions[raster_mode].resource_.get() != 0);
+ state->SetBoolean("has_resource", has_resource);
+ state->SetBoolean("is_using_gpu_memory", is_using_gpu_memory);
state->Set("tree_bin.0",
ManagedTileBinAsValue(tree_bin[ACTIVE_TREE]).release());
state->Set("tree_bin.1",