]> git.cworth.org Git - apitrace/blobdiff - wrappers/d3d9trace.py
Factor out the lock rect size computation.
[apitrace] / wrappers / d3d9trace.py
index 300cfa2005a8795614d02b7ab2d7371fe577adfb..566ac76e0b7015c9e03a08bd65b54ec4e0a0ca2f 100644 (file)
@@ -80,20 +80,7 @@ class D3D9Tracer(DllTracer):
                 print '        }'
                 print '        m_pbData = *ppbData;'
             elif interface.name == 'IDirect3DSurface9':
-                print '        UINT Width;'
-                print '        UINT Height;'
-                print '        if (pRect) {'
-                print '            Width  = pRect->right  - pRect->left;'
-                print '            Height = pRect->bottom - pRect->top;'
-                print '        } else {'
-                print '            %s Desc;' % descType
-                print '            m_pInstance->GetDesc(&Desc);'
-                print '            Width  = Desc.Width;'
-                print '            Height = Desc.Height;'
-                print '        }'
-                print '        m_SizeToLock = Height * pLockedRect->Pitch;'
-                # TODO: take in consideration the width and pixels and blocks
-                print '        (void)Width;'
+                print '        m_SizeToLock = _lockSize(_this, pLockedRect, pRect);'
                 print '        m_pbData = pLockedRect->pBits;'
             else:
                 raise NotImplementedError