From 8e50990893f7fbe68369c7854c41f9a7645f37a5 Mon Sep 17 00:00:00 2001 From: Jack Palevich Date: Tue, 22 Dec 2009 18:32:05 +0800 Subject: [PATCH] Remove unnecessary matrix stack manipulations. glDrawTexiOES does not use the matix stack, so no need to modify it. --- .../android/apis/graphics/spritetext/LabelMaker.java | 7 +------ 1 file changed, 1 insertion(+), 6 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 4bf87f7bf..648139795 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 @@ -351,17 +351,12 @@ public class LabelMaker { */ public void draw(GL10 gl, float x, float y, int labelID) { checkState(STATE_DRAWING, STATE_DRAWING); - gl.glPushMatrix(); - float snappedX = (float) Math.floor(x); - float snappedY = (float) Math.floor(y); - gl.glTranslatef(snappedX, snappedY, 0.0f); Label label = mLabels.get(labelID); gl.glEnable(GL10.GL_TEXTURE_2D); ((GL11)gl).glTexParameteriv(GL10.GL_TEXTURE_2D, GL11Ext.GL_TEXTURE_CROP_RECT_OES, label.mCrop, 0); - ((GL11Ext)gl).glDrawTexiOES((int) snappedX, (int) snappedY, 0, + ((GL11Ext)gl).glDrawTexiOES((int) x, (int) y, 0, (int) label.width, (int) label.height); - gl.glPopMatrix(); } /**