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

Commit 3848c136 authored by cretin45's avatar cretin45
Browse files

Gallery2: Fix filtershow renderscript for lollipop

* Use the non support version

Change-Id: Idce8f3f4741def8dcd080f226cd9a0ef909f7eb1
parent 41fd3ab8
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -10,19 +10,8 @@ LOCAL_STATIC_JAVA_LIBRARIES := android-support-v13
LOCAL_STATIC_JAVA_LIBRARIES += com.android.gallery3d.common2
LOCAL_STATIC_JAVA_LIBRARIES += xmp_toolkit
LOCAL_STATIC_JAVA_LIBRARIES += mp4parser
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v8-renderscript

LOCAL_RENDERSCRIPT_TARGET_API := 18
LOCAL_RENDERSCRIPT_COMPATIBILITY := 18
LOCAL_RENDERSCRIPT_FLAGS := -rs-package-name=android.support.v8.renderscript

# Keep track of previously compiled RS files too (from bundled GalleryGoogle).
prev_compiled_rs_files := $(call all-renderscript-files-under, src)

# We already have these files from GalleryGoogle, so don't install them.
LOCAL_RENDERSCRIPT_SKIP_INSTALL := $(prev_compiled_rs_files)

LOCAL_SRC_FILES := $(call all-java-files-under, src) $(prev_compiled_rs_files)
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_RESOURCE_DIR += $(LOCAL_PATH)/res
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ package com.android.gallery3d.filtershow.filters;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.Matrix;
import android.support.v8.renderscript.Allocation;
import android.renderscript.Allocation;
import android.widget.Toast;

import com.android.gallery3d.filtershow.imageshow.GeometryMathUtils;
+7 −7
Original line number Diff line number Diff line
@@ -18,11 +18,11 @@ package com.android.gallery3d.filtershow.filters;

import android.graphics.Bitmap;
import android.graphics.Matrix;
import android.support.v8.renderscript.Allocation;
import android.support.v8.renderscript.Element;
import android.support.v8.renderscript.RenderScript;
import android.support.v8.renderscript.Script.LaunchOptions;
import android.support.v8.renderscript.Type;
import android.renderscript.Allocation;
import android.renderscript.Element;
import android.renderscript.RenderScript;
import android.renderscript.Script;
import android.renderscript.Type;

import com.android.gallery3d.R;
import com.android.gallery3d.filtershow.pipeline.FilterEnvironment;
@@ -77,7 +77,7 @@ public class ImageFilterChanSat extends ImageFilterRS {
        Type.Builder tb_float = new Type.Builder(rsCtx, Element.F32_4(rsCtx));
        tb_float.setX(in.getType().getX());
        tb_float.setY(in.getType().getY());
        mScript = new ScriptC_saturation(rsCtx, res, R.raw.saturation);
        mScript = new ScriptC_saturation(rsCtx);
    }


@@ -132,7 +132,7 @@ public class ImageFilterChanSat extends ImageFilterRS {
        int width = in.getType().getX();
        int height = in.getType().getY();

        LaunchOptions options = new LaunchOptions();
        Script.LaunchOptions options = new Script.LaunchOptions();
        int ty;
        options.setX(0, width);

+8 −7
Original line number Diff line number Diff line
@@ -26,11 +26,12 @@ import com.android.gallery3d.filtershow.pipeline.FilterEnvironment;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.Matrix;
import android.support.v8.renderscript.Allocation;
import android.support.v8.renderscript.Element;
import android.support.v8.renderscript.RenderScript;
import android.support.v8.renderscript.Script.LaunchOptions;
import android.support.v8.renderscript.Type;

import android.renderscript.Allocation;
import android.renderscript.Element;
import android.renderscript.RenderScript;
import android.renderscript.Script;
import android.renderscript.Type;
import android.util.Log;

import com.android.gallery3d.R;
@@ -87,7 +88,7 @@ public class ImageFilterGrad extends ImageFilterRS {
        Type.Builder tb_float = new Type.Builder(rsCtx, Element.F32_4(rsCtx));
        tb_float.setX(in.getType().getX());
        tb_float.setY(in.getType().getY());
        mScript = new ScriptC_grad(rsCtx, res, R.raw.grad);
        mScript = new ScriptC_grad(rsCtx);
    }


@@ -161,7 +162,7 @@ public class ImageFilterGrad extends ImageFilterRS {
        int width = in.getType().getX();
        int height = in.getType().getY();

        LaunchOptions options = new LaunchOptions();
        Script.LaunchOptions options = new Script.LaunchOptions();
        int ty;
        options.setX(0, width);

+5 −3
Original line number Diff line number Diff line
@@ -18,7 +18,10 @@ package com.android.gallery3d.filtershow.filters;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.support.v8.renderscript.*;
import android.renderscript.Allocation;
import android.renderscript.Element;
import android.renderscript.RenderScript;
import android.renderscript.Type;
import android.util.Log;
import android.content.res.Resources;
import com.android.gallery3d.R;
@@ -159,8 +162,7 @@ public abstract class ImageFilterRS extends ImageFilter {

    private static Allocation convertRGBAtoA(RenderScript RS, Bitmap bitmap) {
        if (RS != mRScache || mGreyConvert == null) {
            mGreyConvert = new ScriptC_grey(RS, RS.getApplicationContext().getResources(),
                                            R.raw.grey);
            mGreyConvert = new ScriptC_grey(RS);
            mRScache = RS;
        }

Loading