Backout 91eebc6bdb59 & 7d776b291014 (bug 717283) for Android native reftest crashes

This commit is contained in:
Ed Morley
2012-01-22 11:55:18 +00:00
parent 45256cb4c2
commit e54b557a28
11 changed files with 286 additions and 613 deletions

View File

@@ -107,7 +107,6 @@ jmethodID AndroidAddress::jGetThoroughfareMethod;
jclass AndroidGeckoSoftwareLayerClient::jGeckoSoftwareLayerClientClass = 0;
jmethodID AndroidGeckoSoftwareLayerClient::jLockBufferMethod = 0;
jmethodID AndroidGeckoSoftwareLayerClient::jUnlockBufferMethod = 0;
jmethodID AndroidGeckoSoftwareLayerClient::jGetRenderOffsetMethod = 0;
jmethodID AndroidGeckoSoftwareLayerClient::jBeginDrawingMethod = 0;
jmethodID AndroidGeckoSoftwareLayerClient::jEndDrawingMethod = 0;
jclass AndroidGeckoSurfaceView::jGeckoSurfaceViewClass = 0;
@@ -324,9 +323,8 @@ AndroidGeckoSoftwareLayerClient::InitGeckoSoftwareLayerClientClass(JNIEnv *jEnv)
jLockBufferMethod = getMethod("lockBuffer", "()Ljava/nio/ByteBuffer;");
jUnlockBufferMethod = getMethod("unlockBuffer", "()V");
jGetRenderOffsetMethod = getMethod("getRenderOffset", "()Landroid/graphics/Point;");
jBeginDrawingMethod = getMethod("beginDrawing", "(IILjava/lang/String;Z)Z");
jEndDrawingMethod = getMethod("endDrawing", "(IIII)V");
jBeginDrawingMethod = getMethod("beginDrawing", "(II)V");
jEndDrawingMethod = getMethod("endDrawing", "(IIIILjava/lang/String;Z)V");
#endif
}
@@ -620,28 +618,21 @@ AndroidGeckoSoftwareLayerClient::UnlockBuffer()
}
void
AndroidGeckoSoftwareLayerClient::GetRenderOffset(nsIntPoint &aOffset)
{
AndroidPoint offset(JNI(), JNI()->CallObjectMethod(wrapped_obj, jGetRenderOffsetMethod));
aOffset.x = offset.X();
aOffset.y = offset.Y();
}
bool
AndroidGeckoSoftwareLayerClient::BeginDrawing(int aWidth, int aHeight, const nsAString &aMetadata, bool aHasDirectTexture)
AndroidGeckoSoftwareLayerClient::BeginDrawing(int aWidth, int aHeight)
{
NS_ASSERTION(!isNull(), "BeginDrawing() called on null software layer client!");
AndroidBridge::AutoLocalJNIFrame(1);
jstring jMetadata = JNI()->NewString(nsPromiseFlatString(aMetadata).get(), aMetadata.Length());
return JNI()->CallBooleanMethod(wrapped_obj, jBeginDrawingMethod, aWidth, aHeight, jMetadata, aHasDirectTexture);
return JNI()->CallVoidMethod(wrapped_obj, jBeginDrawingMethod, aWidth, aHeight);
}
void
AndroidGeckoSoftwareLayerClient::EndDrawing(const nsIntRect &aRect)
AndroidGeckoSoftwareLayerClient::EndDrawing(const nsIntRect &aRect, const nsAString &aMetadata, bool aHasDirectTexture)
{
NS_ASSERTION(!isNull(), "EndDrawing() called on null software layer client!");
AndroidBridge::AutoLocalJNIFrame(1);
return JNI()->CallVoidMethod(wrapped_obj, jEndDrawingMethod, aRect.x, aRect.y, aRect.width, aRect.height);
jstring jMetadata = JNI()->NewString(nsPromiseFlatString(aMetadata).get(), aMetadata.Length());
return JNI()->CallVoidMethod(wrapped_obj, jEndDrawingMethod, aRect.x, aRect.y, aRect.width,
aRect.height, jMetadata, aHasDirectTexture);
}
jobject