am 5e083024: ADT/Layoutlib: shader clean-up.

Merge commit '5e083024269e7c5bf904301a98fa6eade6fec094' into eclair-plus-aosp

* commit '5e083024269e7c5bf904301a98fa6eade6fec094':
  ADT/Layoutlib: shader clean-up.
This commit is contained in:
Xavier Ducrohet
2010-01-14 11:36:50 -08:00
committed by Android Git Automerger
7 changed files with 14 additions and 7 deletions

View File

@@ -41,7 +41,7 @@ public class BitmapShader extends Shader {
}
@Override
Paint getPaint() {
Paint getJavaPaint() {
return null;
}
}

View File

@@ -126,7 +126,7 @@ public class Canvas extends _Original_Canvas {
Shader shader = paint.getShader();
if (shader != null) {
java.awt.Paint shaderPaint = shader.getPaint();
java.awt.Paint shaderPaint = shader.getJavaPaint();
if (shaderPaint != null) {
g.setPaint(shaderPaint);
} else {

View File

@@ -46,7 +46,7 @@ public class ComposeShader extends Shader {
}
@Override
Paint getPaint() {
Paint getJavaPaint() {
return null;
}
}

View File

@@ -48,6 +48,8 @@ public class LinearGradient extends Shader {
// FIXME implement multi color linear gradient
if (colors.length == 2) {
// The hasAlpha flag in Color() is only used to enforce alpha to 0xFF if false.
// If true the alpha is read from the int.
mGradientPaint = new GradientPaint(x0, y0, new Color(colors[0], true /* hasalpha */),
x1, y1, new Color(colors[1], true /* hasalpha */), tile != TileMode.CLAMP);
}
@@ -66,6 +68,8 @@ public class LinearGradient extends Shader {
*/
public LinearGradient(float x0, float y0, float x1, float y1, int color0, int color1,
TileMode tile) {
// The hasAlpha flag in Color() is only used to enforce alpha to 0xFF if false.
// If true the alpha is read from the int.
mGradientPaint = new GradientPaint(x0, y0, new Color(color0, true /* hasalpha */), x1, y1,
new Color(color1, true /* hasalpha */), tile != TileMode.CLAMP);
}
@@ -73,7 +77,7 @@ public class LinearGradient extends Shader {
// ---------- Custom Methods
@Override
public Paint getPaint() {
public Paint getJavaPaint() {
return mGradientPaint;
}
}

View File

@@ -62,7 +62,7 @@ public class RadialGradient extends Shader {
}
@Override
Paint getPaint() {
Paint getJavaPaint() {
// TODO Auto-generated method stub
return null;
}

View File

@@ -76,5 +76,8 @@ public abstract class Shader {
}
}
abstract java.awt.Paint getPaint();
/**
* Returns a java.awt.Paint object matching this shader.
*/
abstract java.awt.Paint getJavaPaint();
}

View File

@@ -60,7 +60,7 @@ public class SweepGradient extends Shader {
}
@Override
Paint getPaint() {
Paint getJavaPaint() {
// TODO Auto-generated method stub
return null;
}