diff options
Diffstat (limited to 'src/com/android/gallery3d/filtershow/presets/ImagePreset.java')
-rw-r--r-- | src/com/android/gallery3d/filtershow/presets/ImagePreset.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/filtershow/presets/ImagePreset.java b/src/com/android/gallery3d/filtershow/presets/ImagePreset.java index 84266c55d..ae5a03414 100644 --- a/src/com/android/gallery3d/filtershow/presets/ImagePreset.java +++ b/src/com/android/gallery3d/filtershow/presets/ImagePreset.java @@ -17,6 +17,7 @@ package com.android.gallery3d.filtershow.presets; import android.graphics.Bitmap; +import android.graphics.Rect; import android.util.Log; import com.android.gallery3d.filtershow.ImageStateAdapter; @@ -52,6 +53,8 @@ public class ImagePreset { private boolean mDoApplyFilters = true; public final GeometryMetadata mGeoData = new GeometryMetadata(); + private boolean mPartialRendering = false; + private Rect mPartialRenderingBounds; public ImagePreset() { setup(); @@ -421,6 +424,22 @@ public class ImagePreset { return bitmap; } + public boolean canDoPartialRendering() { + if (mGeoData.hasModifications()) { + return false; + } + for (int i = 0; i < mFilters.size(); i++) { + FilterRepresentation representation = null; + synchronized (mFilters) { + representation = mFilters.elementAt(i); + } + if (!representation.supportsPartialRendering()) { + return false; + } + } + return true; + } + public void fillImageStateAdapter(ImageStateAdapter imageStateAdapter) { if (imageStateAdapter == null) { return; @@ -446,4 +465,17 @@ public class ImagePreset { public void setScaleFactor(float value) { mScaleFactor = value; } + + public void setPartialRendering(boolean partialRendering, Rect bounds) { + mPartialRendering = partialRendering; + mPartialRenderingBounds = bounds; + } + + public boolean isPartialRendering() { + return mPartialRendering; + } + + public Rect getPartialRenderingBounds() { + return mPartialRenderingBounds; + } } |