mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-23 14:48:24 +00:00
common picture: --code inlining.
dec: 273029 -> 272789
This commit is contained in:
parent
c0cb8c0ce8
commit
be8cfd5f3f
2 changed files with 35 additions and 29 deletions
|
@ -22,6 +22,39 @@
|
|||
|
||||
#include "tvgPictureImpl.h"
|
||||
|
||||
/************************************************************************/
|
||||
/* Internal Class Implementation */
|
||||
/************************************************************************/
|
||||
|
||||
RenderUpdateFlag Picture::Impl::load()
|
||||
{
|
||||
if (loader) {
|
||||
if (!paint) {
|
||||
if (auto p = loader->paint()) {
|
||||
paint = p.release();
|
||||
loader->close();
|
||||
if (w != loader->w || h != loader->h) {
|
||||
if (!resizing) {
|
||||
w = loader->w;
|
||||
h = loader->h;
|
||||
}
|
||||
loader->resize(paint, w, h);
|
||||
resizing = false;
|
||||
}
|
||||
if (paint) return RenderUpdateFlag::None;
|
||||
}
|
||||
} else loader->sync();
|
||||
|
||||
if (!surface) {
|
||||
if ((surface = loader->bitmap().release())) {
|
||||
loader->close();
|
||||
return RenderUpdateFlag::Image;
|
||||
}
|
||||
}
|
||||
}
|
||||
return RenderUpdateFlag::None;
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
/* External Class Implementation */
|
||||
/************************************************************************/
|
||||
|
|
|
@ -90,35 +90,6 @@ struct Picture::Impl
|
|||
return !animated;
|
||||
}
|
||||
|
||||
RenderUpdateFlag load()
|
||||
{
|
||||
if (loader) {
|
||||
if (!paint) {
|
||||
if (auto p = loader->paint()) {
|
||||
paint = p.release();
|
||||
loader->close();
|
||||
if (w != loader->w || h != loader->h) {
|
||||
if (!resizing) {
|
||||
w = loader->w;
|
||||
h = loader->h;
|
||||
}
|
||||
loader->resize(paint, w, h);
|
||||
resizing = false;
|
||||
}
|
||||
if (paint) return RenderUpdateFlag::None;
|
||||
}
|
||||
} else loader->sync();
|
||||
|
||||
if (!surface) {
|
||||
if ((surface = loader->bitmap().release())) {
|
||||
loader->close();
|
||||
return RenderUpdateFlag::Image;
|
||||
}
|
||||
}
|
||||
}
|
||||
return RenderUpdateFlag::None;
|
||||
}
|
||||
|
||||
RenderTransform resizeTransform(const RenderTransform* pTransform)
|
||||
{
|
||||
//Overriding Transformation by the desired image size
|
||||
|
@ -334,6 +305,8 @@ struct Picture::Impl
|
|||
if (surface) return surface->buf32;
|
||||
else return nullptr;
|
||||
}
|
||||
|
||||
RenderUpdateFlag load();
|
||||
};
|
||||
|
||||
#endif //_TVG_PICTURE_IMPL_H_
|
||||
|
|
Loading…
Add table
Reference in a new issue