From 6699b688d7dbd7ad4a07ca1c1f77db864012010a Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Wed, 18 Apr 2012 10:28:46 -0700 Subject: Publish and use libOpenglRender interface header The emulator opengles.c file duplicated the function declarations from libOpenglRenderer's render_api.h instead of including it directly. This led to multiple bugs since the declarations didn't actually match, but there was no way for the compiler or dynamic loader to check this. This change makes opengles.c include render_api.h to get function pointer prototypes, and changes the prototypes/implementation as necessary to make both sides actually match. It should be much more difficult to introduce interface mismatch bugs now. Two bugs this change would have prevented: (a) The interface mismatch caused by inconsistent branching which led to GPU acceleration crashing on Windows. With this change, we would have caught the problem at compile time. (b) The emulator verbose log has always been printing "Can't start OpenGLES renderer?" even when the renderer started fine. This is because the renderer was returning a bool (true == success) but the emulator's declaration said it returned int, and the emulator assumed 0 meant success. This difference in return type should now be caught at compile time. Change-Id: I5b3c70c9a40854332d67e37333acd6edb6ad01f6 --- Makefile.target | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile.target') diff --git a/Makefile.target b/Makefile.target index 1961acf..f7122fa 100644 --- a/Makefile.target +++ b/Makefile.target @@ -274,7 +274,7 @@ LOCAL_CFLAGS += \ $(EMULATOR_TARGET_CFLAGS) \ -DCONFIG_STANDALONE_CORE \ -LOCAL_CFLAGS += -Wno-missing-field-initializers +LOCAL_CFLAGS += -Isdk/emulator/opengl/host/include -Wno-missing-field-initializers LOCAL_STATIC_LIBRARIES := \ -- cgit v1.1