diff options
author | nicolasroard <nicolasroard@google.com> | 2013-04-12 17:47:14 -0700 |
---|---|---|
committer | nicolasroard <nicolasroard@google.com> | 2013-04-12 18:07:11 -0700 |
commit | b6733f8911de010106411714ac2e03f8863628e2 (patch) | |
tree | e816b10201601fc08484faaf63efb90f66d5d9d3 /src | |
parent | 96f4db1b999640b1f65f6fabb57d249be30356e5 (diff) | |
download | android_packages_apps_Snap-b6733f8911de010106411714ac2e03f8863628e2.tar.gz android_packages_apps_Snap-b6733f8911de010106411714ac2e03f8863628e2.tar.bz2 android_packages_apps_Snap-b6733f8911de010106411714ac2e03f8863628e2.zip |
Add direct rendering for border
bug:8603245
Change-Id: Ibc1bde9adb19f930b474e4076a0c2720fbe0bc8d
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/gallery3d/filtershow/presets/ImagePreset.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/filtershow/presets/ImagePreset.java b/src/com/android/gallery3d/filtershow/presets/ImagePreset.java index 791164f5c..00f5977d1 100644 --- a/src/com/android/gallery3d/filtershow/presets/ImagePreset.java +++ b/src/com/android/gallery3d/filtershow/presets/ImagePreset.java @@ -22,6 +22,7 @@ import android.support.v8.renderscript.Allocation; import android.util.Log; import com.android.gallery3d.filtershow.ImageStateAdapter; +import com.android.gallery3d.filtershow.cache.CachingPipeline; import com.android.gallery3d.filtershow.cache.ImageLoader; import com.android.gallery3d.filtershow.filters.BaseFiltersManager; import com.android.gallery3d.filtershow.filters.FilterRepresentation; @@ -228,6 +229,10 @@ public class ImagePreset { mBorder = filter; } + public void resetBorder() { + mBorder = null; + } + public boolean isFx() { return mIsFxPreset; } @@ -474,6 +479,16 @@ public class ImagePreset { return bitmap; } + public void applyBorder(Allocation in, Allocation out, FilterEnvironment environment) { + if (mBorder != null && mDoApplyGeometry) { + mBorder.synchronizeRepresentation(); + // TODO: should keep the bitmap around + Allocation bitmapIn = Allocation.createTyped(CachingPipeline.getRenderScriptContext(), in.getType()); + bitmapIn.copyFrom(out); + environment.applyRepresentation(mBorder, bitmapIn, out); + } + } + public void applyFilters(int from, int to, Allocation in, Allocation out, FilterEnvironment environment) { if (mDoApplyFilters) { if (from < 0) { |