本文整理汇总了Python中trace.Tracer.wrap_ret方法的典型用法代码示例。如果您正苦于以下问题:Python Tracer.wrap_ret方法的具体用法?Python Tracer.wrap_ret怎么用?Python Tracer.wrap_ret使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类trace.Tracer
的用法示例。
在下文中一共展示了Tracer.wrap_ret方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: wrap_ret
# 需要导入模块: from trace import Tracer [as 别名]
# 或者: from trace.Tracer import wrap_ret [as 别名]
def wrap_ret(self, function, instance):
Tracer.wrap_ret(self, function, instance)
if function.name in ('glMapBuffer', 'glMapBufferARB'):
print ' struct buffer_mapping *mapping = get_buffer_mapping(target);'
print ' if (mapping) {'
print ' mapping->map = %s;' % (instance)
print ' mapping->length = 0;'
print ' __glGetBufferParameteriv(target, GL_BUFFER_SIZE, &mapping->length);'
print ' mapping->write = (access != GL_READ_ONLY);'
print ' }'
if function.name == 'glMapBufferRange':
print ' struct buffer_mapping *mapping = get_buffer_mapping(target);'
print ' if (mapping) {'
print ' mapping->map = %s;' % (instance)
print ' mapping->length = length;'
print ' mapping->write = access & GL_MAP_WRITE_BIT;'
print ' }'
示例2: wrap_ret
# 需要导入模块: from trace import Tracer [as 别名]
# 或者: from trace.Tracer import wrap_ret [as 别名]
def wrap_ret(self, function, instance):
Tracer.wrap_ret(self, function, instance)
if function.name in ("glMapBuffer", "glMapBufferARB"):
print " struct buffer_mapping *mapping = get_buffer_mapping(target);"
print " if (mapping) {"
print " mapping->map = %s;" % (instance)
print " mapping->length = 0;"
print " __glGetBufferParameteriv(target, GL_BUFFER_SIZE, &mapping->length);"
print " mapping->write = (access != GL_READ_ONLY);"
print " }"
if function.name == "glMapBufferRange":
print " struct buffer_mapping *mapping = get_buffer_mapping(target);"
print " if (mapping) {"
print " mapping->map = %s;" % (instance)
print " mapping->length = length;"
print " mapping->write = access & GL_MAP_WRITE_BIT;"
print " }"