void LOTCompItem::buildRenderList()
{
- mRenderList.clear();
- std::vector<VDrawable *> list;
+ mDrawableList.clear();
for (auto i = mLayers.rbegin(); i != mLayers.rend(); ++i) {
LOTLayerItem *layer = *i;
- layer->renderList(list);
+ layer->renderList(mDrawableList);
}
- for(auto i : list) {
+ mRenderList.clear();
+ for(auto i : mDrawableList) {
i->sync();
mRenderList.push_back(&i->mCNode);
}
VBitmap bitmap((uchar *)buffer.buffer, buffer.width, buffer.height,
buffer.bytesPerLine, VBitmap::Format::ARGB32_Premultiplied, nullptr, nullptr);
+ /* schedule all preprocess task for this frame at once.
+ */
+ for (auto &e : mDrawableList) {
+ e->preprocess();
+ }
+
VPainter painter(&bitmap);
VRle mask;
for (auto i = mLayers.rbegin(); i != mLayers.rend(); ++i) {
mask = mask & inheritMask;
}
- // do preprocessing first to take advantage of thread pool.
- for(auto i : list) {
- i->preprocess();
- }
-
for(auto i : list) {
painter->setBrush(i->mBrush);
if (!mask.isEmpty()) {