print r' hFocusWindow = hWnd;'
print r' pPresentationParameters->hDeviceWindow = hWnd;'
+ # notify frame has been completed
+ if method.name == 'Present':
+ print r' retrace::frameComplete(call);'
+
+ if 'pSharedHandle' in method.argNames():
+ print r' if (pSharedHandle) {'
+ print r' retrace::warning(call) << "shared surfaces unsupported\n";'
+ print r' pSharedHandle = NULL;'
+ print r' }'
+
Retracer.invokeInterfaceMethod(self, interface, method)
# check errors
print r' retrace::warning(call) << "failed\n";'
print r' }'
- if interface.name in self.bufferInterfaceNames and method.name == 'Lock' or \
- method.name == 'LockRect':
-
- if interface.name in self.bufferInterfaceNames:
- getDescMethod = interface.getMethodByName('GetDesc')
- descArg = getDescMethod.args[0]
- assert descArg.output
- descType = getDescMethod.args[0].type.type
- print ' if (!SizeToLock) {'
- print ' %s Desc;' % descType
- print ' _this->GetDesc(&Desc);'
- print ' SizeToLock = Desc.Size;'
- print ' }'
- elif method.name == 'LockRect':
- print ' size_t _LockedSize = _getLockSize(_this, %s);' % ', '.join(method.argNames()[:-1])
- else:
- raise NotImplementedError
+ if method.name in ('Lock', 'LockRect', 'LockBox'):
+ print ' VOID *_pbData = NULL;'
+ print ' size_t _LockedSize = 0;'
+ print ' _getLockInfo(_this, %s, _pbData, _LockedSize);' % ', '.join(method.argNames()[:-1])
+ print ' _this->SetPrivateData(GUID_APITRACE, &_pbData, sizeof _pbData, 0);'
+
+ if method.name in ('Unlock', 'UnlockRect', 'UnlockBox'):
+ print ' VOID *_pbData = 0;'
+ print ' DWORD dwSizeOfData = sizeof _pbData;'
+ print ' _this->GetPrivateData(GUID_APITRACE, &_pbData, &dwSizeOfData);'
+ print ' if (_pbData) {'
+ print ' retrace::delRegionByPointer(_pbData);'
+ print ' }'
if __name__ == '__main__':
print r'''
+#define INITGUID
+
#include <string.h>
#include <iostream>
}
+DEFINE_GUID(GUID_APITRACE,0X7D71CAC9,0X7F58,0X432C,0XA9,0X75,0XA1,0X9F,0XCF,0XCE,0XFD,0X14);
+
+
static HWND
createWindow(int width, int height) {
static bool first = TRUE;