summaryrefslogtreecommitdiff
path: root/samples/ApiDemos/src
diff options
context:
space:
mode:
authorJack Palevich <jackpal@google.com>2010-10-26 10:27:09 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-10-26 10:27:09 -0700
commitddc73f98ca3a14a655cd7817aedb66ccd2486be5 (patch)
tree9e63e8f660981c7feeb46472b645fdcdbc920f42 /samples/ApiDemos/src
parent844b1ed7c7128e9cd4620a4ed559b5c279be6770 (diff)
parent902b355dfca11494fa219e2a07154698027ee15b (diff)
am 902b355d: Merge "Remove unused Grid object from LabelMaker.java class." into gingerbread
Diffstat (limited to 'samples/ApiDemos/src')
-rw-r--r--samples/ApiDemos/src/com/example/android/apis/graphics/spritetext/LabelMaker.java23
1 files changed, 4 insertions, 19 deletions
diff --git a/samples/ApiDemos/src/com/example/android/apis/graphics/spritetext/LabelMaker.java b/samples/ApiDemos/src/com/example/android/apis/graphics/spritetext/LabelMaker.java
index 648139795..0c48e4a1d 100644
--- a/samples/ApiDemos/src/com/example/android/apis/graphics/spritetext/LabelMaker.java
+++ b/samples/ApiDemos/src/com/example/android/apis/graphics/spritetext/LabelMaker.java
@@ -35,8 +35,8 @@ import javax.microedition.khronos.opengles.GL11Ext;
*
*
* OpenGL labels are implemented by creating a Bitmap, drawing all the labels
- * into the Bitmap, converting the Bitmap into an Alpha texture, and creating a
- * mesh for each label
+ * into the Bitmap, converting the Bitmap into an Alpha texture, and drawing
+ * portions of the texture using glDrawTexiOES.
*
* The benefits of this approach are that the labels are drawn using the high
* quality anti-aliased font rasterizer, full character set support, and all the
@@ -246,24 +246,11 @@ public class LabelMaker {
textPaint);
}
- Grid grid = new Grid(2, 2);
- // Grid.set arguments: i, j, x, y, z, u, v
-
- float texU = u * mTexelWidth;
- float texU2 = u2 * mTexelWidth;
- float texV = 1.0f - v * mTexelHeight;
- float texV2 = 1.0f - v2 * mTexelHeight;
-
- grid.set(0, 0, 0.0f, 0.0f, 0.0f, texU , texV2);
- grid.set(1, 0, width, 0.0f, 0.0f, texU2, texV2);
- grid.set(0, 1, 0.0f, height, 0.0f, texU , texV );
- grid.set(1, 1, width, height, 0.0f, texU2, texV );
-
// We know there's enough space, so update the member variables
mU = u + width;
mV = v;
mLineHeight = lineHeight;
- mLabels.add(new Label(grid, width, height, ascent,
+ mLabels.add(new Label(width, height, ascent,
u, v + height, width, -height));
return mLabels.size() - 1;
}
@@ -381,9 +368,8 @@ public class LabelMaker {
}
private static class Label {
- public Label(Grid grid, float width, float height, float baseLine,
+ public Label(float width, float height, float baseLine,
int cropU, int cropV, int cropW, int cropH) {
- this.grid = grid;
this.width = width;
this.height = height;
this.baseline = baseLine;
@@ -395,7 +381,6 @@ public class LabelMaker {
mCrop = crop;
}
- public Grid grid;
public float width;
public float height;
public float baseline;