summaryrefslogtreecommitdiff
path: root/rsApiAllocation.cpp
diff options
context:
space:
mode:
authorYang Ni <yangni@google.com>2016-03-18 15:33:52 -0700
committerYang Ni <yangni@google.com>2016-03-21 08:52:42 -0700
commit85d0cb112010781ad07b5979f0824b7f0ae3987e (patch)
tree83ba8bd68e723fd14a5513e4aa02175f96ae9186 /rsApiAllocation.cpp
parent101caf152df0e7a63a10ec7537a89c9596be5cbb (diff)
downloadrs-85d0cb112010781ad07b5979f0824b7f0ae3987e.tar.gz
Separate libRS.so into public and internal libs
Bug: 26546579 libRS_internal.so is not going to be whitelisted by the NDK linker, therefore loadable only by the internal implementation, but not any application code. libRS is going to contain only publicly exported functions, i.e. the functions declared in frameworks/rs/rs.h, including those in rsApiFuncDecl.h (generated from rs.spec). Change-Id: Iac58695316edc9aff87ade2bac3b4a44d1a68b23
Diffstat (limited to 'rsApiAllocation.cpp')
-rw-r--r--rsApiAllocation.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/rsApiAllocation.cpp b/rsApiAllocation.cpp
new file mode 100644
index 00000000..84d56921
--- /dev/null
+++ b/rsApiAllocation.cpp
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "rsContext.h"
+#include "rsAllocation.h"
+
+using namespace android;
+using namespace android::renderscript;
+
+extern "C" const void * rsaAllocationGetType(RsContext con, RsAllocation va) {
+ Allocation *a = static_cast<Allocation *>(va);
+ a->getType()->incUserRef();
+
+ return a->getType();
+}