summaryrefslogtreecommitdiff
path: root/libs/androidfw/tests/BenchmarkHelpers.cpp
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2017-12-28 13:01:35 -0800
committerAdam Lesinski <adamlesinski@google.com>2018-02-05 18:38:57 -0800
commit59f63bd801f10336c9f0499b7a0bc0bccb0fad2e (patch)
treefdac1d8181d36b5da4daaadd69225cfe29b54e3d /libs/androidfw/tests/BenchmarkHelpers.cpp
parent633085456e5047e16e53da6c95e193e2a0189633 (diff)
libandroidfw: Add ApplyStyle and SetConfiguration benchmark
Test: mma frameworks/base/libs/androidfw Test: adb sync system data Test: adb shell /data/benchmarktest64/libandroidfw_benchmarks/libandroidfw_benchmarks Change-Id: Ia0e868008a3b32dc8d1c69ed1f2c39f152bb7815
Diffstat (limited to 'libs/androidfw/tests/BenchmarkHelpers.cpp')
-rw-r--r--libs/androidfw/tests/BenchmarkHelpers.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/libs/androidfw/tests/BenchmarkHelpers.cpp b/libs/androidfw/tests/BenchmarkHelpers.cpp
index a8abcb5df86c..faddfe599af4 100644
--- a/libs/androidfw/tests/BenchmarkHelpers.cpp
+++ b/libs/androidfw/tests/BenchmarkHelpers.cpp
@@ -42,10 +42,12 @@ void GetResourceBenchmarkOld(const std::vector<std::string>& paths, const ResTab
Res_value value;
ResTable_config selected_config;
uint32_t flags;
+ uint32_t last_ref = 0u;
while (state.KeepRunning()) {
- table.getResource(resid, &value, false /*may_be_bag*/, 0u /*density*/, &flags,
- &selected_config);
+ ssize_t block = table.getResource(resid, &value, false /*may_be_bag*/, 0u /*density*/, &flags,
+ &selected_config);
+ table.resolveReference(&value, block, &last_ref, &flags, &selected_config);
}
}
@@ -72,10 +74,12 @@ void GetResourceBenchmark(const std::vector<std::string>& paths, const ResTable_
Res_value value;
ResTable_config selected_config;
uint32_t flags;
+ uint32_t last_id = 0u;
while (state.KeepRunning()) {
- assetmanager.GetResource(resid, false /* may_be_bag */, 0u /* density_override */, &value,
- &selected_config, &flags);
+ ApkAssetsCookie cookie = assetmanager.GetResource(
+ resid, false /* may_be_bag */, 0u /* density_override */, &value, &selected_config, &flags);
+ assetmanager.ResolveReference(cookie, &value, &selected_config, &flags, &last_id);
}
}