summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Software/SWTexture.cpp
diff options
context:
space:
mode:
authorStenzek <stenzek@gmail.com>2017-10-30 21:51:42 +1000
committerStenzek <stenzek@gmail.com>2017-11-22 18:47:04 +1000
commit56afebeb44f1ace990d9383e9b840fdc27610029 (patch)
tree3717a9e24cde9cfcc870ebfb7e083b4db053c0e5 /Source/Core/VideoBackends/Software/SWTexture.cpp
parentf43d85921dc85ae586d69b21d28a7578835a55bd (diff)
AbstractTexture: Seperate CopyRectangleFromTexture to two methods
ScaleRectangleFromTexture, which does a draw, and CopyRectangleFromTexture, which where possible, does a bit-for-bit copy.
Diffstat (limited to 'Source/Core/VideoBackends/Software/SWTexture.cpp')
-rw-r--r--Source/Core/VideoBackends/Software/SWTexture.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/Source/Core/VideoBackends/Software/SWTexture.cpp b/Source/Core/VideoBackends/Software/SWTexture.cpp
index 184a223392..db9b56020a 100644
--- a/Source/Core/VideoBackends/Software/SWTexture.cpp
+++ b/Source/Core/VideoBackends/Software/SWTexture.cpp
@@ -56,9 +56,19 @@ void SWTexture::Bind(unsigned int stage)
{
}
-void SWTexture::CopyRectangleFromTexture(const AbstractTexture* source,
- const MathUtil::Rectangle<int>& srcrect,
- const MathUtil::Rectangle<int>& dstrect)
+void SWTexture::CopyRectangleFromTexture(const AbstractTexture* src,
+ const MathUtil::Rectangle<int>& src_rect, u32 src_layer,
+ u32 src_level, const MathUtil::Rectangle<int>& dst_rect,
+ u32 dst_layer, u32 dst_level)
+{
+ _assert_(src_level == 0 && src_layer == 0 && dst_layer == 0 && dst_level == 0);
+ CopyTextureData(src->GetConfig(), static_cast<const SWTexture*>(src)->m_data.data(),
+ src_rect.left, src_rect.top, src_rect.GetWidth(), src_rect.GetHeight(), m_config,
+ m_data.data(), dst_rect.left, dst_rect.top);
+}
+void SWTexture::ScaleRectangleFromTexture(const AbstractTexture* source,
+ const MathUtil::Rectangle<int>& srcrect,
+ const MathUtil::Rectangle<int>& dstrect)
{
const SWTexture* software_source_texture = static_cast<const SWTexture*>(source);