GRAPHICS: Unify VectorRenderer blitting routines

This commit is contained in:
Eugene Sandulenko 2021-04-09 00:49:07 +02:00
parent dbf192fd13
commit d3f5d34b62
4 changed files with 5 additions and 22 deletions

View File

@ -457,7 +457,7 @@ public:
void drawCallback_BITMAP(const Common::Rect &area, const DrawStep &step) {
uint16 x, y, w, h;
stepGetPositions(step, area, x, y, w, h);
blitKeyBitmap(step.blitSrc, Common::Point(x, y));
blitKeyBitmap(step.blitSrc, Common::Point(x, y), true);
}
void drawCallback_CROSS(const Common::Rect &area, const DrawStep &step) {
@ -508,9 +508,7 @@ public:
*/
virtual void blitSurface(const Graphics::ManagedSurface *source, const Common::Rect &r) = 0;
virtual void blitKeyBitmap(const Graphics::ManagedSurface *source, const Common::Point &p) = 0;
virtual void blitManagedSurface(const Graphics::ManagedSurface *source, const Common::Point &p, bool themeTrans) = 0;
virtual void blitKeyBitmap(const Graphics::ManagedSurface *source, const Common::Point &p, bool themeTrans) = 0;
/**
* Draws a string into the screen. Wrapper for the Graphics::Font string drawing

View File

@ -746,7 +746,7 @@ blitSurface(const Graphics::ManagedSurface *source, const Common::Rect &r) {
template<typename PixelType>
void VectorRendererSpec<PixelType>::
blitManagedSurface(const Graphics::ManagedSurface *source, const Common::Point &p, bool themeTrans) {
blitKeyBitmap(const Graphics::ManagedSurface *source, const Common::Point &p, bool themeTrans) {
Common::Rect drawRect(p.x, p.y, p.x + source->w, p.y + source->h);
drawRect.clip(_clippingArea);
drawRect.moveTo(0, 0);
@ -761,20 +761,6 @@ blitManagedSurface(const Graphics::ManagedSurface *source, const Common::Point &
_activeSurface->blitFrom(*source, drawRect, p);
}
template<typename PixelType>
void VectorRendererSpec<PixelType>::
blitKeyBitmap(const Graphics::ManagedSurface *source, const Common::Point &p) {
Common::Rect drawRect(p.x, p.y, p.x + source->w, p.y + source->h);
drawRect.clip(_clippingArea);
drawRect.moveTo(0, 0);
if (drawRect.isEmpty()) {
return;
}
_activeSurface->transBlitFrom(*source, drawRect, p, _bitmapAlphaColor);
}
template<typename PixelType>
void VectorRendererSpec<PixelType>::
applyScreenShading(GUI::ThemeEngine::ShadingStyle shadingStyle) {

View File

@ -89,8 +89,7 @@ public:
void fillSurface() override;
void blitSurface(const Graphics::ManagedSurface *source, const Common::Rect &r) override;
void blitManagedSurface(const Graphics::ManagedSurface *source, const Common::Point &p, bool themeTrans) override;
void blitKeyBitmap(const Graphics::ManagedSurface *source, const Common::Point &p) override;
void blitKeyBitmap(const Graphics::ManagedSurface *source, const Common::Point &p, bool themeTrans) override;
void applyScreenShading(GUI::ThemeEngine::ShadingStyle shadingStyle) override;

View File

@ -1277,7 +1277,7 @@ void ThemeEngine::drawSurface(const Common::Point &p, const Graphics::ManagedSur
return;
_vectorRenderer->setClippingRect(_clip);
_vectorRenderer->blitManagedSurface(&surface, p, themeTrans);
_vectorRenderer->blitKeyBitmap(&surface, p, themeTrans);
Common::Rect dirtyRect = Common::Rect(p.x, p.y, p.x + surface.w, p.y + surface.h);
dirtyRect.clip(_clip);