From: José Fonseca Date: Mon, 9 May 2011 20:27:02 +0000 (+0100) Subject: Merge branch 'master' into multi-context X-Git-Tag: 2.0_alpha^2~938 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c017dded3f1b3ebe3043b0e217bb3cd76a4e1a4e;p=tools%2Fapitrace.git Merge branch 'master' into multi-context Conflicts: glretrace.hpp glretrace_main.cpp --- c017dded3f1b3ebe3043b0e217bb3cd76a4e1a4e diff --cc glretrace.py index 9b46160,1674a79..706dbb4 --- a/glretrace.py +++ b/glretrace.py @@@ -125,15 -125,30 +125,24 @@@ class GlRetracer(Retracer) Retracer.retrace_function_body(self, function) + if function.name in ('glFlush', 'glFinish'): + print ' if (!glretrace::double_buffer) {' + print ' glretrace::frame_complete(call.no);' + print ' }' + + if function.name == 'glReadPixels': + print ' glFinish();' + print ' glretrace::frame_complete(call.no);' + def call_function(self, function): if function.name == "glViewport": - print ' bool reshape_window = false;' - print ' if (x + width > glretrace::window_width) {' - print ' glretrace::window_width = x + width;' - print ' reshape_window = true;' - print ' }' - print ' if (y + height > glretrace::window_height) {' - print ' glretrace::window_height = y + height;' - print ' reshape_window = true;' - print ' }' - print ' if (reshape_window) {' - print ' // XXX: does not always work' - print ' glretrace::drawable->resize(glretrace::window_width, glretrace::window_height);' - print ' reshape_window = false;' + print ' if (glretrace::drawable) {' + print ' int drawable_width = x + width;' + print ' int drawable_height = y + height;' + print ' if (drawable_width > (int)glretrace::drawable->width ||' + print ' drawable_height > (int)glretrace::drawable->height) {' + print ' glretrace::drawable->resize(drawable_width, drawable_height);' + print ' }' print ' }' if function.name == "glEnd": @@@ -158,12 -224,17 +218,17 @@@ return if function.name in self.draw_elements_function_names and arg.name == 'indices': - print ' %s = %s.blob();' % (lvalue, rvalue) + print ' %s = %s.toPointer();' % (lvalue, rvalue) return - if function.name.startswith('glUniform') and function.args[0].name == arg.name == 'location': + if arg.type is glapi.GLlocation \ + and 'program' not in [arg.name for arg in function.args]: print ' GLint program = -1;' print ' glGetIntegerv(GL_CURRENT_PROGRAM, &program);' + + if arg.type is glapi.GLlocationARB \ + and 'programObj' not in [arg.name for arg in function.args]: + print ' GLhandleARB programObj = glGetHandleARB(GL_PROGRAM_OBJECT_ARB);' Retracer.extract_arg(self, function, arg, arg_type, lvalue, rvalue)