summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2010-10-27 18:57:51 -0700
committerRomain Guy <romainguy@google.com>2010-11-02 16:17:23 -0700
commit5b3b35296e8b2c8d3f07d32bb645d5414db41a1d (patch)
treebad2ebdbfeb8a3a0be1591d5a357a8280df7d1d2 /core
parent2444ddb3d9b59ec45ba50858fcbff639e59b93b1 (diff)
downloadframeworks_base-5b3b35296e8b2c8d3f07d32bb645d5414db41a1d.zip
frameworks_base-5b3b35296e8b2c8d3f07d32bb645d5414db41a1d.tar.gz
frameworks_base-5b3b35296e8b2c8d3f07d32bb645d5414db41a1d.tar.bz2
Optimize FBO drawing with regions.
This optimization is currently disabled until Launcher is modified to take advantage of it. The optimization can be enabled by turning on RENDER_LAYERS_AS_REGIONS in the OpenGLRenderer.h file. Change-Id: I2fdf59d0f4dc690a3d7f712173ab8db3848b27b1
Diffstat (limited to 'core')
-rw-r--r--core/java/com/android/internal/widget/LockPatternView.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/java/com/android/internal/widget/LockPatternView.java b/core/java/com/android/internal/widget/LockPatternView.java
index 007e7b9..f80fbd8 100644
--- a/core/java/com/android/internal/widget/LockPatternView.java
+++ b/core/java/com/android/internal/widget/LockPatternView.java
@@ -129,6 +129,7 @@ public class LockPatternView extends View {
private long[] mVibePattern;
private int mAspect;
+ private final Matrix mArrowMatrix = new Matrix();
/**
* Represents a cell in the 3 X 3 matrix of the unlock pattern view.
@@ -923,7 +924,6 @@ public class LockPatternView extends View {
// This assumes that the arrow image is drawn at 12:00 with it's top edge
// coincident with the circle bitmap's top edge.
Bitmap arrow = green ? mBitmapArrowGreenUp : mBitmapArrowRedUp;
- Matrix matrix = new Matrix();
final int cellWidth = mBitmapCircleDefault.getWidth();
final int cellHeight = mBitmapCircleDefault.getHeight();
@@ -933,10 +933,10 @@ public class LockPatternView extends View {
final float angle = (float) Math.toDegrees(theta) + 90.0f;
// compose matrix
- matrix.setTranslate(leftX + offsetX, topY + offsetY); // transform to cell position
- matrix.preRotate(angle, cellWidth / 2.0f, cellHeight / 2.0f); // rotate about cell center
- matrix.preTranslate((cellWidth - arrow.getWidth()) / 2.0f, 0.0f); // translate to 12:00 pos
- canvas.drawBitmap(arrow, matrix, mPaint);
+ mArrowMatrix.setTranslate(leftX + offsetX, topY + offsetY); // transform to cell position
+ mArrowMatrix.preRotate(angle, cellWidth / 2.0f, cellHeight / 2.0f); // rotate about cell center
+ mArrowMatrix.preTranslate((cellWidth - arrow.getWidth()) / 2.0f, 0.0f); // translate to 12:00 pos
+ canvas.drawBitmap(arrow, mArrowMatrix, mPaint);
}
/**