mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-19 19:15:26 +00:00
Use move semantics for present_frame
This commit is contained in:
parent
01cdc83aeb
commit
f913edede4
7 changed files with 9 additions and 9 deletions
|
@ -296,7 +296,7 @@ void GLGSRender::flip(const rsx::display_flip_info_t& info)
|
|||
}
|
||||
else
|
||||
{
|
||||
m_frame->present_frame(sshot_frame, buffer_width * 4, buffer_width, buffer_height, false);
|
||||
m_frame->present_frame(std::move(sshot_frame), buffer_width * 4, buffer_width, buffer_height, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,6 @@ public:
|
|||
virtual display_handle_t handle() const = 0;
|
||||
|
||||
virtual bool can_consume_frame() const = 0;
|
||||
virtual void present_frame(std::vector<u8>& data, u32 pitch, u32 width, u32 height, bool is_bgra) const = 0;
|
||||
virtual void present_frame(std::vector<u8>&& data, u32 pitch, u32 width, u32 height, bool is_bgra) const = 0;
|
||||
virtual void take_screenshot(std::vector<u8>&& sshot_data, u32 sshot_width, u32 sshot_height, bool is_bgra) = 0;
|
||||
};
|
||||
|
|
|
@ -749,7 +749,7 @@ void VKGSRender::flip(const rsx::display_flip_info_t& info)
|
|||
image_to_flip->pop_layout(*m_current_command_buffer);
|
||||
|
||||
flush_command_queue(true);
|
||||
auto src = sshot_vkbuf.map(0, sshot_size);
|
||||
const auto src = sshot_vkbuf.map(0, sshot_size);
|
||||
std::vector<u8> sshot_frame(sshot_size);
|
||||
memcpy(sshot_frame.data(), src, sshot_size);
|
||||
sshot_vkbuf.unmap();
|
||||
|
@ -762,7 +762,7 @@ void VKGSRender::flip(const rsx::display_flip_info_t& info)
|
|||
}
|
||||
else
|
||||
{
|
||||
m_frame->present_frame(sshot_frame, buffer_width * 4, buffer_width, buffer_height, is_bgra);
|
||||
m_frame->present_frame(std::move(sshot_frame), buffer_width * 4, buffer_width, buffer_height, is_bgra);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -787,10 +787,10 @@ bool gs_frame::can_consume_frame() const
|
|||
return video_provider.can_consume_frame();
|
||||
}
|
||||
|
||||
void gs_frame::present_frame(std::vector<u8>& data, u32 pitch, u32 width, u32 height, bool is_bgra) const
|
||||
void gs_frame::present_frame(std::vector<u8>&& data, u32 pitch, u32 width, u32 height, bool is_bgra) const
|
||||
{
|
||||
utils::video_provider& video_provider = g_fxo->get<utils::video_provider>();
|
||||
video_provider.present_frame(data, pitch, width, height, is_bgra);
|
||||
video_provider.present_frame(std::move(data), pitch, width, height, is_bgra);
|
||||
}
|
||||
|
||||
void gs_frame::take_screenshot(std::vector<u8>&& data, u32 sshot_width, u32 sshot_height, bool is_bgra)
|
||||
|
|
|
@ -78,7 +78,7 @@ public:
|
|||
bool get_mouse_lock_state();
|
||||
|
||||
bool can_consume_frame() const override;
|
||||
void present_frame(std::vector<u8>& data, u32 pitch, u32 width, u32 height, bool is_bgra) const override;
|
||||
void present_frame(std::vector<u8>&& data, u32 pitch, u32 width, u32 height, bool is_bgra) const override;
|
||||
void take_screenshot(std::vector<u8>&& data, u32 sshot_width, u32 sshot_height, bool is_bgra) override;
|
||||
|
||||
protected:
|
||||
|
|
|
@ -122,7 +122,7 @@ namespace utils
|
|||
return pts > m_last_video_pts_incoming;
|
||||
}
|
||||
|
||||
void video_provider::present_frame(std::vector<u8>& data, u32 pitch, u32 width, u32 height, bool is_bgra)
|
||||
void video_provider::present_frame(std::vector<u8>&& data, u32 pitch, u32 width, u32 height, bool is_bgra)
|
||||
{
|
||||
if (!m_active)
|
||||
{
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace utils
|
|||
void set_pause_time_us(usz pause_time_us);
|
||||
|
||||
bool can_consume_frame();
|
||||
void present_frame(std::vector<u8>& data, u32 pitch, u32 width, u32 height, bool is_bgra);
|
||||
void present_frame(std::vector<u8>&& data, u32 pitch, u32 width, u32 height, bool is_bgra);
|
||||
|
||||
void present_samples(u8* buf, u32 sample_count, u16 channels);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue