am 902b355d: Merge "Remove unused Grid object from LabelMaker.java class." into gingerbread

This commit is contained in:
Jack Palevich
2010-10-26 10:27:09 -07:00
committed by Android Git Automerger
2 changed files with 4 additions and 19 deletions

0
samples/ApiDemos/_index.html Executable file → Normal file
View File

View File

@@ -35,8 +35,8 @@ import javax.microedition.khronos.opengles.GL11Ext;
* *
* *
* OpenGL labels are implemented by creating a Bitmap, drawing all the labels * 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 * into the Bitmap, converting the Bitmap into an Alpha texture, and drawing
* mesh for each label * portions of the texture using glDrawTexiOES.
* *
* The benefits of this approach are that the labels are drawn using the high * 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 * quality anti-aliased font rasterizer, full character set support, and all the
@@ -246,24 +246,11 @@ public class LabelMaker {
textPaint); 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 // We know there's enough space, so update the member variables
mU = u + width; mU = u + width;
mV = v; mV = v;
mLineHeight = lineHeight; mLineHeight = lineHeight;
mLabels.add(new Label(grid, width, height, ascent, mLabels.add(new Label(width, height, ascent,
u, v + height, width, -height)); u, v + height, width, -height));
return mLabels.size() - 1; return mLabels.size() - 1;
} }
@@ -381,9 +368,8 @@ public class LabelMaker {
} }
private static class Label { 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) { int cropU, int cropV, int cropW, int cropH) {
this.grid = grid;
this.width = width; this.width = width;
this.height = height; this.height = height;
this.baseline = baseLine; this.baseline = baseLine;
@@ -395,7 +381,6 @@ public class LabelMaker {
mCrop = crop; mCrop = crop;
} }
public Grid grid;
public float width; public float width;
public float height; public float height;
public float baseline; public float baseline;