Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 76535e88 authored by Miao Wang's avatar Miao Wang Committed by android-build-merger
Browse files

Merge "Update RenderScript JNI code for Treble"

am: 9017b256

Change-Id: I0cc281a372ec83d3731a83b0af5cc3a02b259a67
parents 3b7643ce 9017b256
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -19,22 +19,17 @@ LOCAL_SHARED_LIBRARIES := \

LOCAL_STATIC_LIBRARIES :=

rs_generated_include_dir := $(call intermediates-dir-for,SHARED_LIBRARIES,libRS,,)

LOCAL_C_INCLUDES += \
    $(JNI_H_INCLUDE) \
    frameworks/rs \
    frameworks/base/core/jni \
    frameworks/base/libs/hwui \
    $(rs_generated_include_dir)
    frameworks/base/libs/hwui

LOCAL_CFLAGS += -Wno-unused-parameter
LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code

LOCAL_ADDITIONAL_DEPENDENCIES := $(addprefix $(rs_generated_include_dir)/,rsgApiFuncDecl.h)
LOCAL_MODULE:= librs_jni
LOCAL_ADDITIONAL_DEPENDENCIES += $(rs_generated_source)
LOCAL_MODULE_TAGS := optional
LOCAL_REQUIRED_MODULES := libRS libRSDriver
LOCAL_REQUIRED_MODULES := libRS

include $(BUILD_SHARED_LIBRARY)
+3 −3
Original line number Diff line number Diff line
@@ -35,8 +35,8 @@
#include "android_runtime/android_util_AssetManager.h"
#include "android/graphics/GraphicsJNI.h"

#include <rs.h>
#include <rsEnv.h>
#include <rsApiStubs.h>
#include <gui/Surface.h>
#include <gui/GLConsumer.h>
#include <android_runtime/android_graphics_SurfaceTexture.h>
@@ -1134,7 +1134,7 @@ nElementGetNativeData(JNIEnv *_env, jobject _this, jlong con, jlong id, jintArra
    // we will pack mType; mKind; mNormalized; mVectorSize; NumSubElements
    assert(dataSize == 5);

    uintptr_t elementData[5];
    uint32_t elementData[5];
    rsaElementGetNativeData((RsContext)con, (RsElement)id, elementData, dataSize);

    for(jint i = 0; i < dataSize; i ++) {
@@ -1157,7 +1157,7 @@ nElementGetSubElements(JNIEnv *_env, jobject _this, jlong con, jlong id,

    uintptr_t *ids = (uintptr_t*)malloc(dataSize * sizeof(uintptr_t));
    const char **names = (const char **)malloc(dataSize * sizeof(const char *));
    uint32_t *arraySizes = (uint32_t *)malloc(dataSize * sizeof(uint32_t));
    size_t *arraySizes = (size_t *)malloc(dataSize * sizeof(size_t));

    rsaElementGetSubElements((RsContext)con, (RsElement)id, ids, names, arraySizes,
                             (uint32_t)dataSize);