GUI: Avoid useless surface copy before scaling
By using the const rawSurface function instead of the surfacePtr one,
there is no need to create a copy of the const argument.
(cherry picked from commit d21b42950a
)
This commit is contained in:
parent
c6adcbc1dc
commit
7dca536b26
1 changed files with 1 additions and 6 deletions
|
@ -594,12 +594,7 @@ const Graphics::ManagedSurface *scaleGfx(const Graphics::ManagedSurface *gfx, in
|
|||
w = nw;
|
||||
h = nh;
|
||||
|
||||
Graphics::ManagedSurface tmp(*gfx);
|
||||
|
||||
const Graphics::ManagedSurface *tmp2 = new Graphics::ManagedSurface(tmp.surfacePtr()->scale(w, h, filtering));
|
||||
tmp.free();
|
||||
|
||||
return tmp2;
|
||||
return new Graphics::ManagedSurface(gfx->rawSurface().scale(w, h, filtering));
|
||||
}
|
||||
|
||||
PicButtonWidget::PicButtonWidget(GuiObject *boss, int x, int y, int w, int h, const Common::U32String &tooltip, uint32 cmd, uint8 hotkey)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue