setShowEditingControls(false);
setShowParameterValue(false);
setShowUtilityPanel(true);
+ setSupportsPartialRendering(true);
for (int i = 0; i < mSplines.length; i++) {
mSplines[i] = new Spline();
mSplines[i].reset();
setShowEditingControls(false);
setShowParameterValue(false);
setShowUtilityPanel(false);
+ setSupportsPartialRendering(true);
}
public String toString() {
private String mName;
private int mPriority = TYPE_NORMAL;
private Class mFilterClass;
+ private boolean mSupportsPartialRendering = false;
private int mTextId = 0;
private int mEditorId = BasicEditor.ID;
private int mButtonId = 0;
representation.setName(getName());
representation.setPriority(getPriority());
representation.setFilterClass(getFilterClass());
+ representation.setSupportsPartialRendering(supportsPartialRendering());
representation.setTextId(getTextId());
representation.setEditorId(getEditorId());
representation.setButtonId(getButtonId());
if (representation.mFilterClass == representation.mFilterClass
&& representation.mName.equalsIgnoreCase(mName)
&& representation.mPriority == mPriority
+ && representation.mSupportsPartialRendering == mSupportsPartialRendering
&& representation.mTextId == mTextId
&& representation.mEditorId == mEditorId
&& representation.mButtonId == mButtonId
return false;
}
+ public boolean supportsPartialRendering() {
+ return mSupportsPartialRendering;
+ }
+
+ public void setSupportsPartialRendering(boolean value) {
+ mSupportsPartialRendering = value;
+ }
+
public void useParametersFrom(FilterRepresentation a) {
}
package com.android.gallery3d.filtershow.presets;
import android.graphics.Bitmap;
+import android.graphics.Rect;
import android.util.Log;
import com.android.gallery3d.filtershow.ImageStateAdapter;
private boolean mDoApplyFilters = true;
public final GeometryMetadata mGeoData = new GeometryMetadata();
+ private boolean mPartialRendering = false;
+ private Rect mPartialRenderingBounds;
public ImagePreset() {
setup();
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;
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;
+ }
}