newPath = dasher.dashed(mPath);
}
mRleTask = VRaster::instance().generateStrokeInfo(
- newPath, mStroke.cap, mStroke.join, mStroke.width,
+ newPath, std::move(mRle), mStroke.cap, mStroke.join, mStroke.width,
mStroke.meterLimit);
} else {
- mRleTask = VRaster::instance().generateFillInfo(mPath, mFillRule);
+ mRleTask = VRaster::instance().generateFillInfo(mPath, std::move(mRle), mFillRule);
}
mFlag &= ~DirtyFlag(DirtyState::Path);
}
std::future<VRle> receiver;
bool stroke;
VPath path;
+ VRle rle;
FillRule fillRule;
CapStyle cap;
JoinStyle join;
VRle RleTask::operator()(FTOutline &outRef, SW_FT_Stroker &stroker)
{
+ rle.reset();
if (stroke) { // Stroke Task
outRef.convert(path);
outRef.convert(cap, join, width, meterLimit);
SW_FT_Stroker_Export(stroker, &outRef.ft);
- VRle rle;
SW_FT_Raster_Params params;
params.flags = SW_FT_RASTER_FLAG_DIRECT | SW_FT_RASTER_FLAG_AA;
sw_ft_grays_raster.raster_render(nullptr, ¶ms);
- return rle;
} else { // Fill Task
outRef.convert(path);
int fillRuleFlag = SW_FT_OUTLINE_NONE;
break;
}
outRef.ft.flags = fillRuleFlag;
- VRle rle;
SW_FT_Raster_Params params;
params.flags = SW_FT_RASTER_FLAG_DIRECT | SW_FT_RASTER_FLAG_AA;
params.source = &outRef.ft;
sw_ft_grays_raster.raster_render(nullptr, ¶ms);
- return rle;
}
+ return std::move(rle);
}
class RleTaskScheduler {
return receiver;
}
- std::future<VRle> strokeRle(const VPath &path, CapStyle cap, JoinStyle join,
+ std::future<VRle> strokeRle(const VPath &path, VRle &&rle, CapStyle cap, JoinStyle join,
float width, float meterLimit)
{
RleTask *task = new RleTask();
task->stroke = true;
task->path = path;
+ task->rle = std::move(rle);
task->cap = cap;
task->join = join;
task->width = width;
return async(task);
}
- std::future<VRle> fillRle(const VPath &path, FillRule fillRule)
+ std::future<VRle> fillRle(const VPath &path, VRle &&rle, FillRule fillRule)
{
RleTask *task = new RleTask();
task->path = path;
+ task->rle = std::move(rle);
task->fillRule = fillRule;
task->stroke = false;
return async(task);
VRaster::~VRaster() {}
-std::future<VRle> VRaster::generateFillInfo(const VPath &path,
+std::future<VRle> VRaster::generateFillInfo(const VPath &path, VRle &&rle,
FillRule fillRule)
{
if (path.isEmpty()) {
promise.set_value(VRle());
return promise.get_future();
}
- return raster_scheduler.fillRle(path, fillRule);
+ return raster_scheduler.fillRle(path, std::move(rle), fillRule);
}
-std::future<VRle> VRaster::generateStrokeInfo(const VPath &path, CapStyle cap,
+std::future<VRle> VRaster::generateStrokeInfo(const VPath &path, VRle &&rle, CapStyle cap,
JoinStyle join, float width,
float meterLimit)
{
promise.set_value(VRle());
return promise.get_future();
}
- return raster_scheduler.strokeRle(path, cap, join, width, meterLimit);
+ return raster_scheduler.strokeRle(path, std::move(rle), cap, join, width, meterLimit);
}
V_END_NAMESPACE
VRaster &operator=(VRaster const &) = delete;
VRaster &operator=(VRaster &&) = delete;
- std::future<VRle> generateFillInfo(const VPath &path,
+ std::future<VRle> generateFillInfo(const VPath &path, VRle &&rle,
FillRule fillRule = FillRule::Winding);
- std::future<VRle> generateStrokeInfo(const VPath &path, CapStyle cap,
+ std::future<VRle> generateStrokeInfo(const VPath &path, VRle &&rle, CapStyle cap,
JoinStyle join, float width,
float meterLimit);