diff options
author | Xavier Ducrohet <xav@android.com> | 2010-01-19 16:34:48 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-01-19 16:34:48 -0800 |
commit | ef5506c817c2a305ca1c7b03d4ea34a64962b9d7 (patch) | |
tree | dc9f072b84d93ac15b50be18b20e4c4bfaf8688f /tools/layoutlib | |
parent | 691b47e154f702bc77472e670281a6be4252e89d (diff) | |
parent | f95e3dd23cb6cbd7a86dece3c4bafff71307721a (diff) | |
download | frameworks_base-ef5506c817c2a305ca1c7b03d4ea34a64962b9d7.zip frameworks_base-ef5506c817c2a305ca1c7b03d4ea34a64962b9d7.tar.gz frameworks_base-ef5506c817c2a305ca1c7b03d4ea34a64962b9d7.tar.bz2 |
am f95e3dd2: am 5e083024: ADT/Layoutlib: shader clean-up.
Merge commit 'f95e3dd23cb6cbd7a86dece3c4bafff71307721a'
* commit 'f95e3dd23cb6cbd7a86dece3c4bafff71307721a':
ADT/Layoutlib: shader clean-up.
Diffstat (limited to 'tools/layoutlib')
7 files changed, 14 insertions, 7 deletions
diff --git a/tools/layoutlib/bridge/src/android/graphics/BitmapShader.java b/tools/layoutlib/bridge/src/android/graphics/BitmapShader.java index 6453fdb..ad3974c 100644 --- a/tools/layoutlib/bridge/src/android/graphics/BitmapShader.java +++ b/tools/layoutlib/bridge/src/android/graphics/BitmapShader.java @@ -41,7 +41,7 @@ public class BitmapShader extends Shader { } @Override - Paint getPaint() { + Paint getJavaPaint() { return null; } } diff --git a/tools/layoutlib/bridge/src/android/graphics/Canvas.java b/tools/layoutlib/bridge/src/android/graphics/Canvas.java index 9851ae3..9f4dfd0 100644 --- a/tools/layoutlib/bridge/src/android/graphics/Canvas.java +++ b/tools/layoutlib/bridge/src/android/graphics/Canvas.java @@ -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 { diff --git a/tools/layoutlib/bridge/src/android/graphics/ComposeShader.java b/tools/layoutlib/bridge/src/android/graphics/ComposeShader.java index df1101d..863d64a 100644 --- a/tools/layoutlib/bridge/src/android/graphics/ComposeShader.java +++ b/tools/layoutlib/bridge/src/android/graphics/ComposeShader.java @@ -46,7 +46,7 @@ public class ComposeShader extends Shader { } @Override - Paint getPaint() { + Paint getJavaPaint() { return null; } } diff --git a/tools/layoutlib/bridge/src/android/graphics/LinearGradient.java b/tools/layoutlib/bridge/src/android/graphics/LinearGradient.java index ea9eae9..7cb8f26 100644 --- a/tools/layoutlib/bridge/src/android/graphics/LinearGradient.java +++ b/tools/layoutlib/bridge/src/android/graphics/LinearGradient.java @@ -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; } } diff --git a/tools/layoutlib/bridge/src/android/graphics/RadialGradient.java b/tools/layoutlib/bridge/src/android/graphics/RadialGradient.java index e7c1828..13848c5 100644 --- a/tools/layoutlib/bridge/src/android/graphics/RadialGradient.java +++ b/tools/layoutlib/bridge/src/android/graphics/RadialGradient.java @@ -62,7 +62,7 @@ public class RadialGradient extends Shader { } @Override - Paint getPaint() { + Paint getJavaPaint() { // TODO Auto-generated method stub return null; } diff --git a/tools/layoutlib/bridge/src/android/graphics/Shader.java b/tools/layoutlib/bridge/src/android/graphics/Shader.java index d14db9c..0cc5940 100644 --- a/tools/layoutlib/bridge/src/android/graphics/Shader.java +++ b/tools/layoutlib/bridge/src/android/graphics/Shader.java @@ -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(); } diff --git a/tools/layoutlib/bridge/src/android/graphics/SweepGradient.java b/tools/layoutlib/bridge/src/android/graphics/SweepGradient.java index 64a5f5a..21d8244 100644 --- a/tools/layoutlib/bridge/src/android/graphics/SweepGradient.java +++ b/tools/layoutlib/bridge/src/android/graphics/SweepGradient.java @@ -60,7 +60,7 @@ public class SweepGradient extends Shader { } @Override - Paint getPaint() { + Paint getJavaPaint() { // TODO Auto-generated method stub return null; } |