2010-08-28 00:22:57 +04:00
|
|
|
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
|
2010-06-03 01:55:28 +04:00
|
|
|
* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is Mozilla Android code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Mozilla Foundation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2010
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Vladimir Vukicevic <vladimir@pobox.com>
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
|
|
|
package org.mozilla.gecko;
|
|
|
|
|
|
|
|
import java.io.*;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.concurrent.*;
|
|
|
|
import java.util.concurrent.locks.*;
|
|
|
|
import java.util.concurrent.atomic.*;
|
|
|
|
import java.util.zip.*;
|
|
|
|
import java.nio.*;
|
|
|
|
|
|
|
|
import android.os.*;
|
|
|
|
import android.app.*;
|
|
|
|
import android.text.*;
|
2010-11-23 09:56:37 +03:00
|
|
|
import android.text.method.*;
|
2010-06-03 01:55:28 +04:00
|
|
|
import android.view.*;
|
|
|
|
import android.view.inputmethod.*;
|
|
|
|
import android.content.*;
|
|
|
|
import android.graphics.*;
|
|
|
|
import android.widget.*;
|
|
|
|
import android.hardware.*;
|
2010-06-05 01:14:43 +04:00
|
|
|
import android.location.*;
|
2010-12-27 18:33:37 +03:00
|
|
|
import android.graphics.drawable.*;
|
|
|
|
import android.content.res.*;
|
2010-06-03 01:55:28 +04:00
|
|
|
|
|
|
|
import android.util.*;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* GeckoSurfaceView implements a GL surface view,
|
|
|
|
* similar to GLSurfaceView. However, since we
|
|
|
|
* already have a thread for Gecko, we don't really want
|
|
|
|
* a separate renderer thread that GLSurfaceView provides.
|
|
|
|
*/
|
|
|
|
class GeckoSurfaceView
|
|
|
|
extends SurfaceView
|
2010-06-05 01:14:43 +04:00
|
|
|
implements SurfaceHolder.Callback, SensorEventListener, LocationListener
|
2010-06-03 01:55:28 +04:00
|
|
|
{
|
2011-08-19 06:27:41 +04:00
|
|
|
private static final String LOG_FILE_NAME = "GeckoSurfaceView";
|
|
|
|
|
2010-06-03 01:55:28 +04:00
|
|
|
public GeckoSurfaceView(Context context) {
|
|
|
|
super(context);
|
|
|
|
|
|
|
|
getHolder().addCallback(this);
|
|
|
|
inputConnection = new GeckoInputConnection(this);
|
|
|
|
setFocusable(true);
|
|
|
|
setFocusableInTouchMode(true);
|
2011-01-11 08:48:35 +03:00
|
|
|
|
|
|
|
DisplayMetrics metrics = new DisplayMetrics();
|
|
|
|
GeckoApp.mAppContext.getWindowManager().
|
|
|
|
getDefaultDisplay().getMetrics(metrics);
|
|
|
|
mWidth = metrics.widthPixels;
|
|
|
|
mHeight = metrics.heightPixels;
|
2010-06-03 01:55:28 +04:00
|
|
|
mBufferWidth = 0;
|
|
|
|
mBufferHeight = 0;
|
|
|
|
|
|
|
|
mSurfaceLock = new ReentrantLock();
|
2010-08-05 02:59:22 +04:00
|
|
|
|
2010-11-23 09:56:37 +03:00
|
|
|
mEditableFactory = Editable.Factory.getInstance();
|
2011-01-07 04:15:24 +03:00
|
|
|
initEditable("");
|
2010-08-05 02:59:22 +04:00
|
|
|
mIMEState = IME_STATE_DISABLED;
|
2010-11-24 05:12:53 +03:00
|
|
|
mIMETypeHint = "";
|
|
|
|
mIMEActionHint = "";
|
2010-06-03 01:55:28 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
protected void finalize() throws Throwable {
|
|
|
|
super.finalize();
|
|
|
|
}
|
|
|
|
|
2011-01-11 08:48:35 +03:00
|
|
|
void drawSplashScreen() {
|
|
|
|
this.drawSplashScreen(getHolder(), mWidth, mHeight);
|
|
|
|
}
|
|
|
|
|
2010-12-27 18:33:37 +03:00
|
|
|
void drawSplashScreen(SurfaceHolder holder, int width, int height) {
|
|
|
|
Canvas c = holder.lockCanvas();
|
|
|
|
if (c == null) {
|
2011-08-19 06:27:41 +04:00
|
|
|
Log.i(LOG_FILE_NAME, "canvas is null");
|
2010-12-27 18:33:37 +03:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
Resources res = getResources();
|
|
|
|
c.drawColor(res.getColor(R.color.splash_background));
|
|
|
|
Drawable drawable = res.getDrawable(R.drawable.splash);
|
|
|
|
int w = drawable.getIntrinsicWidth();
|
|
|
|
int h = drawable.getIntrinsicHeight();
|
|
|
|
int x = (width - w)/2;
|
2011-01-11 08:50:20 +03:00
|
|
|
int y = (height - h)/2 - 16;
|
2010-12-27 18:33:37 +03:00
|
|
|
drawable.setBounds(x, y, x + w, y + h);
|
|
|
|
drawable.draw(c);
|
|
|
|
Paint p = new Paint();
|
|
|
|
p.setTextAlign(Paint.Align.CENTER);
|
|
|
|
p.setTextSize(32f);
|
|
|
|
p.setAntiAlias(true);
|
|
|
|
p.setColor(res.getColor(R.color.splash_font));
|
2011-01-11 08:50:20 +03:00
|
|
|
c.drawText(GeckoSurfaceView.mSplashStatusMsg, width/2, y + h + 16, p);
|
2010-12-27 18:33:37 +03:00
|
|
|
holder.unlockCanvasAndPost(c);
|
|
|
|
}
|
|
|
|
|
2010-06-03 01:55:28 +04:00
|
|
|
/*
|
|
|
|
* Called on main thread
|
|
|
|
*/
|
|
|
|
|
2011-06-16 13:03:00 +04:00
|
|
|
public void draw(SurfaceHolder holder, ByteBuffer buffer) {
|
|
|
|
if (buffer == null || buffer.capacity() != (mWidth * mHeight * 2))
|
|
|
|
return;
|
|
|
|
|
|
|
|
synchronized (mSoftwareBuffer) {
|
|
|
|
if (buffer != mSoftwareBuffer || mSoftwareBufferCopy == null)
|
|
|
|
return;
|
|
|
|
|
|
|
|
Canvas c = holder.lockCanvas();
|
|
|
|
if (c == null)
|
|
|
|
return;
|
|
|
|
mSoftwareBufferCopy.copyPixelsFromBuffer(buffer);
|
|
|
|
c.drawBitmap(mSoftwareBufferCopy, 0, 0, null);
|
|
|
|
holder.unlockCanvasAndPost(c);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void draw(SurfaceHolder holder, Bitmap bitmap) {
|
|
|
|
if (bitmap == null ||
|
|
|
|
bitmap.getWidth() != mWidth || bitmap.getHeight() != mHeight)
|
|
|
|
return;
|
|
|
|
|
|
|
|
synchronized (mSoftwareBitmap) {
|
|
|
|
if (bitmap != mSoftwareBitmap)
|
|
|
|
return;
|
|
|
|
|
|
|
|
Canvas c = holder.lockCanvas();
|
|
|
|
if (c == null)
|
|
|
|
return;
|
|
|
|
c.drawBitmap(bitmap, 0, 0, null);
|
|
|
|
holder.unlockCanvasAndPost(c);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-06-03 01:55:28 +04:00
|
|
|
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
|
2011-08-22 20:57:12 +04:00
|
|
|
|
|
|
|
// Force exactly one frame to render
|
|
|
|
// because the surface change is only seen after we
|
|
|
|
// have swapped the back buffer.
|
|
|
|
// The buffer size only changes after the next swap buffer.
|
|
|
|
// We need to make sure the Gecko's view resize when Android's
|
|
|
|
// buffer resizes.
|
|
|
|
if (mDrawMode == DRAW_GLES_2) {
|
|
|
|
// When we get a surfaceChange event, we have 0 to n paint events
|
|
|
|
// waiting in the Gecko event queue. We will make the first
|
|
|
|
// succeed and the abort the others.
|
|
|
|
mDrawSingleFrame = true;
|
|
|
|
if (!mInDrawing) {
|
|
|
|
// Queue at least one paint event in case none are queued.
|
|
|
|
GeckoAppShell.scheduleRedraw();
|
|
|
|
}
|
|
|
|
GeckoAppShell.geckoEventSync();
|
|
|
|
mDrawSingleFrame = false;
|
|
|
|
mAbortDraw = false;
|
|
|
|
}
|
|
|
|
|
2010-12-27 18:33:37 +03:00
|
|
|
if (mShowingSplashScreen)
|
|
|
|
drawSplashScreen(holder, width, height);
|
2011-08-22 20:57:12 +04:00
|
|
|
|
2010-06-03 01:55:28 +04:00
|
|
|
mSurfaceLock.lock();
|
|
|
|
|
|
|
|
try {
|
|
|
|
if (mInDrawing) {
|
2011-08-19 06:27:41 +04:00
|
|
|
Log.w(LOG_FILE_NAME, "surfaceChanged while mInDrawing is true!");
|
2010-06-03 01:55:28 +04:00
|
|
|
}
|
|
|
|
|
2011-06-26 08:35:52 +04:00
|
|
|
boolean invalidSize;
|
|
|
|
|
2011-06-16 13:03:00 +04:00
|
|
|
if (width == 0 || height == 0) {
|
|
|
|
mSoftwareBitmap = null;
|
2010-06-29 10:42:28 +04:00
|
|
|
mSoftwareBuffer = null;
|
2011-06-16 13:03:00 +04:00
|
|
|
mSoftwareBufferCopy = null;
|
2011-06-26 08:35:52 +04:00
|
|
|
invalidSize = true;
|
|
|
|
} else {
|
|
|
|
invalidSize = false;
|
2011-06-16 13:03:00 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
boolean doSyncDraw =
|
|
|
|
mDrawMode == DRAW_2D &&
|
2011-06-26 08:35:52 +04:00
|
|
|
!invalidSize &&
|
2010-11-25 01:51:41 +03:00
|
|
|
GeckoApp.checkLaunchState(GeckoApp.LaunchState.GeckoRunning);
|
2010-11-09 05:11:13 +03:00
|
|
|
mSyncDraw = doSyncDraw;
|
2010-06-29 10:42:28 +04:00
|
|
|
|
2010-06-03 01:55:28 +04:00
|
|
|
mFormat = format;
|
|
|
|
mWidth = width;
|
|
|
|
mHeight = height;
|
|
|
|
mSurfaceValid = true;
|
|
|
|
|
2011-08-19 06:27:41 +04:00
|
|
|
Log.i(LOG_FILE_NAME, "surfaceChanged: fmt: " + format + " dim: " + width + " " + height);
|
2010-06-03 01:55:28 +04:00
|
|
|
|
2011-01-14 23:36:19 +03:00
|
|
|
DisplayMetrics metrics = new DisplayMetrics();
|
|
|
|
GeckoApp.mAppContext.getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
|
|
|
|
|
|
|
GeckoEvent e = new GeckoEvent(GeckoEvent.SIZE_CHANGED, width, height,
|
|
|
|
metrics.widthPixels, metrics.heightPixels);
|
2010-06-03 01:55:28 +04:00
|
|
|
GeckoAppShell.sendEventToGecko(e);
|
|
|
|
|
2010-11-11 06:34:27 +03:00
|
|
|
if (!doSyncDraw) {
|
2010-12-27 18:33:37 +03:00
|
|
|
if (mDrawMode == DRAW_GLES_2 || mShowingSplashScreen)
|
2010-12-03 04:23:41 +03:00
|
|
|
return;
|
2010-11-11 06:34:27 +03:00
|
|
|
Canvas c = holder.lockCanvas();
|
|
|
|
c.drawARGB(255, 255, 255, 255);
|
|
|
|
holder.unlockCanvasAndPost(c);
|
2010-11-09 05:11:13 +03:00
|
|
|
return;
|
2011-06-26 08:35:52 +04:00
|
|
|
} else {
|
|
|
|
GeckoAppShell.scheduleRedraw();
|
2010-11-11 06:34:27 +03:00
|
|
|
}
|
2010-06-03 01:55:28 +04:00
|
|
|
} finally {
|
|
|
|
mSurfaceLock.unlock();
|
2011-08-22 20:57:12 +04:00
|
|
|
if (mDrawMode == DRAW_GLES_2) {
|
|
|
|
// Force a frame to be drawn before the surfaceChange returns,
|
|
|
|
// otherwise we get artifacts.
|
|
|
|
GeckoAppShell.scheduleRedraw();
|
|
|
|
GeckoAppShell.geckoEventSync();
|
|
|
|
}
|
2010-06-03 01:55:28 +04:00
|
|
|
}
|
2010-11-09 05:11:13 +03:00
|
|
|
|
2011-06-16 13:03:00 +04:00
|
|
|
Object syncDrawObject = null;
|
2010-11-09 05:11:13 +03:00
|
|
|
try {
|
2011-06-26 08:35:52 +04:00
|
|
|
syncDrawObject = mSyncDraws.take();
|
2010-11-09 05:11:13 +03:00
|
|
|
} catch (InterruptedException ie) {
|
2011-08-19 06:27:41 +04:00
|
|
|
Log.e(LOG_FILE_NAME, "Threw exception while getting sync draw bitmap/buffer: ", ie);
|
2010-11-09 05:11:13 +03:00
|
|
|
}
|
2011-06-16 13:03:00 +04:00
|
|
|
if (syncDrawObject != null) {
|
|
|
|
if (syncDrawObject instanceof Bitmap)
|
|
|
|
draw(holder, (Bitmap)syncDrawObject);
|
|
|
|
else
|
|
|
|
draw(holder, (ByteBuffer)syncDrawObject);
|
2011-06-26 08:35:52 +04:00
|
|
|
} else {
|
|
|
|
Log.e("GeckoSurfaceViewJava", "Synchronised draw object is null");
|
2010-11-09 05:11:13 +03:00
|
|
|
}
|
2010-06-03 01:55:28 +04:00
|
|
|
}
|
2010-08-28 00:22:57 +04:00
|
|
|
|
2010-06-03 01:55:28 +04:00
|
|
|
public void surfaceCreated(SurfaceHolder holder) {
|
2011-08-19 06:27:41 +04:00
|
|
|
Log.i(LOG_FILE_NAME, "surface created");
|
2010-12-14 01:37:25 +03:00
|
|
|
GeckoEvent e = new GeckoEvent(GeckoEvent.SURFACE_CREATED);
|
|
|
|
GeckoAppShell.sendEventToGecko(e);
|
2011-01-11 08:48:35 +03:00
|
|
|
if (mShowingSplashScreen)
|
|
|
|
drawSplashScreen();
|
2010-06-03 01:55:28 +04:00
|
|
|
}
|
2010-08-28 00:22:57 +04:00
|
|
|
|
2010-06-03 01:55:28 +04:00
|
|
|
public void surfaceDestroyed(SurfaceHolder holder) {
|
2011-08-19 06:27:41 +04:00
|
|
|
Log.i(LOG_FILE_NAME, "surface destroyed");
|
2010-06-03 01:55:28 +04:00
|
|
|
mSurfaceValid = false;
|
2010-06-29 10:42:28 +04:00
|
|
|
mSoftwareBuffer = null;
|
2011-06-16 13:03:00 +04:00
|
|
|
mSoftwareBufferCopy = null;
|
|
|
|
mSoftwareBitmap = null;
|
2010-12-14 01:37:25 +03:00
|
|
|
GeckoEvent e = new GeckoEvent(GeckoEvent.SURFACE_DESTROYED);
|
2011-08-24 00:52:03 +04:00
|
|
|
if (mDrawMode == DRAW_GLES_2) {
|
|
|
|
// Ensure GL cleanup occurs before we return.
|
|
|
|
GeckoAppShell.sendEventToGeckoSync(e);
|
|
|
|
} else {
|
|
|
|
GeckoAppShell.sendEventToGecko(e);
|
|
|
|
}
|
2010-06-03 01:55:28 +04:00
|
|
|
}
|
|
|
|
|
2011-06-16 13:03:00 +04:00
|
|
|
public Bitmap getSoftwareDrawBitmap() {
|
|
|
|
if (mSoftwareBitmap == null ||
|
|
|
|
mSoftwareBitmap.getHeight() != mHeight ||
|
|
|
|
mSoftwareBitmap.getWidth() != mWidth) {
|
|
|
|
mSoftwareBitmap = Bitmap.createBitmap(mWidth, mHeight, Bitmap.Config.RGB_565);
|
|
|
|
}
|
|
|
|
|
|
|
|
mDrawMode = DRAW_2D;
|
|
|
|
return mSoftwareBitmap;
|
|
|
|
}
|
|
|
|
|
2010-06-03 01:55:28 +04:00
|
|
|
public ByteBuffer getSoftwareDrawBuffer() {
|
2011-06-16 13:03:00 +04:00
|
|
|
// We store pixels in 565 format, so two bytes per pixel (explaining
|
|
|
|
// the * 2 in the following check/allocation)
|
|
|
|
if (mSoftwareBuffer == null ||
|
|
|
|
mSoftwareBuffer.capacity() != (mWidth * mHeight * 2)) {
|
|
|
|
mSoftwareBuffer = ByteBuffer.allocateDirect(mWidth * mHeight * 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mSoftwareBufferCopy == null ||
|
|
|
|
mSoftwareBufferCopy.getHeight() != mHeight ||
|
|
|
|
mSoftwareBufferCopy.getWidth() != mWidth) {
|
|
|
|
mSoftwareBufferCopy = Bitmap.createBitmap(mWidth, mHeight, Bitmap.Config.RGB_565);
|
|
|
|
}
|
|
|
|
|
2010-12-03 04:23:41 +03:00
|
|
|
mDrawMode = DRAW_2D;
|
2010-06-03 01:55:28 +04:00
|
|
|
return mSoftwareBuffer;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Called on Gecko thread
|
|
|
|
*/
|
|
|
|
|
|
|
|
public static final int DRAW_ERROR = 0;
|
|
|
|
public static final int DRAW_GLES_2 = 1;
|
2010-12-03 04:23:41 +03:00
|
|
|
public static final int DRAW_2D = 2;
|
2011-08-22 20:57:12 +04:00
|
|
|
// Drawing is disable when the surface buffer
|
|
|
|
// has changed size but we haven't yet processed the
|
|
|
|
// resize event.
|
|
|
|
public static final int DRAW_DISABLED = 3;
|
2010-06-03 01:55:28 +04:00
|
|
|
|
|
|
|
public int beginDrawing() {
|
|
|
|
if (mInDrawing) {
|
2011-08-19 06:27:41 +04:00
|
|
|
Log.e(LOG_FILE_NAME, "Recursive beginDrawing call!");
|
2010-06-03 01:55:28 +04:00
|
|
|
return DRAW_ERROR;
|
|
|
|
}
|
|
|
|
|
2011-08-22 20:57:12 +04:00
|
|
|
// Once we drawn our first frame after resize we can ignore
|
|
|
|
// the other draw events until we handle the resize events.
|
|
|
|
if (mAbortDraw) {
|
|
|
|
return DRAW_DISABLED;
|
|
|
|
}
|
|
|
|
|
2010-06-03 01:55:28 +04:00
|
|
|
/* Grab the lock, which we'll hold while we're drawing.
|
|
|
|
* It gets released in endDrawing(), and is also used in surfaceChanged
|
|
|
|
* to make sure that we don't change our surface details while
|
|
|
|
* we're in the middle of drawing (and especially in the middle of
|
|
|
|
* executing beginDrawing/endDrawing).
|
|
|
|
*
|
|
|
|
* We might not need to hold this lock in between
|
|
|
|
* beginDrawing/endDrawing, and might just be able to make
|
|
|
|
* surfaceChanged, beginDrawing, and endDrawing synchronized,
|
|
|
|
* but this way is safer for now.
|
|
|
|
*/
|
|
|
|
mSurfaceLock.lock();
|
|
|
|
|
|
|
|
if (!mSurfaceValid) {
|
2011-08-19 06:27:41 +04:00
|
|
|
Log.e(LOG_FILE_NAME, "Surface not valid");
|
2010-06-03 01:55:28 +04:00
|
|
|
mSurfaceLock.unlock();
|
|
|
|
return DRAW_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
mInDrawing = true;
|
2010-12-03 04:23:41 +03:00
|
|
|
mDrawMode = DRAW_GLES_2;
|
2010-06-29 10:42:28 +04:00
|
|
|
return DRAW_GLES_2;
|
2010-06-03 01:55:28 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
public void endDrawing() {
|
|
|
|
if (!mInDrawing) {
|
2011-08-19 06:27:41 +04:00
|
|
|
Log.e(LOG_FILE_NAME, "endDrawing without beginDrawing!");
|
2010-06-03 01:55:28 +04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-08-22 20:57:12 +04:00
|
|
|
if (mDrawSingleFrame)
|
|
|
|
mAbortDraw = true;
|
|
|
|
|
2010-06-03 01:55:28 +04:00
|
|
|
try {
|
|
|
|
if (!mSurfaceValid) {
|
2011-08-19 06:27:41 +04:00
|
|
|
Log.e(LOG_FILE_NAME, "endDrawing with false mSurfaceValid");
|
2010-06-03 01:55:28 +04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
} finally {
|
|
|
|
mInDrawing = false;
|
|
|
|
|
|
|
|
if (!mSurfaceLock.isHeldByCurrentThread())
|
2011-08-19 06:27:41 +04:00
|
|
|
Log.e(LOG_FILE_NAME, "endDrawing while mSurfaceLock not held by current thread!");
|
2010-06-03 01:55:28 +04:00
|
|
|
|
|
|
|
mSurfaceLock.unlock();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-11-11 06:34:27 +03:00
|
|
|
/* How this works:
|
|
|
|
* Whenever we want to draw, we want to be sure that we do not lock
|
|
|
|
* the canvas unless we're sure we can draw. Locking the canvas clears
|
|
|
|
* the canvas to black in most cases, causing a black flash.
|
|
|
|
* At the same time, the surface can resize/disappear at any moment
|
|
|
|
* unless the canvas is locked.
|
|
|
|
* Draws originate from a different thread so the surface could change
|
|
|
|
* at any moment while we try to draw until we lock the canvas.
|
|
|
|
*
|
|
|
|
* Also, never try to lock the canvas while holding the surface lock
|
|
|
|
* unless you're in SurfaceChanged, in which case the canvas was already
|
|
|
|
* locked. Surface lock -> Canvas lock will lead to AB-BA deadlocks.
|
|
|
|
*/
|
2011-06-16 13:03:00 +04:00
|
|
|
public void draw2D(Bitmap bitmap, int width, int height) {
|
|
|
|
// mSurfaceLock ensures that we get mSyncDraw/mSoftwareBitmap/etc.
|
2010-11-11 06:34:27 +03:00
|
|
|
// set correctly before determining whether we should do a sync draw
|
|
|
|
mSurfaceLock.lock();
|
|
|
|
try {
|
|
|
|
if (mSyncDraw) {
|
2011-06-16 13:03:00 +04:00
|
|
|
if (bitmap != mSoftwareBitmap || width != mWidth || height != mHeight)
|
2010-11-11 06:34:27 +03:00
|
|
|
return;
|
|
|
|
mSyncDraw = false;
|
|
|
|
try {
|
2011-06-16 13:03:00 +04:00
|
|
|
mSyncDraws.put(bitmap);
|
2010-11-11 06:34:27 +03:00
|
|
|
} catch (InterruptedException ie) {
|
2011-08-19 06:27:41 +04:00
|
|
|
Log.e(LOG_FILE_NAME, "Threw exception while getting sync draws queue: ", ie);
|
2010-11-11 06:34:27 +03:00
|
|
|
}
|
2010-11-09 05:11:13 +03:00
|
|
|
return;
|
|
|
|
}
|
2010-11-11 06:34:27 +03:00
|
|
|
} finally {
|
|
|
|
mSurfaceLock.unlock();
|
2010-11-09 05:11:13 +03:00
|
|
|
}
|
|
|
|
|
2011-06-16 13:03:00 +04:00
|
|
|
draw(getHolder(), bitmap);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void draw2D(ByteBuffer buffer, int stride) {
|
|
|
|
mSurfaceLock.lock();
|
|
|
|
try {
|
|
|
|
if (mSyncDraw) {
|
|
|
|
if (buffer != mSoftwareBuffer || stride != (mWidth * 2))
|
|
|
|
return;
|
|
|
|
mSyncDraw = false;
|
|
|
|
try {
|
|
|
|
mSyncDraws.put(buffer);
|
|
|
|
} catch (InterruptedException ie) {
|
2011-08-19 06:27:41 +04:00
|
|
|
Log.e(LOG_FILE_NAME, "Threw exception while getting sync bitmaps queue: ", ie);
|
2011-06-16 13:03:00 +04:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
} finally {
|
|
|
|
mSurfaceLock.unlock();
|
2010-06-29 10:42:28 +04:00
|
|
|
}
|
2011-06-16 13:03:00 +04:00
|
|
|
|
|
|
|
draw(getHolder(), buffer);
|
2010-06-29 10:42:28 +04:00
|
|
|
}
|
|
|
|
|
2010-06-03 01:55:28 +04:00
|
|
|
@Override
|
|
|
|
public boolean onCheckIsTextEditor () {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
|
2010-11-23 09:48:25 +03:00
|
|
|
outAttrs.inputType = InputType.TYPE_CLASS_TEXT;
|
2010-12-02 19:49:19 +03:00
|
|
|
outAttrs.imeOptions = EditorInfo.IME_ACTION_NONE;
|
2010-12-15 23:37:52 +03:00
|
|
|
outAttrs.actionLabel = null;
|
2010-11-23 09:56:37 +03:00
|
|
|
mKeyListener = TextKeyListener.getInstance();
|
2010-08-05 02:59:22 +04:00
|
|
|
|
|
|
|
if (mIMEState == IME_STATE_PASSWORD)
|
|
|
|
outAttrs.inputType |= InputType.TYPE_TEXT_VARIATION_PASSWORD;
|
2010-11-24 05:12:53 +03:00
|
|
|
else if (mIMETypeHint.equalsIgnoreCase("url"))
|
2010-11-23 09:48:25 +03:00
|
|
|
outAttrs.inputType |= InputType.TYPE_TEXT_VARIATION_URI;
|
2010-11-24 05:12:53 +03:00
|
|
|
else if (mIMETypeHint.equalsIgnoreCase("email"))
|
2010-11-23 09:48:25 +03:00
|
|
|
outAttrs.inputType |= InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS;
|
2010-11-24 05:12:53 +03:00
|
|
|
else if (mIMETypeHint.equalsIgnoreCase("search"))
|
2010-11-23 09:48:25 +03:00
|
|
|
outAttrs.imeOptions = EditorInfo.IME_ACTION_SEARCH;
|
2010-11-24 05:12:53 +03:00
|
|
|
else if (mIMETypeHint.equalsIgnoreCase("tel"))
|
2010-11-23 09:48:25 +03:00
|
|
|
outAttrs.inputType = InputType.TYPE_CLASS_PHONE;
|
2010-11-24 05:12:53 +03:00
|
|
|
else if (mIMETypeHint.equalsIgnoreCase("number") ||
|
|
|
|
mIMETypeHint.equalsIgnoreCase("range"))
|
2010-11-23 09:48:25 +03:00
|
|
|
outAttrs.inputType = InputType.TYPE_CLASS_NUMBER;
|
2010-11-24 05:12:53 +03:00
|
|
|
else if (mIMETypeHint.equalsIgnoreCase("datetime") ||
|
|
|
|
mIMETypeHint.equalsIgnoreCase("datetime-local"))
|
2010-11-23 09:48:25 +03:00
|
|
|
outAttrs.inputType = InputType.TYPE_CLASS_DATETIME |
|
|
|
|
InputType.TYPE_DATETIME_VARIATION_NORMAL;
|
2010-11-24 05:12:53 +03:00
|
|
|
else if (mIMETypeHint.equalsIgnoreCase("date"))
|
2010-11-23 09:48:25 +03:00
|
|
|
outAttrs.inputType = InputType.TYPE_CLASS_DATETIME |
|
|
|
|
InputType.TYPE_DATETIME_VARIATION_DATE;
|
2010-11-24 05:12:53 +03:00
|
|
|
else if (mIMETypeHint.equalsIgnoreCase("time"))
|
2010-11-23 09:48:25 +03:00
|
|
|
outAttrs.inputType = InputType.TYPE_CLASS_DATETIME |
|
|
|
|
InputType.TYPE_DATETIME_VARIATION_TIME;
|
2010-08-21 04:07:26 +04:00
|
|
|
|
2010-11-24 05:12:53 +03:00
|
|
|
if (mIMEActionHint.equalsIgnoreCase("go"))
|
|
|
|
outAttrs.imeOptions = EditorInfo.IME_ACTION_GO;
|
|
|
|
else if (mIMEActionHint.equalsIgnoreCase("done"))
|
|
|
|
outAttrs.imeOptions = EditorInfo.IME_ACTION_DONE;
|
|
|
|
else if (mIMEActionHint.equalsIgnoreCase("next"))
|
|
|
|
outAttrs.imeOptions = EditorInfo.IME_ACTION_NEXT;
|
|
|
|
else if (mIMEActionHint.equalsIgnoreCase("search"))
|
|
|
|
outAttrs.imeOptions = EditorInfo.IME_ACTION_SEARCH;
|
|
|
|
else if (mIMEActionHint.equalsIgnoreCase("send"))
|
|
|
|
outAttrs.imeOptions = EditorInfo.IME_ACTION_SEND;
|
2010-12-15 23:37:52 +03:00
|
|
|
else if (mIMEActionHint != null && mIMEActionHint.length() != 0)
|
2010-11-24 05:12:53 +03:00
|
|
|
outAttrs.actionLabel = mIMEActionHint;
|
2011-04-12 00:41:03 +04:00
|
|
|
|
|
|
|
if (mIMELandscapeFS == false)
|
|
|
|
outAttrs.imeOptions |= EditorInfo.IME_FLAG_NO_EXTRACT_UI;
|
|
|
|
|
2010-08-21 04:07:26 +04:00
|
|
|
inputConnection.reset();
|
2010-06-03 01:55:28 +04:00
|
|
|
return inputConnection;
|
|
|
|
}
|
|
|
|
|
2011-01-07 04:15:24 +03:00
|
|
|
public void setEditable(String contents)
|
|
|
|
{
|
|
|
|
mEditable.removeSpan(inputConnection);
|
|
|
|
mEditable.replace(0, mEditable.length(), contents);
|
|
|
|
mEditable.setSpan(inputConnection, 0, contents.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
|
|
|
|
Selection.setSelection(mEditable, contents.length());
|
|
|
|
}
|
|
|
|
|
|
|
|
public void initEditable(String contents)
|
2010-11-23 09:56:37 +03:00
|
|
|
{
|
|
|
|
mEditable = mEditableFactory.newEditable(contents);
|
|
|
|
mEditable.setSpan(inputConnection, 0, contents.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
|
|
|
|
Selection.setSelection(mEditable, contents.length());
|
|
|
|
}
|
|
|
|
|
2010-06-05 01:14:43 +04:00
|
|
|
// accelerometer
|
2010-06-03 01:55:28 +04:00
|
|
|
public void onAccuracyChanged(Sensor sensor, int accuracy)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public void onSensorChanged(SensorEvent event)
|
|
|
|
{
|
|
|
|
GeckoAppShell.sendEventToGecko(new GeckoEvent(event));
|
|
|
|
}
|
|
|
|
|
2011-03-17 10:03:11 +03:00
|
|
|
private class GeocoderTask extends AsyncTask<Location, Void, Void> {
|
|
|
|
protected Void doInBackground(Location... location) {
|
|
|
|
try {
|
|
|
|
List<Address> addresses = mGeocoder.getFromLocation(location[0].getLatitude(),
|
|
|
|
location[0].getLongitude(), 1);
|
|
|
|
// grab the first address. in the future,
|
|
|
|
// may want to expose multiple, or filter
|
|
|
|
// for best.
|
|
|
|
mLastGeoAddress = addresses.get(0);
|
2011-03-31 08:13:35 +04:00
|
|
|
GeckoAppShell.sendEventToGecko(new GeckoEvent(location[0], mLastGeoAddress));
|
2011-03-17 10:03:11 +03:00
|
|
|
} catch (Exception e) {
|
2011-08-19 06:27:41 +04:00
|
|
|
Log.w(LOG_FILE_NAME, "GeocoderTask "+e);
|
2011-03-17 10:03:11 +03:00
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-06-05 01:14:43 +04:00
|
|
|
// geolocation
|
|
|
|
public void onLocationChanged(Location location)
|
|
|
|
{
|
2011-03-17 10:03:11 +03:00
|
|
|
if (mGeocoder == null)
|
2011-03-31 08:13:35 +04:00
|
|
|
mGeocoder = new Geocoder(getContext(), Locale.getDefault());
|
2011-03-17 10:03:11 +03:00
|
|
|
|
|
|
|
if (mLastGeoAddress == null) {
|
|
|
|
new GeocoderTask().execute(location);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
float[] results = new float[1];
|
|
|
|
Location.distanceBetween(location.getLatitude(),
|
|
|
|
location.getLongitude(),
|
|
|
|
mLastGeoAddress.getLatitude(),
|
|
|
|
mLastGeoAddress.getLongitude(),
|
|
|
|
results);
|
|
|
|
// pfm value. don't want to slam the
|
|
|
|
// geocoder with very similar values, so
|
|
|
|
// only call after about 100m
|
2011-03-31 08:13:35 +04:00
|
|
|
if (results[0] > 100)
|
2011-03-17 10:03:11 +03:00
|
|
|
new GeocoderTask().execute(location);
|
|
|
|
}
|
|
|
|
|
|
|
|
GeckoAppShell.sendEventToGecko(new GeckoEvent(location, mLastGeoAddress));
|
2010-06-05 01:14:43 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
public void onProviderDisabled(String provider)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public void onProviderEnabled(String provider)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public void onStatusChanged(String provider, int status, Bundle extras)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2010-06-03 01:55:28 +04:00
|
|
|
// event stuff
|
|
|
|
public boolean onTouchEvent(MotionEvent event) {
|
|
|
|
GeckoAppShell.sendEventToGecko(new GeckoEvent(event));
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2010-12-15 23:37:54 +03:00
|
|
|
@Override
|
|
|
|
public boolean onKeyPreIme(int keyCode, KeyEvent event) {
|
2011-01-26 21:52:41 +03:00
|
|
|
if (event.isSystem())
|
2010-12-15 23:37:54 +03:00
|
|
|
return super.onKeyPreIme(keyCode, event);
|
|
|
|
|
|
|
|
switch (event.getAction()) {
|
|
|
|
case KeyEvent.ACTION_DOWN:
|
2011-09-03 18:14:38 +04:00
|
|
|
return processKeyDown(keyCode, event, true);
|
2010-12-15 23:37:54 +03:00
|
|
|
case KeyEvent.ACTION_UP:
|
2011-09-03 18:14:38 +04:00
|
|
|
return processKeyUp(keyCode, event, true);
|
2010-12-15 23:37:54 +03:00
|
|
|
case KeyEvent.ACTION_MULTIPLE:
|
|
|
|
return onKeyMultiple(keyCode, event.getRepeatCount(), event);
|
|
|
|
}
|
|
|
|
return super.onKeyPreIme(keyCode, event);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
2011-09-03 18:14:38 +04:00
|
|
|
return processKeyDown(keyCode, event, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
private boolean processKeyDown(int keyCode, KeyEvent event, boolean isPreIme) {
|
2010-12-15 23:37:54 +03:00
|
|
|
switch (keyCode) {
|
|
|
|
case KeyEvent.KEYCODE_BACK:
|
|
|
|
if (event.getRepeatCount() == 0) {
|
|
|
|
event.startTracking();
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
case KeyEvent.KEYCODE_MENU:
|
|
|
|
if (event.getRepeatCount() == 0) {
|
|
|
|
event.startTracking();
|
|
|
|
break;
|
|
|
|
} else if ((event.getFlags() & KeyEvent.FLAG_LONG_PRESS) != 0) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
// Ignore repeats for KEYCODE_MENU; they confuse the widget code.
|
|
|
|
return false;
|
|
|
|
case KeyEvent.KEYCODE_VOLUME_UP:
|
|
|
|
case KeyEvent.KEYCODE_VOLUME_DOWN:
|
|
|
|
case KeyEvent.KEYCODE_SEARCH:
|
|
|
|
return false;
|
|
|
|
case KeyEvent.KEYCODE_DEL:
|
|
|
|
// See comments in GeckoInputConnection.onKeyDel
|
|
|
|
if (inputConnection != null &&
|
|
|
|
inputConnection.onKeyDel()) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case KeyEvent.KEYCODE_ENTER:
|
|
|
|
if ((event.getFlags() & KeyEvent.FLAG_EDITOR_ACTION) != 0 &&
|
|
|
|
mIMEActionHint.equalsIgnoreCase("next"))
|
|
|
|
event = new KeyEvent(event.getAction(), KeyEvent.KEYCODE_TAB);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2011-09-03 18:14:38 +04:00
|
|
|
|
|
|
|
if (isPreIme && mIMEState != IME_STATE_DISABLED)
|
|
|
|
// Let active IME process pre-IME key events
|
|
|
|
return false;
|
|
|
|
|
2010-12-15 23:37:54 +03:00
|
|
|
// KeyListener returns true if it handled the event for us.
|
|
|
|
if (mIMEState == IME_STATE_DISABLED ||
|
|
|
|
keyCode == KeyEvent.KEYCODE_ENTER ||
|
2011-08-09 09:17:44 +04:00
|
|
|
keyCode == KeyEvent.KEYCODE_DEL ||
|
2011-03-08 21:39:56 +03:00
|
|
|
(event.getFlags() & KeyEvent.FLAG_SOFT_KEYBOARD) != 0 ||
|
2010-12-15 23:37:54 +03:00
|
|
|
!mKeyListener.onKeyDown(this, mEditable, keyCode, event))
|
|
|
|
GeckoAppShell.sendEventToGecko(new GeckoEvent(event));
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
2011-09-03 18:14:38 +04:00
|
|
|
return processKeyUp(keyCode, event, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
private boolean processKeyUp(int keyCode, KeyEvent event, boolean isPreIme) {
|
2010-12-15 23:37:54 +03:00
|
|
|
switch (keyCode) {
|
|
|
|
case KeyEvent.KEYCODE_BACK:
|
|
|
|
if (!event.isTracking() || event.isCanceled())
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2011-09-03 18:14:38 +04:00
|
|
|
|
|
|
|
if (isPreIme && mIMEState != IME_STATE_DISABLED)
|
|
|
|
// Let active IME process pre-IME key events
|
|
|
|
return false;
|
|
|
|
|
2010-12-15 23:37:54 +03:00
|
|
|
if (mIMEState == IME_STATE_DISABLED ||
|
|
|
|
keyCode == KeyEvent.KEYCODE_ENTER ||
|
2011-08-09 09:17:44 +04:00
|
|
|
keyCode == KeyEvent.KEYCODE_DEL ||
|
2011-03-08 21:39:56 +03:00
|
|
|
(event.getFlags() & KeyEvent.FLAG_SOFT_KEYBOARD) != 0 ||
|
2010-12-15 23:37:54 +03:00
|
|
|
!mKeyListener.onKeyUp(this, mEditable, keyCode, event))
|
|
|
|
GeckoAppShell.sendEventToGecko(new GeckoEvent(event));
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean onKeyMultiple(int keyCode, int repeatCount, KeyEvent event) {
|
|
|
|
GeckoAppShell.sendEventToGecko(new GeckoEvent(event));
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean onKeyLongPress(int keyCode, KeyEvent event) {
|
|
|
|
switch (keyCode) {
|
|
|
|
case KeyEvent.KEYCODE_BACK:
|
|
|
|
GeckoAppShell.sendEventToGecko(new GeckoEvent(event));
|
|
|
|
return true;
|
|
|
|
case KeyEvent.KEYCODE_MENU:
|
|
|
|
InputMethodManager imm = (InputMethodManager)
|
|
|
|
getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
|
|
|
imm.toggleSoftInputFromWindow(getWindowToken(),
|
|
|
|
imm.SHOW_FORCED, 0);
|
|
|
|
return true;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2010-06-03 01:55:28 +04:00
|
|
|
// Is this surface valid for drawing into?
|
|
|
|
boolean mSurfaceValid;
|
|
|
|
|
|
|
|
// Are we actively between beginDrawing/endDrawing?
|
|
|
|
boolean mInDrawing;
|
|
|
|
|
2011-08-22 20:57:12 +04:00
|
|
|
// Used to finish the current buffer before changing the surface size
|
|
|
|
boolean mDrawSingleFrame = false;
|
|
|
|
boolean mAbortDraw = false;
|
|
|
|
|
2010-11-09 05:11:13 +03:00
|
|
|
// Are we waiting for a buffer to draw in surfaceChanged?
|
|
|
|
boolean mSyncDraw;
|
|
|
|
|
|
|
|
// True if gecko requests a buffer
|
2010-12-03 04:23:41 +03:00
|
|
|
int mDrawMode;
|
2010-11-09 05:11:13 +03:00
|
|
|
|
2010-12-27 18:33:37 +03:00
|
|
|
static boolean mShowingSplashScreen = true;
|
2011-01-11 08:48:35 +03:00
|
|
|
static String mSplashStatusMsg = "";
|
2010-12-27 18:33:37 +03:00
|
|
|
|
2010-06-03 01:55:28 +04:00
|
|
|
// let's not change stuff around while we're in the middle of
|
|
|
|
// starting drawing, ending drawing, or changing surface
|
|
|
|
// characteristics
|
|
|
|
ReentrantLock mSurfaceLock;
|
|
|
|
|
|
|
|
// Surface format, from surfaceChanged. Largely
|
|
|
|
// useless.
|
|
|
|
int mFormat;
|
|
|
|
|
|
|
|
// the dimensions of the surface
|
|
|
|
int mWidth;
|
|
|
|
int mHeight;
|
|
|
|
|
|
|
|
// the dimensions of the buffer we're using for drawing,
|
|
|
|
// that is the software buffer or the EGLSurface
|
|
|
|
int mBufferWidth;
|
|
|
|
int mBufferHeight;
|
|
|
|
|
|
|
|
// IME stuff
|
2010-08-05 02:59:22 +04:00
|
|
|
public static final int IME_STATE_DISABLED = 0;
|
|
|
|
public static final int IME_STATE_ENABLED = 1;
|
|
|
|
public static final int IME_STATE_PASSWORD = 2;
|
2011-04-20 16:47:40 +04:00
|
|
|
public static final int IME_STATE_PLUGIN = 3;
|
2010-08-05 02:59:22 +04:00
|
|
|
|
2010-06-03 01:55:28 +04:00
|
|
|
GeckoInputConnection inputConnection;
|
2010-11-23 09:56:37 +03:00
|
|
|
KeyListener mKeyListener;
|
|
|
|
Editable mEditable;
|
|
|
|
Editable.Factory mEditableFactory;
|
2010-06-03 01:55:28 +04:00
|
|
|
int mIMEState;
|
2010-11-24 05:12:53 +03:00
|
|
|
String mIMETypeHint;
|
|
|
|
String mIMEActionHint;
|
2011-04-12 00:41:03 +04:00
|
|
|
boolean mIMELandscapeFS;
|
2010-06-03 01:55:28 +04:00
|
|
|
|
|
|
|
// Software rendering
|
|
|
|
Bitmap mSoftwareBitmap;
|
2011-06-16 13:03:00 +04:00
|
|
|
ByteBuffer mSoftwareBuffer;
|
|
|
|
Bitmap mSoftwareBufferCopy;
|
2010-11-09 05:11:13 +03:00
|
|
|
|
2011-03-17 10:03:11 +03:00
|
|
|
Geocoder mGeocoder;
|
|
|
|
Address mLastGeoAddress;
|
|
|
|
|
2011-06-16 13:03:00 +04:00
|
|
|
final SynchronousQueue<Object> mSyncDraws = new SynchronousQueue<Object>();
|
2010-06-03 01:55:28 +04:00
|
|
|
}
|
2010-11-23 09:56:37 +03:00
|
|
|
|