зеркало из https://github.com/mozilla/pjs.git
Also remove dangling entrails of the layer client type
This commit is contained in:
Родитель
22939b9e98
Коммит
28d84cf329
|
@ -124,7 +124,7 @@ public class GeckoAppShell
|
||||||
|
|
||||||
// helper methods
|
// helper methods
|
||||||
// public static native void setSurfaceView(GeckoSurfaceView sv);
|
// public static native void setSurfaceView(GeckoSurfaceView sv);
|
||||||
public static native void setLayerClient(GeckoLayerClient client, int type);
|
public static native void setLayerClient(GeckoLayerClient client);
|
||||||
public static native void putenv(String map);
|
public static native void putenv(String map);
|
||||||
public static native void onResume();
|
public static native void onResume();
|
||||||
public static native void onLowMemory();
|
public static native void onLowMemory();
|
||||||
|
@ -471,8 +471,7 @@ public class GeckoAppShell
|
||||||
Log.i(LOGTAG, "post native init");
|
Log.i(LOGTAG, "post native init");
|
||||||
|
|
||||||
// Tell Gecko where the target byte buffer is for rendering
|
// Tell Gecko where the target byte buffer is for rendering
|
||||||
GeckoAppShell.setLayerClient(GeckoApp.mAppContext.getLayerClient(),
|
GeckoAppShell.setLayerClient(GeckoApp.mAppContext.getLayerClient());
|
||||||
GeckoApp.mAppContext.getLayerClient().getType());
|
|
||||||
|
|
||||||
Log.i(LOGTAG, "setLayerClient called");
|
Log.i(LOGTAG, "setLayerClient called");
|
||||||
|
|
||||||
|
|
|
@ -151,12 +151,6 @@ public class GeckoGLLayerClient extends GeckoLayerClient
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getType() {
|
|
||||||
Log.e(LOGTAG, "### getType");
|
|
||||||
return LAYER_CLIENT_TYPE_GL;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void dimensionsChanged(Point newOrigin, float newResolution) {
|
public void dimensionsChanged(Point newOrigin, float newResolution) {
|
||||||
Log.e(LOGTAG, "### dimensionsChanged " + newOrigin + " " + newResolution);
|
Log.e(LOGTAG, "### dimensionsChanged " + newOrigin + " " + newResolution);
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,9 +60,6 @@ import java.util.regex.Pattern;
|
||||||
public abstract class GeckoLayerClient extends LayerClient implements GeckoEventListener {
|
public abstract class GeckoLayerClient extends LayerClient implements GeckoEventListener {
|
||||||
private static final String LOGTAG = "GeckoLayerClient";
|
private static final String LOGTAG = "GeckoLayerClient";
|
||||||
|
|
||||||
public static final int LAYER_CLIENT_TYPE_NONE = 0;
|
|
||||||
public static final int LAYER_CLIENT_TYPE_GL = 2;
|
|
||||||
|
|
||||||
protected IntSize mScreenSize;
|
protected IntSize mScreenSize;
|
||||||
protected IntSize mBufferSize;
|
protected IntSize mBufferSize;
|
||||||
|
|
||||||
|
@ -100,7 +97,6 @@ public abstract class GeckoLayerClient extends LayerClient implements GeckoEvent
|
||||||
protected abstract IntSize getTileSize();
|
protected abstract IntSize getTileSize();
|
||||||
protected abstract void tileLayerUpdated();
|
protected abstract void tileLayerUpdated();
|
||||||
public abstract Bitmap getBitmap();
|
public abstract Bitmap getBitmap();
|
||||||
public abstract int getType();
|
|
||||||
|
|
||||||
public GeckoLayerClient(Context context) {
|
public GeckoLayerClient(Context context) {
|
||||||
mScreenSize = new IntSize(0, 0);
|
mScreenSize = new IntSize(0, 0);
|
||||||
|
|
|
@ -988,20 +988,11 @@ AndroidBridge::SetSurfaceView(jobject obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AndroidBridge::SetLayerClient(jobject obj, jint type)
|
AndroidBridge::SetLayerClient(jobject obj)
|
||||||
{
|
{
|
||||||
switch (type) {
|
AndroidGeckoGLLayerClient *client = new AndroidGeckoGLLayerClient();
|
||||||
case LAYER_CLIENT_TYPE_GL: {
|
client->Init(obj);
|
||||||
AndroidGeckoGLLayerClient *client = new AndroidGeckoGLLayerClient();
|
mLayerClient = client;
|
||||||
client->Init(obj);
|
|
||||||
mLayerClient = client;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
NS_ASSERTION(0, "Unknown layer client type!");
|
|
||||||
}
|
|
||||||
|
|
||||||
mLayerClientType = type;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1906,7 +1897,6 @@ AndroidBridge::GetViewTransform(nsIntPoint& aScrollOffset, float& aScaleX, float
|
||||||
|
|
||||||
AndroidBridge::AndroidBridge()
|
AndroidBridge::AndroidBridge()
|
||||||
: mLayerClient(NULL)
|
: mLayerClient(NULL)
|
||||||
, mLayerClientType(0)
|
|
||||||
, mViewTransformGetter(NULL)
|
, mViewTransformGetter(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -189,8 +189,7 @@ public:
|
||||||
|
|
||||||
void ScheduleRestart();
|
void ScheduleRestart();
|
||||||
|
|
||||||
void SetLayerClient(jobject jobj, jint type);
|
void SetLayerClient(jobject jobj);
|
||||||
int GetLayerClientType() const { return mLayerClientType; }
|
|
||||||
AndroidGeckoLayerClient &GetLayerClient() { return *mLayerClient; }
|
AndroidGeckoLayerClient &GetLayerClient() { return *mLayerClient; }
|
||||||
|
|
||||||
void SetSurfaceView(jobject jobj);
|
void SetSurfaceView(jobject jobj);
|
||||||
|
@ -432,7 +431,6 @@ protected:
|
||||||
AndroidGeckoSurfaceView mSurfaceView;
|
AndroidGeckoSurfaceView mSurfaceView;
|
||||||
|
|
||||||
AndroidGeckoLayerClient *mLayerClient;
|
AndroidGeckoLayerClient *mLayerClient;
|
||||||
int mLayerClientType;
|
|
||||||
|
|
||||||
nsRefPtr<mozilla::layers::CompositorParent> mCompositorParent;
|
nsRefPtr<mozilla::layers::CompositorParent> mCompositorParent;
|
||||||
base::Thread *mCompositorThread;
|
base::Thread *mCompositorThread;
|
||||||
|
|
|
@ -79,7 +79,7 @@ extern "C" {
|
||||||
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_nativeInit(JNIEnv *, jclass);
|
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_nativeInit(JNIEnv *, jclass);
|
||||||
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_notifyGeckoOfEvent(JNIEnv *, jclass, jobject event);
|
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_notifyGeckoOfEvent(JNIEnv *, jclass, jobject event);
|
||||||
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_processNextNativeEvent(JNIEnv *, jclass);
|
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_processNextNativeEvent(JNIEnv *, jclass);
|
||||||
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_setLayerClient(JNIEnv *jenv, jclass, jobject sv, jint type);
|
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_setLayerClient(JNIEnv *jenv, jclass, jobject sv);
|
||||||
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_setSurfaceView(JNIEnv *jenv, jclass, jobject sv);
|
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_setSurfaceView(JNIEnv *jenv, jclass, jobject sv);
|
||||||
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_onResume(JNIEnv *, jclass);
|
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_onResume(JNIEnv *, jclass);
|
||||||
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_onLowMemory(JNIEnv *, jclass);
|
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_onLowMemory(JNIEnv *, jclass);
|
||||||
|
@ -147,9 +147,9 @@ Java_org_mozilla_gecko_GeckoAppShell_setSurfaceView(JNIEnv *jenv, jclass, jobjec
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_EXPORT void JNICALL
|
NS_EXPORT void JNICALL
|
||||||
Java_org_mozilla_gecko_GeckoAppShell_setLayerClient(JNIEnv *jenv, jclass, jobject obj, jint type)
|
Java_org_mozilla_gecko_GeckoAppShell_setLayerClient(JNIEnv *jenv, jclass, jobject obj)
|
||||||
{
|
{
|
||||||
AndroidBridge::Bridge()->SetLayerClient(jenv->NewGlobalRef(obj), type);
|
AndroidBridge::Bridge()->SetLayerClient(jenv->NewGlobalRef(obj));
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_EXPORT void JNICALL
|
NS_EXPORT void JNICALL
|
||||||
|
|
|
@ -1299,8 +1299,6 @@ nsWindow::OnDraw(AndroidGeckoEvent *ae)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int layerClientType = AndroidBridge::Bridge()->GetLayerClientType();
|
|
||||||
|
|
||||||
unsigned char *bits = NULL;
|
unsigned char *bits = NULL;
|
||||||
if (HasDirectTexture()) {
|
if (HasDirectTexture()) {
|
||||||
__android_log_print(ANDROID_LOG_ERROR, "Gecko", "### Have direct texture!");
|
__android_log_print(ANDROID_LOG_ERROR, "Gecko", "### Have direct texture!");
|
||||||
|
@ -1314,7 +1312,7 @@ nsWindow::OnDraw(AndroidGeckoEvent *ae)
|
||||||
|
|
||||||
if (targetSurface->CairoStatus()) {
|
if (targetSurface->CairoStatus()) {
|
||||||
ALOG("### Failed to create a valid surface from the bitmap");
|
ALOG("### Failed to create a valid surface from the bitmap");
|
||||||
} else if (bits || layerClientType == AndroidBridge::LAYER_CLIENT_TYPE_GL) {
|
} else {
|
||||||
__android_log_print(ANDROID_LOG_ERROR, "Gecko", "### Calling DrawTo()!");
|
__android_log_print(ANDROID_LOG_ERROR, "Gecko", "### Calling DrawTo()!");
|
||||||
DrawTo(targetSurface, dirtyRect);
|
DrawTo(targetSurface, dirtyRect);
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче