diff options
-rw-r--r-- | src/com/android/camera/Camera.java | 9 | ||||
-rw-r--r-- | src/com/android/camera/ui/GLRootView.java | 14 | ||||
-rw-r--r-- | src/com/android/camera/ui/GLView.java | 10 | ||||
-rw-r--r-- | src/com/android/camera/ui/HeadUpDisplay.java | 2 | ||||
-rw-r--r-- | src/com/android/camera/ui/PopupWindow.java | 2 | ||||
-rw-r--r-- | src/com/android/camera/ui/ZoomController.java | 5 | ||||
-rw-r--r-- | src/com/android/camera/ui/ZoomIndicator.java | 3 |
7 files changed, 24 insertions, 21 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java index 77ed9c7..94154d9 100644 --- a/src/com/android/camera/Camera.java +++ b/src/com/android/camera/Camera.java @@ -25,6 +25,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.SharedPreferences; +import android.content.SharedPreferences.Editor; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory; @@ -260,6 +261,12 @@ public class Camera extends NoSearchActivity implements View.OnClickListener, } } + private void resetExposureCompensation() { + Editor editor = mPreferences.edit(); + editor.putString(CameraSettings.KEY_EXPOSURE, "0"); + editor.commit(); + } + private void keepMediaProviderInstance() { // We want to keep a reference to MediaProvider in camera's lifecycle. // TODO: Utilize mMediaProviderClient instance to replace @@ -911,6 +918,8 @@ public class Camera extends NoSearchActivity implements View.OnClickListener, mPreferences = PreferenceManager.getDefaultSharedPreferences(this); CameraSettings.upgradePreferences(mPreferences); + resetExposureCompensation(); + mQuickCapture = getQuickCaptureSettings(); /* diff --git a/src/com/android/camera/ui/GLRootView.java b/src/com/android/camera/ui/GLRootView.java index 92c0f35..a1b29fb 100644 --- a/src/com/android/camera/ui/GLRootView.java +++ b/src/com/android/camera/ui/GLRootView.java @@ -133,7 +133,7 @@ public class GLRootView extends GLSurfaceView private void initialize() { mFlags |= FLAG_INITIALIZED; - setEGLConfigChooser(8, 8, 8, 8, 0, 0); + setEGLConfigChooser(8, 8, 8, 8, 0, 4); getHolder().setFormat(PixelFormat.TRANSLUCENT); setZOrderOnTop(true); setDebugFlags(DEBUG_CHECK_GL_ERROR); @@ -226,6 +226,7 @@ public class GLRootView extends GLSurfaceView // Enable used features gl.glEnable(GL11.GL_BLEND); gl.glEnable(GL11.GL_SCISSOR_TEST); + gl.glEnable(GL11.GL_STENCIL_TEST); gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY); gl.glEnable(GL11.GL_TEXTURE_2D); @@ -233,11 +234,9 @@ public class GLRootView extends GLSurfaceView gl.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_REPLACE); - // Set the blend function for premultiplied alpha. - gl.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - // Set the background color gl.glClearColor(0f, 0f, 0f, 0f); + gl.glClearStencil(0); gl.glVertexPointer(2, GL11.GL_FLOAT, 0, mVertexBuffer); gl.glTexCoordPointer(2, GL11.GL_FLOAT, 0, mTexCoordBuffer); } @@ -402,15 +401,10 @@ public class GLRootView extends GLSurfaceView if ((mFlags & FLAG_NEED_LAYOUT) != 0) layoutContentPane(); clearClip(); - gl.glClear(GL10.GL_COLOR_BUFFER_BIT); + gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_STENCIL_BUFFER_BIT); gl.glEnable(GL11.GL_BLEND); gl.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); - /*gl.glDisable(GL11.GL_TEXTURE_2D); - gl.glColor4f(0, 0, 0.5f, 0.4f); - drawRect(0, 0, 725, 480); - gl.glEnable(GL11.GL_TEXTURE_2D);*/ - mAnimationTime = SystemClock.uptimeMillis(); if (mContentView != null) { mContentView.render(GLRootView.this, (GL11) gl); diff --git a/src/com/android/camera/ui/GLView.java b/src/com/android/camera/ui/GLView.java index 090de39..9d12293 100644 --- a/src/com/android/camera/ui/GLView.java +++ b/src/com/android/camera/ui/GLView.java @@ -218,12 +218,12 @@ public class GLView { return false; } - private boolean dispatchTouchEvent( - MotionEvent event, int x, int y, GLView component) { + private boolean dispatchTouchEvent(MotionEvent event, + int x, int y, GLView component, boolean checkBounds) { Rect rect = component.mBounds; int left = rect.left; int top = rect.top; - if (rect.contains(x, y)) { + if (!checkBounds || rect.contains(x, y)) { event.offsetLocation(-left, -top); if (component.dispatchTouchEvent(event)) { event.offsetLocation(left, top); @@ -245,7 +245,7 @@ public class GLView { cancel.setAction(MotionEvent.ACTION_CANCEL); mMotionTarget = null; } else { - dispatchTouchEvent(event, x, y, mMotionTarget); + dispatchTouchEvent(event, x, y, mMotionTarget, false); if (action == MotionEvent.ACTION_CANCEL || action == MotionEvent.ACTION_UP) { mMotionTarget = null; @@ -257,7 +257,7 @@ public class GLView { for (int i = 0, n = getComponentCount(); i < n; ++i) { GLView component = getComponent(i); if (component.getVisibility() != GLView.VISIBLE) continue; - if (dispatchTouchEvent(event, x, y, component)) { + if (dispatchTouchEvent(event, x, y, component, true)) { mMotionTarget = component; return true; } diff --git a/src/com/android/camera/ui/HeadUpDisplay.java b/src/com/android/camera/ui/HeadUpDisplay.java index 561bd5b..046be6d 100644 --- a/src/com/android/camera/ui/HeadUpDisplay.java +++ b/src/com/android/camera/ui/HeadUpDisplay.java @@ -263,7 +263,7 @@ public class HeadUpDisplay extends GLView { } private void initializePopupWindow(Context context) { - mPopupWindow = new PopupWindow(); + mPopupWindow = new PopupWindowStencilImpl(); mPopupWindow.setBackground( new NinePatchTexture(context, R.drawable.menu_popup)); mPopupWindow.setAnchor(new ResourceTexture( diff --git a/src/com/android/camera/ui/PopupWindow.java b/src/com/android/camera/ui/PopupWindow.java index 3d650cf..cb771cc 100644 --- a/src/com/android/camera/ui/PopupWindow.java +++ b/src/com/android/camera/ui/PopupWindow.java @@ -143,7 +143,7 @@ public class PopupWindow extends GLView { AnimationSet set = new AnimationSet(false); Animation scale = new ScaleAnimation( - 0.7f, 1f, 0.7f, 1f, getWidth(), getHeight() / 2); + 0.7f, 1f, 0.7f, 1f, getWidth(), mAnchorPosition); Animation alpha = new AlphaAnimation(0.5f, 1.0f); set.addAnimation(scale); diff --git a/src/com/android/camera/ui/ZoomController.java b/src/com/android/camera/ui/ZoomController.java index e49b36a..83e2d09 100644 --- a/src/com/android/camera/ui/ZoomController.java +++ b/src/com/android/camera/ui/ZoomController.java @@ -7,7 +7,6 @@ import android.graphics.Rect; import android.view.MotionEvent; import com.android.camera.R; - import com.android.camera.Util; import java.text.DecimalFormat; @@ -64,9 +63,11 @@ public class ZoomController extends GLView { } private void onSliderMoved(int position, boolean isMoving) { - mSliderPosition = Util.clamp(position, + position = Util.clamp(position, mSliderTop, mSliderBottom - sSlider.getHeight()); + mSliderPosition = position; invalidate(); + int index = mRatios.length - 1 - (int) ((position - mSliderTop) / mValueGap + .5f); if (index != mIndex || !isMoving) { diff --git a/src/com/android/camera/ui/ZoomIndicator.java b/src/com/android/camera/ui/ZoomIndicator.java index 726250d..e9359ed 100644 --- a/src/com/android/camera/ui/ZoomIndicator.java +++ b/src/com/android/camera/ui/ZoomIndicator.java @@ -4,7 +4,6 @@ import android.content.Context; import android.graphics.Color; import com.android.camera.R; - import com.android.camera.ui.ZoomController.ZoomListener; import java.text.DecimalFormat; @@ -12,7 +11,7 @@ import java.text.DecimalFormat; public class ZoomIndicator extends AbstractIndicator { private static final DecimalFormat sZoomFormat = new DecimalFormat("#.#x"); private static final float FONT_SIZE = 18; - private static final int FONT_COLOR = Color.WHITE; + private static final int FONT_COLOR = 0xA8FFFFFF; protected static final String TAG = "ZoomIndicator"; |