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

Commit 08dd2c9b authored by Michael Bestas's avatar Michael Bestas
Browse files

Merge tag 'android-8.1.0_r15' of...

Merge tag 'android-8.1.0_r15' of https://android.googlesource.com/platform/packages/apps/Gallery2 into HEAD

Android 8.1.0 Release 15 (OPM1.171019.021)

* Excludes "Adaptive icon for Gallery2 AOSP" since we have our own icon

Conflicts:
	Android.mk
	AndroidManifest.xml
	jni/Android.mk
	jni/filters/geometry.c
	proguard.flags
	res/values/colors.xml
	src/com/android/gallery3d/filtershow/pipeline/Buffer.java

Change-Id: I003571ce6e7719e4d110fd9b546126e52eef1204
parents 1554c642 f50ea21b
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -7,22 +7,27 @@ LOCAL_MODULE_TAGS := optional
LOCAL_JAVA_LIBRARIES := telephony-common
LOCAL_JAVA_LIBRARIES := telephony-common


LOCAL_STATIC_JAVA_LIBRARIES += android-support-design
LOCAL_STATIC_JAVA_LIBRARIES += android-support-design
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v4
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-appcompat
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-appcompat
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v13
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v13
LOCAL_STATIC_JAVA_LIBRARIES += org.codeaurora.gallery.common
LOCAL_STATIC_JAVA_LIBRARIES += org.codeaurora.gallery.common
LOCAL_STATIC_JAVA_LIBRARIES += mp4parser
LOCAL_STATIC_JAVA_LIBRARIES += mp4parser
LOCAL_STATIC_JAVA_LIBRARIES += xmp_toolkit
LOCAL_STATIC_JAVA_LIBRARIES += xmp_toolkit


LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
LOCAL_SRC_FILES := \
    $(call all-java-files-under, src) \
    $(call all-renderscript-files-under, src)
LOCAL_SRC_FILES += $(call all-java-files-under, src_pd)
LOCAL_SRC_FILES += $(call all-java-files-under, src_pd)


LOCAL_RESOURCE_DIR += \
LOCAL_RESOURCE_DIR += \
    $(LOCAL_PATH)/res \
    $(LOCAL_PATH)/res \
    $(TOP)/frameworks/support/compat/res \
    $(TOP)/frameworks/support/design/res \
    $(TOP)/frameworks/support/design/res \
    $(TOP)/frameworks/support/v7/appcompat/res
    $(TOP)/frameworks/support/v7/appcompat/res


LOCAL_AAPT_FLAGS := \
LOCAL_AAPT_FLAGS := \
    --auto-add-overlay \
    --auto-add-overlay \
    --extra-packages android.support.compat \
    --extra-packages android.support.design \
    --extra-packages android.support.design \
    --extra-packages android.support.transition \
    --extra-packages android.support.transition \
    --extra-packages android.support.v7.appcompat
    --extra-packages android.support.v7.appcompat
+2 −0
Original line number Original line Diff line number Diff line
@@ -3,6 +3,7 @@ LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
include $(CLEAR_VARS)


LOCAL_CFLAGS += -DEGL_EGLEXT_PROTOTYPES -Wno-unused-parameter
LOCAL_CFLAGS += -DEGL_EGLEXT_PROTOTYPES -Wno-unused-parameter
LOCAL_CFLAGS += -Wall -Wextra


LOCAL_SRC_FILES := jni_egl_fence.cpp
LOCAL_SRC_FILES := jni_egl_fence.cpp


@@ -45,6 +46,7 @@ LOCAL_SRC_FILES := filters/gradient.c \
                   filters/kmeans.cc
                   filters/kmeans.cc


LOCAL_CFLAGS    += -ffast-math -O3 -funroll-loops -Wno-unused-parameter
LOCAL_CFLAGS    += -ffast-math -O3 -funroll-loops -Wno-unused-parameter
LOCAL_CFLAGS += -Wall -Wextra
LOCAL_LDLIBS := -llog -ljnigraphics
LOCAL_LDLIBS := -llog -ljnigraphics
LOCAL_ARM_MODE := arm
LOCAL_ARM_MODE := arm


+1 −1
Original line number Original line Diff line number Diff line
@@ -36,7 +36,7 @@ typedef unsigned int Color;


#define LOG(msg...) __android_log_print(ANDROID_LOG_VERBOSE, "NativeFilters", msg)
#define LOG(msg...) __android_log_print(ANDROID_LOG_VERBOSE, "NativeFilters", msg)


#define JNIFUNCF(cls, name, vars...) Java_com_android_gallery3d_filtershow_filters_ ## cls ## _ ## name(JNIEnv* env, jobject obj, vars)
#define JNIFUNCF(cls, name, vars...) Java_com_android_gallery3d_filtershow_filters_ ## cls ## _ ## name(JNIEnv* env, jobject obj_unused __unused, vars)


#define RED i
#define RED i
#define GREEN (i+1)
#define GREEN (i+1)
+2 −2
Original line number Original line Diff line number Diff line
@@ -29,8 +29,8 @@ __inline__ int interp(unsigned char *src, int p , int *off ,float dr,float dg,
    return (int)frbg ;
    return (int)frbg ;
}
}


void JNIFUNCF(ImageFilterFx, nativeApplyFilter, jobject bitmap, jint width, jint height,
void JNIFUNCF(ImageFilterFx, nativeApplyFilter, jobject bitmap, jint width __unused,
        jobject lutbitmap, jint lutwidth, jint lutheight,
        jint height __unused, jobject lutbitmap, jint lutwidth, jint lutheight,
        jint start, jint end)
        jint start, jint end)
{
{
    char* destination = 0;
    char* destination = 0;
+10 −12
Original line number Original line Diff line number Diff line
@@ -19,7 +19,8 @@


#include "filters.h"
#include "filters.h"


static __inline__ void flipVertical(char * source, int srcWidth, int srcHeight, char * destination, int dstWidth, int dstHeight){
static __inline__ void flipVertical(char * source, int srcWidth, int srcHeight, char * destination,
        int dstWidth __unused, int dstHeight __unused) {
    //Vertical
    //Vertical
    size_t cpy_bytes = sizeof(char) * 4;
    size_t cpy_bytes = sizeof(char) * 4;
    int width = cpy_bytes * srcWidth;
    int width = cpy_bytes * srcWidth;
@@ -33,7 +34,8 @@ static __inline__ void flipVertical(char * source, int srcWidth, int srcHeight,
    }
    }
}
}


static __inline__ void flipHorizontal(char * source, int srcWidth, int srcHeight, char * destination, int dstWidth, int dstHeight){
static __inline__ void flipHorizontal(char * source, int srcWidth, int srcHeight,
        char * destination, int dstWidth __unused, int dstHeight __unused) {
    //Horizontal
    //Horizontal
    size_t cpy_bytes = sizeof(char) * 4;
    size_t cpy_bytes = sizeof(char) * 4;
    int width = cpy_bytes * srcWidth;
    int width = cpy_bytes * srcWidth;
@@ -72,11 +74,11 @@ static __inline__ void flip_fun(int flip, char * source, int srcWidth, int srcHe
}
}


//90 CCW (opposite of what's used in UI?)
//90 CCW (opposite of what's used in UI?)
static __inline__ void rotate90(char * source, int srcWidth, int srcHeight, char * destination, int dstWidth, int dstHeight){
static __inline__ void rotate90(char * source, int srcWidth, int srcHeight, char * destination,
        int dstWidth __unused, int dstHeight __unused) {
    size_t cpy_bytes = sizeof(char) * 4;
    size_t cpy_bytes = sizeof(char) * 4;
    int width = cpy_bytes * srcWidth;
    int width = cpy_bytes * srcWidth;
    int length = srcHeight;
    int length = srcHeight;
    int total = length * width;
    for (size_t j = 0; j < length * cpy_bytes; j+= cpy_bytes){
    for (size_t j = 0; j < length * cpy_bytes; j+= cpy_bytes){
        for (int i = 0; i < width; i+=cpy_bytes){
        for (int i = 0; i < width; i+=cpy_bytes){
            int column_disp = (width - cpy_bytes - i) * length;
            int column_disp = (width - cpy_bytes - i) * length;
@@ -120,7 +122,6 @@ static __inline__ void crop(char * source, int srcWidth, int srcHeight, char * d
    if ((srcWidth > dstWidth + offsetWidth) || (srcHeight > dstHeight + offsetHeight)){
    if ((srcWidth > dstWidth + offsetWidth) || (srcHeight > dstHeight + offsetHeight)){
        return;
        return;
    }
    }
    int i = 0;
    int j = 0;
    int j = 0;
    for (j = offsetHeight; j < offsetHeight + dstHeight; j++){
    for (j = offsetHeight; j < offsetHeight + dstHeight; j++){
        memcpy(destination + (j - offsetHeight) * new_row_width, source + j * row_width + offsetWidth * cpy_bytes, cpy_bytes * dstWidth );
        memcpy(destination + (j - offsetHeight) * new_row_width, source + j * row_width + offsetWidth * cpy_bytes, cpy_bytes * dstWidth );
@@ -143,7 +144,6 @@ void JNIFUNCF(ImageFilterGeometry, nativeApplyFilterFlip, jobject src, jint srcW
void JNIFUNCF(ImageFilterGeometry, nativeApplyFilterRotate, jobject src, jint srcWidth, jint srcHeight, jobject dst, jint dstWidth, jint dstHeight, jint rotate) {
void JNIFUNCF(ImageFilterGeometry, nativeApplyFilterRotate, jobject src, jint srcWidth, jint srcHeight, jobject dst, jint dstWidth, jint dstHeight, jint rotate) {
    char* destination = 0;
    char* destination = 0;
    char* source = 0;
    char* source = 0;
    int len = dstWidth * dstHeight * 4;
    AndroidBitmap_lockPixels(env, src, (void**) &source);
    AndroidBitmap_lockPixels(env, src, (void**) &source);
    AndroidBitmap_lockPixels(env, dst, (void**) &destination);
    AndroidBitmap_lockPixels(env, dst, (void**) &destination);
    rotate_fun(rotate, source, srcWidth, srcHeight, destination, dstWidth, dstHeight);
    rotate_fun(rotate, source, srcWidth, srcHeight, destination, dstWidth, dstHeight);
@@ -154,7 +154,6 @@ void JNIFUNCF(ImageFilterGeometry, nativeApplyFilterRotate, jobject src, jint sr
void JNIFUNCF(ImageFilterGeometry, nativeApplyFilterCrop, jobject src, jint srcWidth, jint srcHeight, jobject dst, jint dstWidth, jint dstHeight, jint offsetWidth, jint offsetHeight) {
void JNIFUNCF(ImageFilterGeometry, nativeApplyFilterCrop, jobject src, jint srcWidth, jint srcHeight, jobject dst, jint dstWidth, jint dstHeight, jint offsetWidth, jint offsetHeight) {
    char* destination = 0;
    char* destination = 0;
    char* source = 0;
    char* source = 0;
    int len = dstWidth * dstHeight * 4;
    AndroidBitmap_lockPixels(env, src, (void**) &source);
    AndroidBitmap_lockPixels(env, src, (void**) &source);
    AndroidBitmap_lockPixels(env, dst, (void**) &destination);
    AndroidBitmap_lockPixels(env, dst, (void**) &destination);
    crop(source, srcWidth, srcHeight, destination, dstWidth, dstHeight, offsetWidth, offsetHeight);
    crop(source, srcWidth, srcHeight, destination, dstWidth, dstHeight, offsetWidth, offsetHeight);
@@ -162,7 +161,9 @@ void JNIFUNCF(ImageFilterGeometry, nativeApplyFilterCrop, jobject src, jint srcW
    AndroidBitmap_unlockPixels(env, src);
    AndroidBitmap_unlockPixels(env, src);
}
}


void JNIFUNCF(ImageFilterGeometry, nativeApplyFilterStraighten, jobject src, jint srcWidth, jint srcHeight, jobject dst, jint dstWidth, jint dstHeight, jfloat straightenAngle) {
void JNIFUNCF(ImageFilterGeometry, nativeApplyFilterStraighten, jobject src, jint srcWidth __unused,
        jint srcHeight __unused, jobject dst, jint dstWidth, jint dstHeight,
        jfloat straightenAngle __unused) {
    char* destination = 0;
    char* destination = 0;
    char* source = 0;
    char* source = 0;
    int len = dstWidth * dstHeight * 4;
    int len = dstWidth * dstHeight * 4;
@@ -171,11 +172,8 @@ void JNIFUNCF(ImageFilterGeometry, nativeApplyFilterStraighten, jobject src, jin
    // TODO: implement straighten
    // TODO: implement straighten
    int i = 0;
    int i = 0;
    for (; i < len; i += 4) {
    for (; i < len; i += 4) {
        int r = source[RED];
        int g = source[GREEN];
        int b = source[BLUE];
        destination[RED] = 128;
        destination[RED] = 128;
        destination[GREEN] = g;
        destination[GREEN] = source[GREEN];
        destination[BLUE] = 128;
        destination[BLUE] = 128;
    }
    }
    AndroidBitmap_unlockPixels(env, dst);
    AndroidBitmap_unlockPixels(env, dst);
Loading