summaryrefslogtreecommitdiff
path: root/rsAllocation.cpp
diff options
context:
space:
mode:
authorMiao Wang <miaowang@google.com>2017-02-27 23:35:35 -0800
committerMiao Wang <miaowang@google.com>2017-03-15 19:05:19 +0000
commit82e135c4bbe18855d8ed02632bb074f8da0b96e0 (patch)
treeb49c8e9d9ba3afbc68bb0c9bbd8d39c87db4c589 /rsAllocation.cpp
parentee2aeb32af1bba3da2dc97d203a36e1c91c1edd6 (diff)
downloadrs-82e135c4bbe18855d8ed02632bb074f8da0b96e0.tar.gz
Remove libutils.so dependency from libRSDriver, libRSCpuRef, and most
parts of libRS_internal. NOTE: we're resolving dependencies to provide a model for vendors. For us, all this code is above the HAL, thus the dependencies are acceptable; whereas for vendors, their equivalent of this code is below the HAL, and so the dependencies are not acceptable. This CL resolves the libutils dependency by: - Implement the timings functions in android::renderscript namespace using NDK APIs, instead of using libutils counterparts. - Replace android::Vector and android::String8 by std::vector and std::string. - PROPERTY_VALUE_MAX is replaced as PROP_VALUE_MAX. This CL didn't resolve the libutils dependency of rsFont.cpp and rsDebugger.cpp in libRS_internal: The dependent functionality in rsDebugHelper.h is off by default, and only intended for use during development; and rsFont.cpp is part of graphics API which is not implemented below the HAL and is not used as a model by vendors. Additionally, this CL fixed the bug that mNodes was sorted in a decreasing order. Nodes in ScriptGroup should be executed in ascending order. The bad sort was only for support lib; so there was a previously-unknown bug in support lib implementation of ScriptGroup. Background: libutils contains a collection of things like Vector, String8, CallStack. It served the purpose similar to a STL library, when there was no stable STL implementation available in Android. And most importantly, it is not part of NDK. Support lib used to use our own implementations of android::Vector and android::String8, because it can only depend on NDK, similarly for the timing related functions. As part of the Treble requirements, native RS, including vendor version libRS_internal, libRSDriver, libRSCpuRef could only depend on NDK too. So we need to break the dependency on libutils. And since we now have reasonable support of STLs, we should use that instead. Bug: 34396220 Test: mm, and all CTS tests pass on Bullhead; RsTest and RSTest_CompatLib (both native and compat path) also pass. Change-Id: Ib9a37d16235c1dcd0f5bae3b95c374e394483c91
Diffstat (limited to 'rsAllocation.cpp')
-rw-r--r--rsAllocation.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/rsAllocation.cpp b/rsAllocation.cpp
index 59944bff..a2104352 100644
--- a/rsAllocation.cpp
+++ b/rsAllocation.cpp
@@ -336,13 +336,13 @@ void Allocation::elementRead(Context *rsc, uint32_t x, uint32_t y, uint32_t z,
}
void Allocation::addProgramToDirty(const Program *p) {
- mToDirtyList.push(p);
+ mToDirtyList.push_back(p);
}
void Allocation::removeProgramToDirty(const Program *p) {
for (size_t ct=0; ct < mToDirtyList.size(); ct++) {
if (mToDirtyList[ct] == p) {
- mToDirtyList.removeAt(ct);
+ mToDirtyList.erase(mToDirtyList.begin() + ct);
return;
}
}