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

Commit 94d8e90a authored by Jason Sams's avatar Jason Sams
Browse files

Split renderscript java code from test apps. Update makefiles.

parent 3eaa338e
Loading
Loading
Loading
Loading
+21 −49
Original line number Diff line number Diff line
# 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

@@ -31,18 +31,18 @@ LOCAL_SRC_FILES:= \

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)

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 the subdirectories ====================
include $(addprefix $(LOCAL_PATH)/,$(addsuffix /Android.mk,\
            jni \
            java \
    	))

include $(call all-subdir-makefiles)
endif # BUILD_RENDERSCRIPT
+1 −7
Original line number Diff line number Diff line
@@ -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))
+3 −0
Original line number Diff line number Diff line
@@ -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;
+6 −3
Original line number Diff line number Diff line
@@ -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 −0
Original line number Diff line number Diff line
#
# 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)
Loading