keith2018/TLSHook

This hook is global for app.

Closed this issue · 3 comments

Run this demo, and we can see, that the SurfaceView is clear to Blue, even if the window backgroud is clear to Blue.

Run this demo, and we can see, that the SurfaceView is clear to Blue, even if the window backgroud is clear to Blue.

Yes, it will hook the whole process's GL function call.
if you want to hook the SurfaceView only, try check the egl context before hook

void hook_glClearColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) {
  EGLContext ctx = eglGetCurrentContext();
  if (ctx ...) {  // check context
	  LOGD("hook call glClear: (%f, %f, %f, %f)", red, green, blue, alpha);
	  if (cb_glClearColor) {
		cb_glClearColor(0.f, 0.f, 1.f, 1.f);
	  }
  }
}

Yes! it works, and i create a #2 to impl this feature, please check it.

Yes! it works, and i create a #2 to impl this feature, please check it.

thx for your contribution !