summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/filters
diff options
context:
space:
mode:
authorJohn Hoford <hoford@google.com>2013-08-13 19:06:35 -0700
committerJohn Hoford <hoford@google.com>2013-08-13 19:06:35 -0700
commitd3ca24707a0a0ab019dec0a17b0d540b685e459a (patch)
tree855180dff56a42cfda1393373b3d1f066ea4ed73 /src/com/android/gallery3d/filtershow/filters
parent9977d45fcae932581c1788cf3fa96a3f4040a8dc (diff)
downloadandroid_packages_apps_Gallery2-d3ca24707a0a0ab019dec0a17b0d540b685e459a.tar.gz
android_packages_apps_Gallery2-d3ca24707a0a0ab019dec0a17b0d540b685e459a.tar.bz2
android_packages_apps_Gallery2-d3ca24707a0a0ab019dec0a17b0d540b685e459a.zip
add solid round mode to draw
Change-Id: I60249711602fa3aaf2bce0b5035e75f746caa5eb
Diffstat (limited to 'src/com/android/gallery3d/filtershow/filters')
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java4
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterDraw.java13
2 files changed, 14 insertions, 3 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java b/src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java
index d55fa6d14..cdbbcef58 100644
--- a/src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java
+++ b/src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java
@@ -51,7 +51,7 @@ public class FilterDrawRepresentation extends FilterRepresentation {
private BasicParameterInt mParamBrightness = new ParameterBrightness(PARAM_BRIGHTNESS, 220);
private BasicParameterInt mParamSaturation = new ParameterSaturation(PARAM_SATURATION, 200);
private ParameterOpacity mParamOpacity = new ParameterOpacity(PARAM_OPACITY, 200);
- private BasicParameterStyle mParamStyle = new BasicParameterStyle(PARAM_STYLE, 4);
+ private BasicParameterStyle mParamStyle = new BasicParameterStyle(PARAM_STYLE, 5);
int mParamMode;
Parameter mCurrentParam = mParamSize;
private static final String SERIAL_COLOR = "color";
@@ -235,7 +235,7 @@ public class FilterDrawRepresentation extends FilterRepresentation {
sd.mRadius = size;
sd.mType = type;
}
-
+
public void startNewSection(float x, float y) {
mCurrent = new StrokeData();
fillStrokeParameters(mCurrent);
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterDraw.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterDraw.java
index e4a461573..6a0ce5719 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilterDraw.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterDraw.java
@@ -53,7 +53,8 @@ public class ImageFilterDraw extends ImageFilter {
}
DrawStyle[] mDrawingsTypes = new DrawStyle[] {
- new SimpleDraw(),
+ new SimpleDraw(0),
+ new SimpleDraw(1),
new Brush(R.drawable.brush_gauss),
new Brush(R.drawable.brush_marker),
new Brush(R.drawable.brush_spatter)
@@ -92,6 +93,11 @@ public class ImageFilterDraw extends ImageFilter {
class SimpleDraw implements DrawStyle {
byte mType;
+ int mMode;
+
+ public SimpleDraw(int mode) {
+ mMode = mode;
+ }
@Override
public void setType(byte type) {
@@ -110,6 +116,11 @@ public class ImageFilterDraw extends ImageFilter {
Paint paint = new Paint();
paint.setStyle(Style.STROKE);
+ if (mMode == 0) {
+ paint.setStrokeCap(Paint.Cap.SQUARE);
+ } else {
+ paint.setStrokeCap(Paint.Cap.ROUND);
+ }
paint.setAntiAlias(true);
paint.setColor(sd.mColor);
paint.setStrokeWidth(toScrMatrix.mapRadius(sd.mRadius));