Merge change 3808
* changes: Split renderscript java code from test apps. Update makefiles.
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
# Only build if BUILD_RENDERSCRIPT is defined to true in the environment.
|
||||
ifeq ($(BUILD_RENDERSCRIPT),true)
|
||||
|
||||
TOP_LOCAL_PATH:=$(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_PATH:= $(TOP_LOCAL_PATH)
|
||||
LOCAL_PATH:=$(call my-dir)
|
||||
|
||||
# Build rsg-generator
|
||||
|
||||
# Build rsg-generator ====================
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := rsg-generator
|
||||
|
||||
@@ -14,7 +14,7 @@ LOCAL_MODULE := rsg-generator
|
||||
|
||||
LOCAL_IS_HOST_MODULE := true
|
||||
LOCAL_MODULE_CLASS := EXECUTABLES
|
||||
intermediates:= $(local-intermediates-dir)
|
||||
intermediates := $(local-intermediates-dir)
|
||||
|
||||
GEN := $(addprefix $(intermediates)/, \
|
||||
lex.yy.c \
|
||||
@@ -28,21 +28,21 @@ $(LOCAL_PATH)/rsg_generator.c : $(intermediates)/lex.yy.c
|
||||
|
||||
LOCAL_SRC_FILES:= \
|
||||
rsg_generator.c
|
||||
|
||||
|
||||
include $(BUILD_HOST_EXECUTABLE)
|
||||
|
||||
# TODO: This should go into build/core/config.mk
|
||||
RSG_GENERATOR:=$(LOCAL_BUILT_MODULE)
|
||||
|
||||
# Build render script lib
|
||||
|
||||
|
||||
# Build render script lib ====================
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := libRS
|
||||
|
||||
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
|
||||
intermediates:= $(local-intermediates-dir)
|
||||
|
||||
RS_GENERATED_INCLUDE_DIR:=$(intermediates)
|
||||
|
||||
# Generate custom headers
|
||||
|
||||
GEN := $(addprefix $(intermediates)/, \
|
||||
@@ -50,12 +50,13 @@ GEN := $(addprefix $(intermediates)/, \
|
||||
rsgApiFuncDecl.h \
|
||||
)
|
||||
|
||||
$(GEN) : PRIVATE_CUSTOM_TOOL = $(RSG_GENERATOR) $< $@ <$(TOP_LOCAL_PATH)/rs.spec
|
||||
$(GEN) : PRIVATE_CUSTOM_TOOL = $(RSG_GENERATOR) $< $@ <$(LOCAL_PATH)/rs.spec
|
||||
$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec
|
||||
$(GEN): $(intermediates)/%.h : $(LOCAL_PATH)/%.h.rsg
|
||||
$(transform-generated-source)
|
||||
|
||||
RS_GENERATED_SOURCES += $(GEN)
|
||||
# used in jni/Android.mk
|
||||
rs_generated_source += $(GEN)
|
||||
LOCAL_GENERATED_SOURCES += $(GEN)
|
||||
|
||||
# Generate custom source files
|
||||
@@ -65,12 +66,13 @@ GEN := $(addprefix $(intermediates)/, \
|
||||
rsgApiReplay.cpp \
|
||||
)
|
||||
|
||||
$(GEN) : PRIVATE_CUSTOM_TOOL = $(RSG_GENERATOR) $< $@ <$(TOP_LOCAL_PATH)/rs.spec
|
||||
$(GEN) : PRIVATE_CUSTOM_TOOL = $(RSG_GENERATOR) $< $@ <$(LOCAL_PATH)/rs.spec
|
||||
$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec
|
||||
$(GEN): $(intermediates)/%.cpp : $(LOCAL_PATH)/%.cpp.rsg
|
||||
$(transform-generated-source)
|
||||
|
||||
RS_GENERATED_SOURCES += $(GEN)
|
||||
# used in jni/Android.mk
|
||||
rs_generated_source += $(GEN)
|
||||
LOCAL_GENERATED_SOURCES += $(GEN)
|
||||
|
||||
LOCAL_SRC_FILES:= \
|
||||
@@ -99,45 +101,15 @@ LOCAL_LDLIBS := -lpthread -ldl
|
||||
LOCAL_MODULE:= libRS
|
||||
LOCAL_PRELINK_MODULE := false
|
||||
|
||||
#LOCAL_MODULE_TAGS := tests
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
# Build JNI library
|
||||
|
||||
LOCAL_PATH:= $(TOP_LOCAL_PATH)/jni
|
||||
include $(CLEAR_VARS)
|
||||
# Include the subdirectories ====================
|
||||
include $(addprefix $(LOCAL_PATH)/,$(addsuffix /Android.mk,\
|
||||
jni \
|
||||
java \
|
||||
))
|
||||
|
||||
LOCAL_SRC_FILES:= \
|
||||
RenderScript_jni.cpp
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libandroid_runtime \
|
||||
libacc \
|
||||
libnativehelper \
|
||||
libRS \
|
||||
libcutils \
|
||||
libsgl \
|
||||
libutils \
|
||||
libui
|
||||
|
||||
LOCAL_STATIC_LIBRARIES :=
|
||||
|
||||
LOCAL_C_INCLUDES += \
|
||||
$(JNI_H_INCLUDE) \
|
||||
$(RS_GENERATED_INCLUDE_DIR) \
|
||||
$(call include-path-for, corecg graphics)
|
||||
|
||||
LOCAL_CFLAGS +=
|
||||
|
||||
LOCAL_LDLIBS := -lpthread
|
||||
|
||||
LOCAL_MODULE:= libRS_jni
|
||||
LOCAL_PRELINK_MODULE := false
|
||||
|
||||
LOCAL_ADDITIONAL_DEPENDENCIES += $(RS_GENERATED_SOURCES)
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
include $(call all-subdir-makefiles)
|
||||
endif # BUILD_RENDERSCRIPT
|
||||
|
||||
@@ -18,14 +18,8 @@ LOCAL_PATH := $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := $(call all-java-files-under, src)
|
||||
LOCAL_STATIC_JAVA_LIBRARIES := android.renderscript
|
||||
|
||||
LOCAL_PACKAGE_NAME := Fountain
|
||||
|
||||
include $(BUILD_PACKAGE)
|
||||
##################################################
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
include $(BUILD_MULTI_PREBUILT)
|
||||
|
||||
# Use the folloing include to make our test apk.
|
||||
include $(call all-makefiles-under,$(LOCAL_PATH))
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
|
||||
package com.android.fountain;
|
||||
|
||||
import android.renderscript.RSSurfaceView;
|
||||
import android.renderscript.RenderScript;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
||||
|
||||
@@ -20,6 +20,9 @@ import java.io.Writer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.Semaphore;
|
||||
|
||||
import android.renderscript.RSSurfaceView;
|
||||
import android.renderscript.RenderScript;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Bitmap;
|
||||
@@ -109,9 +112,9 @@ public class FountainView extends RSSurfaceView {
|
||||
mParams[2] = 0;
|
||||
mParams[3] = 0;
|
||||
mParams[4] = 0;
|
||||
mParams[5] = mPartAlloc.mID;
|
||||
mParams[6] = mPF.mID;
|
||||
mParams[7] = mPF2.mID;
|
||||
mParams[5] = mPartAlloc.getID();
|
||||
mParams[6] = mPF.getID();
|
||||
mParams[7] = mPF2.getID();
|
||||
mIntAlloc.data(mParams);
|
||||
|
||||
int t2[] = new int[partCount * 4*3];
|
||||
|
||||
28
libs/rs/java/RenderScript/Android.mk
Normal file
28
libs/rs/java/RenderScript/Android.mk
Normal file
@@ -0,0 +1,28 @@
|
||||
#
|
||||
# Copyright (C) 2008 Esmertec AG.
|
||||
# Copyright (C) 2008 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.
|
||||
#
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
# the library
|
||||
# ============================================================
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(call all-subdir-java-files)
|
||||
|
||||
LOCAL_MODULE:= android.renderscript
|
||||
|
||||
include $(BUILD_STATIC_JAVA_LIBRARY)
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.fountain;
|
||||
package android.renderscript;
|
||||
|
||||
import java.io.Writer;
|
||||
import java.util.ArrayList;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.fountain;
|
||||
package android.renderscript;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.IOException;
|
||||
@@ -169,6 +169,10 @@ public class RenderScript {
|
||||
mID = 0;
|
||||
}
|
||||
|
||||
public int getID() {
|
||||
return mID;
|
||||
}
|
||||
|
||||
int mID;
|
||||
String mName;
|
||||
|
||||
36
libs/rs/jni/Android.mk
Normal file
36
libs/rs/jni/Android.mk
Normal file
@@ -0,0 +1,36 @@
|
||||
LOCAL_PATH:=$(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
RenderScript_jni.cpp
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libandroid_runtime \
|
||||
libacc \
|
||||
libnativehelper \
|
||||
libRS \
|
||||
libcutils \
|
||||
libsgl \
|
||||
libutils \
|
||||
libui
|
||||
|
||||
LOCAL_STATIC_LIBRARIES :=
|
||||
|
||||
rs_generated_include_dir := $(call intermediates-dir-for,SHARED_LIBRARIES,libRS,,)
|
||||
|
||||
LOCAL_C_INCLUDES += \
|
||||
$(JNI_H_INCLUDE) \
|
||||
$(rs_generated_include_dir) \
|
||||
$(call include-path-for, corecg graphics)
|
||||
|
||||
LOCAL_CFLAGS +=
|
||||
|
||||
LOCAL_LDLIBS := -lpthread
|
||||
|
||||
LOCAL_MODULE:= libRS_jni
|
||||
LOCAL_PRELINK_MODULE := false
|
||||
|
||||
LOCAL_ADDITIONAL_DEPENDENCIES += $(rs_generated_source)
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
@@ -820,7 +820,7 @@ nSamplerCreate(JNIEnv *_env, jobject _this)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
static const char *classPathName = "com/android/fountain/RenderScript";
|
||||
static const char *classPathName = "android/renderscript/RenderScript";
|
||||
|
||||
static JNINativeMethod methods[] = {
|
||||
{"_nInit", "()V", (void*)_nInit },
|
||||
|
||||
Reference in New Issue
Block a user