зеркало из 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
|
||||
// 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 onResume();
|
||||
public static native void onLowMemory();
|
||||
|
@ -471,8 +471,7 @@ public class GeckoAppShell
|
|||
Log.i(LOGTAG, "post native init");
|
||||
|
||||
// Tell Gecko where the target byte buffer is for rendering
|
||||
GeckoAppShell.setLayerClient(GeckoApp.mAppContext.getLayerClient(),
|
||||
GeckoApp.mAppContext.getLayerClient().getType());
|
||||
GeckoAppShell.setLayerClient(GeckoApp.mAppContext.getLayerClient());
|
||||
|
||||
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) {
|
||||
Log.e(LOGTAG, "### dimensionsChanged " + newOrigin + " " + newResolution);
|
||||
}
|
||||
|
|
|
@ -60,9 +60,6 @@ import java.util.regex.Pattern;
|
|||
public abstract class GeckoLayerClient extends LayerClient implements GeckoEventListener {
|
||||
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 mBufferSize;
|
||||
|
||||
|
@ -100,7 +97,6 @@ public abstract class GeckoLayerClient extends LayerClient implements GeckoEvent
|
|||
protected abstract IntSize getTileSize();
|
||||
protected abstract void tileLayerUpdated();
|
||||
public abstract Bitmap getBitmap();
|
||||
public abstract int getType();
|
||||
|
||||
public GeckoLayerClient(Context context) {
|
||||
mScreenSize = new IntSize(0, 0);
|
||||
|
|
|
@ -988,20 +988,11 @@ AndroidBridge::SetSurfaceView(jobject obj)
|
|||
}
|
||||
|
||||
void
|
||||
AndroidBridge::SetLayerClient(jobject obj, jint type)
|
||||
AndroidBridge::SetLayerClient(jobject obj)
|
||||
{
|
||||
switch (type) {
|
||||
case LAYER_CLIENT_TYPE_GL: {
|
||||
AndroidGeckoGLLayerClient *client = new AndroidGeckoGLLayerClient();
|
||||
client->Init(obj);
|
||||
mLayerClient = client;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
NS_ASSERTION(0, "Unknown layer client type!");
|
||||
}
|
||||
|
||||
mLayerClientType = type;
|
||||
AndroidGeckoGLLayerClient *client = new AndroidGeckoGLLayerClient();
|
||||
client->Init(obj);
|
||||
mLayerClient = client;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1906,7 +1897,6 @@ AndroidBridge::GetViewTransform(nsIntPoint& aScrollOffset, float& aScaleX, float
|
|||
|
||||
AndroidBridge::AndroidBridge()
|
||||
: mLayerClient(NULL)
|
||||
, mLayerClientType(0)
|
||||
, mViewTransformGetter(NULL)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -189,8 +189,7 @@ public:
|
|||
|
||||
void ScheduleRestart();
|
||||
|
||||
void SetLayerClient(jobject jobj, jint type);
|
||||
int GetLayerClientType() const { return mLayerClientType; }
|
||||
void SetLayerClient(jobject jobj);
|
||||
AndroidGeckoLayerClient &GetLayerClient() { return *mLayerClient; }
|
||||
|
||||
void SetSurfaceView(jobject jobj);
|
||||
|
@ -432,7 +431,6 @@ protected:
|
|||
AndroidGeckoSurfaceView mSurfaceView;
|
||||
|
||||
AndroidGeckoLayerClient *mLayerClient;
|
||||
int mLayerClientType;
|
||||
|
||||
nsRefPtr<mozilla::layers::CompositorParent> mCompositorParent;
|
||||
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_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_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_onResume(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
|
||||
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
|
||||
|
|
|
@ -1299,8 +1299,6 @@ nsWindow::OnDraw(AndroidGeckoEvent *ae)
|
|||
return;
|
||||
}
|
||||
|
||||
int layerClientType = AndroidBridge::Bridge()->GetLayerClientType();
|
||||
|
||||
unsigned char *bits = NULL;
|
||||
if (HasDirectTexture()) {
|
||||
__android_log_print(ANDROID_LOG_ERROR, "Gecko", "### Have direct texture!");
|
||||
|
@ -1314,7 +1312,7 @@ nsWindow::OnDraw(AndroidGeckoEvent *ae)
|
|||
|
||||
if (targetSurface->CairoStatus()) {
|
||||
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()!");
|
||||
DrawTo(targetSurface, dirtyRect);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче