aboutsummaryrefslogtreecommitdiff
path: root/guilib/TextureDX.cpp
diff options
context:
space:
mode:
authorcharlydoes <charlydoes@svn>2009-10-13 18:03:02 +0000
committercharlydoes <charlydoes@svn>2009-10-13 18:03:02 +0000
commitf98c7216041f901e4b5ee03cb1c248b1324da783 (patch)
treec5522ac28682d319fd1caea4e15443b6cd5bc387 /guilib/TextureDX.cpp
parent56753a37d2329a433d44a72cd0990b6d30f31f51 (diff)
[WIN32DX] changed: LoadToGPU copy to texture in one go if pitch is the same.
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@23691 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib/TextureDX.cpp')
-rw-r--r--guilib/TextureDX.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/guilib/TextureDX.cpp b/guilib/TextureDX.cpp
index b38a4c8303..6f884555f6 100644
--- a/guilib/TextureDX.cpp
+++ b/guilib/TextureDX.cpp
@@ -101,11 +101,18 @@ void CDXTexture::LoadToGPU()
unsigned int srcPitch = GetPitch();
unsigned int rows = GetRows();
- for (unsigned int y = 0; y < rows; y++)
+ if (srcPitch == dstPitch)
{
- memcpy(dst, src, std::min(srcPitch, dstPitch));
- src += srcPitch;
- dst += dstPitch;
+ memcpy(dst, src, srcPitch * rows);
+ }
+ else
+ {
+ for (unsigned int y = 0; y < rows; y++)
+ {
+ memcpy(dst, src, std::min(srcPitch, dstPitch));
+ src += srcPitch;
+ dst += dstPitch;
+ }
}
}
m_texture->UnlockRect(0);