diff options
author | elupus <elupus@svn> | 2010-02-23 23:22:37 +0000 |
---|---|---|
committer | elupus <elupus@svn> | 2010-02-23 23:22:37 +0000 |
commit | e7303d33844e8cbd200dd030492edaeee1b3841f (patch) | |
tree | a7273baa432dcdd17c105093c8d0ca7f995b6d68 /guilib/TextureDX.cpp | |
parent | 1f2f6553ba75f15edb6d17e826d6b71a87ccdd0d (diff) |
changed: avoid calculating minimum pitch for each row of image when copying to gpu
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@28082 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib/TextureDX.cpp')
-rw-r--r-- | guilib/TextureDX.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/guilib/TextureDX.cpp b/guilib/TextureDX.cpp index c55d81f894..baa733c787 100644 --- a/guilib/TextureDX.cpp +++ b/guilib/TextureDX.cpp @@ -97,6 +97,7 @@ void CDXTexture::LoadToGPU() unsigned char *src = m_pixels; unsigned int dstPitch = lr.Pitch; unsigned int srcPitch = GetPitch(); + unsigned int minPitch = std::min(srcPitch, dstPitch); unsigned int rows = GetRows(); if (srcPitch == dstPitch) @@ -107,7 +108,7 @@ void CDXTexture::LoadToGPU() { for (unsigned int y = 0; y < rows; y++) { - memcpy(dst, src, std::min(srcPitch, dstPitch)); + memcpy(dst, src, minPitch); src += srcPitch; dst += dstPitch; } |