mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Expose ActivateProgram() and DeactivateProgram() to widget
This commit is contained in:
parent
3eaca9fb0c
commit
b4211fd4ba
@ -239,5 +239,15 @@ public class GeckoGLLayerClient extends GeckoLayerClient
|
||||
Layer.RenderContext screenContext = mLayerRenderer.createScreenContext();
|
||||
return mLayerRenderer.createFrame(false, pageContext, screenContext);
|
||||
}
|
||||
|
||||
/** For Gecko to use. */
|
||||
public void activateProgram() {
|
||||
mLayerRenderer.activateProgram();
|
||||
}
|
||||
|
||||
/** For Gecko to use. */
|
||||
public void deactivateProgram() {
|
||||
mLayerRenderer.deactivateProgram();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -121,6 +121,8 @@ jmethodID AndroidGeckoSoftwareLayerClient::jGetRenderOffsetMethod = 0;
|
||||
jclass AndroidGeckoGLLayerClient::jGeckoGLLayerClientClass = 0;
|
||||
jmethodID AndroidGeckoGLLayerClient::jGetViewTransformMethod = 0;
|
||||
jmethodID AndroidGeckoGLLayerClient::jCreateFrameMethod = 0;
|
||||
jmethodID AndroidGeckoGLLayerClient::jActivateProgramMethod = 0;
|
||||
jmethodID AndroidGeckoGLLayerClient::jDeactivateProgramMethod = 0;
|
||||
|
||||
jclass AndroidLayerRendererFrame::jLayerRendererFrameClass = 0;
|
||||
jmethodID AndroidLayerRendererFrame::jBeginDrawingMethod = 0;
|
||||
@ -387,6 +389,8 @@ AndroidGeckoGLLayerClient::InitGeckoGLLayerClientClass(JNIEnv *jEnv)
|
||||
"()Lorg/mozilla/gecko/gfx/ViewTransform;");
|
||||
jCreateFrameMethod = getMethod("createFrame",
|
||||
"(FFF)Lorg/mozilla/gecko/gfx/LayerRenderer$Frame;");
|
||||
jActivateProgramMethod = getMethod("activateProgram", "()V");
|
||||
jDeactivateProgramMethod = getMethod("deactivateProgram", "()V");
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -942,6 +946,30 @@ AndroidGeckoGLLayerClient::CreateFrame(AndroidLayerRendererFrame& aFrame,
|
||||
aFrame.Init(frameJObj);
|
||||
}
|
||||
|
||||
void
|
||||
AndroidGeckoGLLayerClient::ActivateProgram()
|
||||
{
|
||||
JNIEnv *env = GetJNIForThread();
|
||||
NS_ABORT_IF_FALSE(env, "No JNI environment at ActivateProgram()!");
|
||||
if (!env) {
|
||||
return;
|
||||
}
|
||||
|
||||
env->CallVoidMethod(wrapped_obj, jActivateProgramMethod);
|
||||
}
|
||||
|
||||
void
|
||||
AndroidGeckoGLLayerClient::DeactivateProgram()
|
||||
{
|
||||
JNIEnv *env = GetJNIForThread();
|
||||
NS_ABORT_IF_FALSE(env, "No JNI environment at DeactivateProgram()!");
|
||||
if (!env) {
|
||||
return;
|
||||
}
|
||||
|
||||
env->CallVoidMethod(wrapped_obj, jDeactivateProgramMethod);
|
||||
}
|
||||
|
||||
void
|
||||
AndroidLayerRendererFrame::BeginDrawing()
|
||||
{
|
||||
|
@ -272,11 +272,15 @@ public:
|
||||
void GetViewTransform(AndroidViewTransform& aViewTransform);
|
||||
void CreateFrame(AndroidLayerRendererFrame& aFrame, float aXOffset, float aYOffset,
|
||||
float aZoomFactor);
|
||||
void ActivateProgram();
|
||||
void DeactivateProgram();
|
||||
|
||||
private:
|
||||
static jclass jGeckoGLLayerClientClass;
|
||||
static jmethodID jGetViewTransformMethod;
|
||||
static jmethodID jCreateFrameMethod;
|
||||
static jmethodID jActivateProgramMethod;
|
||||
static jmethodID jDeactivateProgramMethod;
|
||||
|
||||
AndroidGeckoGLLayerClientViewTransformGetter mViewTransformGetter;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user