Viewport: Reduce unnecessary region redraws when scrolling viewports

This commit is contained in:
Jonathan G Rennison
2020-02-09 00:34:47 +00:00
parent 4d9e07e885
commit a152e2327c
11 changed files with 144 additions and 52 deletions

View File

@@ -509,7 +509,7 @@ void Blitter_32bppAnim::CopyToBuffer(const void *video, void *dst, int width, in
}
}
void Blitter_32bppAnim::ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y)
void Blitter_32bppAnim::ScrollBuffer(void *video, int left, int top, int width, int height, int scroll_x, int scroll_y)
{
assert(!_screen_disable_anim);
assert(video >= _screen.dst_ptr && video <= (uint32 *)_screen.dst_ptr + _screen.width + _screen.height * _screen.pitch);

View File

@@ -44,7 +44,7 @@ public:
void DrawRect(void *video, int width, int height, uint8 colour) override;
void CopyFromBuffer(void *video, const void *src, int width, int height) override;
void CopyToBuffer(const void *video, void *dst, int width, int height) override;
void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) override;
void ScrollBuffer(void *video, int left, int top, int width, int height, int scroll_x, int scroll_y) override;
int BufferSize(int width, int height) override;
void PaletteAnimate(const Palette &palette) override;
Blitter::PaletteAnimation UsePaletteAnimation() override;

View File

@@ -101,7 +101,7 @@ void Blitter_32bppBase::CopyImageToBuffer(const void *video, void *dst, int widt
}
}
void Blitter_32bppBase::ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y)
void Blitter_32bppBase::ScrollBuffer(void *video, int left, int top, int width, int height, int scroll_x, int scroll_y)
{
const uint32 *src;
uint32 *dst;

View File

@@ -28,7 +28,7 @@ public:
void CopyFromBuffer(void *video, const void *src, int width, int height) override;
void CopyToBuffer(const void *video, void *dst, int width, int height) override;
void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) override;
void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) override;
void ScrollBuffer(void *video, int left, int top, int width, int height, int scroll_x, int scroll_y) override;
int BufferSize(int width, int height) override;
void PaletteAnimate(const Palette &palette) override;
Blitter::PaletteAnimation UsePaletteAnimation() override;

View File

@@ -90,7 +90,7 @@ void Blitter_8bppBase::CopyImageToBuffer(const void *video, void *dst, int width
}
}
void Blitter_8bppBase::ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y)
void Blitter_8bppBase::ScrollBuffer(void *video, int left, int top, int width, int height, int scroll_x, int scroll_y)
{
const uint8 *src;
uint8 *dst;

View File

@@ -25,7 +25,7 @@ public:
void CopyFromBuffer(void *video, const void *src, int width, int height) override;
void CopyToBuffer(const void *video, void *dst, int width, int height) override;
void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) override;
void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) override;
void ScrollBuffer(void *video, int left, int top, int width, int height, int scroll_x, int scroll_y) override;
int BufferSize(int width, int height) override;
void PaletteAnimate(const Palette &palette) override;
Blitter::PaletteAnimation UsePaletteAnimation() override;

View File

@@ -198,7 +198,7 @@ public:
* @param scroll_x How much to scroll in X.
* @param scroll_y How much to scroll in Y.
*/
virtual void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) = 0;
virtual void ScrollBuffer(void *video, int left, int top, int width, int height, int scroll_x, int scroll_y) = 0;
/**
* Calculate how much memory there is needed for an image of this size in the video-buffer.

View File

@@ -28,7 +28,7 @@ public:
void CopyFromBuffer(void *video, const void *src, int width, int height) override {};
void CopyToBuffer(const void *video, void *dst, int width, int height) override {};
void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) override {};
void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) override {};
void ScrollBuffer(void *video, int left, int top, int width, int height, int scroll_x, int scroll_y) override {};
int BufferSize(int width, int height) override { return 0; };
void PaletteAnimate(const Palette &palette) override { };
Blitter::PaletteAnimation UsePaletteAnimation() override { return Blitter::PALETTE_ANIMATION_NONE; };